diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..da4313a7 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +# This allows generated code to be indexed correctly +*.rb linguist-generated=false \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index adb10f1b..b6d507eb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,88 +1,24 @@ +# Maintained in moderation-api/sdk-generator (custom/ruby). Edits here are overwritten. name: CI on: push: - branches: - - '**' - - '!integrated/**' - - '!stl-preview-head/**' - - '!stl-preview-base/**' - - '!generated' - - '!codegen/**' - - 'codegen/stl/**' + branches: [main] pull_request: - branches-ignore: - - 'stl-preview-head/**' - - 'stl-preview-base/**' + +permissions: + contents: read jobs: build: - timeout-minutes: 10 - name: build - permissions: - contents: read - id-token: write - runs-on: ${{ startsWith(github.repository, 'stainless-sdks/') && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} - if: |- - github.repository == 'stainless-sdks/moderation-api-ruby' && - (github.event_name == 'push' || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata') + runs-on: ubuntu-latest steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - - name: Set up Ruby - uses: ruby/setup-ruby@c4e5b1316158f92e3d49443a9d58b31d25ac0f8f # v1.306.0 + - uses: ruby/setup-ruby@c4e5b1316158f92e3d49443a9d58b31d25ac0f8f # v1.306.0 with: + ruby-version: "3.2" bundler-cache: false - - run: |- - bundle install - - - name: Get GitHub OIDC Token - if: |- - github.repository == 'stainless-sdks/moderation-api-ruby' && - !startsWith(github.ref, 'refs/heads/stl/') - id: github-oidc - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 - with: - script: core.setOutput('github_token', await core.getIDToken()); - - - name: Build and upload gem artifacts - if: |- - github.repository == 'stainless-sdks/moderation-api-ruby' && - !startsWith(github.ref, 'refs/heads/stl/') - env: - URL: https://pkg.stainless.com/s - AUTH: ${{ steps.github-oidc.outputs.github_token }} - SHA: ${{ github.sha }} - PACKAGE_NAME: moderation_api - run: ./scripts/utils/upload-artifact.sh - lint: - timeout-minutes: 10 - name: lint - runs-on: ${{ startsWith(github.repository, 'stainless-sdks/') && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} - if: github.event_name == 'push' || github.event.pull_request.head.repo.fork - - steps: - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - - name: Set up Ruby - uses: ruby/setup-ruby@c4e5b1316158f92e3d49443a9d58b31d25ac0f8f # v1.306.0 - with: - bundler-cache: false - - run: |- - bundle install - - - name: Run lints - run: ./scripts/lint - test: - timeout-minutes: 10 - name: test - runs-on: ${{ startsWith(github.repository, 'stainless-sdks/') && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} - if: github.event_name == 'push' || github.event.pull_request.head.repo.fork - steps: - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - - name: Set up Ruby - uses: ruby/setup-ruby@c4e5b1316158f92e3d49443a9d58b31d25ac0f8f # v1.306.0 - with: - bundler-cache: false - - run: |- - bundle install - - - name: Run tests - run: ./scripts/test + - run: bundle install + - run: bundle exec rubocop --format github + - run: gem build moderation_api.gemspec + - name: Load the gem + run: bundle exec ruby -Ilib -e 'require "moderation_api"; require "moderation_api/webhook_signature"; ModerationApi::ModerationApi; ModerationApi::WebhookSignature' diff --git a/.github/workflows/publish-gem.yml b/.github/workflows/publish-gem.yml index 4fea8959..746c410b 100644 --- a/.github/workflows/publish-gem.yml +++ b/.github/workflows/publish-gem.yml @@ -1,31 +1,30 @@ -# This workflow is triggered when a GitHub release is created. -# It can also be run manually to re-publish to rubygems.org in case it failed for some reason. -# You can run this workflow by navigating to https://www.github.com/moderation-api/sdk-ruby/actions/workflows/publish-gem.yml +# Maintained in moderation-api/sdk-generator (custom/ruby). Edits here are overwritten. name: Publish Gem on: - workflow_dispatch: - release: types: [published] + workflow_dispatch: + +permissions: + contents: read jobs: publish: - name: publish runs-on: ubuntu-latest - steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - - name: Set up Ruby - uses: ruby/setup-ruby@c4e5b1316158f92e3d49443a9d58b31d25ac0f8f # v1.306.0 + - uses: ruby/setup-ruby@c4e5b1316158f92e3d49443a9d58b31d25ac0f8f # v1.306.0 with: - bundler-cache: false - - run: |- - bundle install - - - name: Publish to RubyGems.org + ruby-version: "3.2" + - name: Check the release tag matches the gem version + if: github.event_name == 'release' run: | - bash ./bin/publish-gem + version=$(ruby -e 'puts Gem::Specification.load("moderation_api.gemspec").version') + if [ "${GITHUB_REF_NAME#v}" != "$version" ]; then + echo "::error::Release tag $GITHUB_REF_NAME does not match gem version $version" + exit 1 + fi + - run: gem build moderation_api.gemspec + - run: gem push moderation_api-*.gem env: - # `RUBYGEMS_HOST` is only required for private gem repositories, not https://rubygems.org - RUBYGEMS_HOST: ${{ secrets.MODERATION_API_RUBYGEMS_HOST || secrets.RUBYGEMS_HOST }} GEM_HOST_API_KEY: ${{ secrets.MODERATION_API_GEM_HOST_API_KEY || secrets.GEM_HOST_API_KEY }} diff --git a/.github/workflows/release-doctor.yml b/.github/workflows/release-doctor.yml deleted file mode 100644 index 74d392a4..00000000 --- a/.github/workflows/release-doctor.yml +++ /dev/null @@ -1,22 +0,0 @@ -name: Release Doctor -on: - pull_request: - branches: - - main - workflow_dispatch: - -jobs: - release_doctor: - name: release doctor - runs-on: ubuntu-latest - if: github.repository == 'moderation-api/sdk-ruby' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next') - - steps: - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - - - name: Check release environment - run: | - bash ./bin/check-release-environment - env: - RUBYGEMS_HOST: ${{ secrets.MODERATION_API_RUBYGEMS_HOST || secrets.RUBYGEMS_HOST }} - GEM_HOST_API_KEY: ${{ secrets.MODERATION_API_GEM_HOST_API_KEY || secrets.GEM_HOST_API_KEY }} diff --git a/.gitignore b/.gitignore index fc9eb287..536e2dcd 100644 --- a/.gitignore +++ b/.gitignore @@ -1,11 +1,10 @@ *.gem -.idea/ -.ignore -.prism.log -.stdy.log -.ruby-lsp/ -.yardoc/ -bin/tapioca -Brewfile.lock.json -doc/ -sorbet/tapioca/* +.rbenv-gemsets +.DS_Store +**/.speakeasy/temp/ +**/.speakeasy/logs/ +.speakeasy/reports +bin/ +sorbet/rbi +.env +.env.local diff --git a/.release-please-manifest.json b/.release-please-manifest.json deleted file mode 100644 index 29ad411b..00000000 --- a/.release-please-manifest.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - ".": "2.41.0" -} \ No newline at end of file diff --git a/.rubocop-strict.yml b/.rubocop-strict.yml new file mode 100644 index 00000000..bd18b8d6 --- /dev/null +++ b/.rubocop-strict.yml @@ -0,0 +1,16 @@ +inherit_from: .rubocop.yml + +# Re-enable Style/StringLiterals for strict linting (e.g. internal CI). +# The base .rubocop.yml disables this rule so customers with single-quote +# conventions aren't broken. Use RUBOCOP_OPTS="--config .rubocop-strict.yml" +# to opt in to enforcement. +Style/StringLiterals: + Enabled: true + EnforcedStyle: double_quotes + Exclude: + - Gemfile + - "*.gemspec" + - lib/crystalline.rb + - lib/crystalline/**/* + - lib/**/sdk_hooks/**/* + - sorbet/**/* diff --git a/.rubocop.yml b/.rubocop.yml index 5e93f4fc..70da2a92 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,296 +1,105 @@ -# yaml-language-server: $schema=https://www.rubyschema.org/rubocop.json ---- -# Explicitly disable pending cops for now. This is the default behaviour but -# this avoids a large warning every time we run it. -# Stop RuboCop nagging about rubocop-rake. -# Ensure that RuboCop validates according to the lowest version of Ruby that we support. +plugins: + - rubocop-minitest + AllCops: Exclude: - - "bin/*" - NewCops: enable - SuggestExtensions: false - TargetRubyVersion: 3.2 - -# Whether MFA is required or not should be left to the token configuration. -Gemspec/RequireMFA: + - Rakefile + - bin/**/* + TargetRubyVersion: "3.2" +Metrics: Enabled: false - -# Don't require this extra line break, it can be excessive. -Layout/EmptyLineAfterGuardClause: +Style/IfInsideElse: + Enabled: false +# Temporary until Ruby deals with empty responses correctly +Style/EmptyElse: + Enabled: false +Style/GuardClause: + Enabled: false +Style/ConditionalAssignment: + Enabled: false +Style/Documentation: + Enabled: false +Style/NegatedIf: + Enabled: false +Style/SoleNestedConditional: + Enabled: false +Style/AccessorGrouping: Enabled: false - -# Don't leave complex assignment values hanging off to the right. Layout/EndAlignment: - EnforcedStyleAlignWith: variable - -Layout/FirstArrayElementLineBreak: - Enabled: true - -Layout/FirstHashElementLineBreak: - Enabled: true - -Layout/FirstMethodArgumentLineBreak: - Enabled: true - -Layout/FirstMethodParameterLineBreak: - Enabled: true - -# Set a reasonable line length; rely on other cops to correct long lines. + EnforcedStyleAlignWith: start_of_line + Enabled: false Layout/LineLength: - AllowedPatterns: - - "^\\s*#.*$" - - ^require(_relative)? - - "ModerationAPI::Internal::Type::BaseModel$" - - "^\\s*[A-Z0-9_]+ = :" - - "ModerationAPI::(Models|Resources|Test)::" - Max: 110 - -Layout/MultilineArrayLineBreaks: - Enabled: true - -# Start the assignment on the same line variable is mentioned. -Layout/MultilineAssignmentLayout: - EnforcedStyle: same_line - -Layout/MultilineHashKeyLineBreaks: - Enabled: true - -Layout/MultilineMethodArgumentLineBreaks: - Enabled: true - -Layout/MultilineMethodParameterLineBreaks: - Enabled: true - -# Prefer compact hash literals. -Layout/SpaceInsideHashLiteralBraces: - EnforcedStyle: no_space - Exclude: - - "**/*.rbi" - -Lint/BooleanSymbol: Enabled: false - -# This option occasionally mangles identifier names -Lint/DeprecatedConstants: - Exclude: - - "**/*.rbi" - -# We use pattern assertion in tests to ensure correctness. -Lint/DuplicateMatchPattern: - Exclude: - - "test/**/*" - -# Fairly useful in tests for pattern assertions. -Lint/EmptyInPattern: - Exclude: - - "test/**/*" - -Lint/MissingCopEnableDirective: - Exclude: - - "examples/**/*.rb" - +Lint/EmptyConditionalBody: + Enabled: false Lint/MissingSuper: - Exclude: - - "**/*.rbi" - -Lint/SymbolConversion: - Exclude: - - "**/*.rbi" - -# Disabled for safety reasons, this option changes code semantics. -Lint/UnusedMethodArgument: - AutoCorrect: false - -# This option is prone to causing accidental bugs. -Lint/UselessAssignment: - AutoCorrect: false - Exclude: - - "examples/**/*.rb" - -Metrics/AbcSize: Enabled: false - -Metrics/BlockLength: - AllowedPatterns: - - assert_pattern - - type_alias - - define_sorbet_constant! - Exclude: - - "**/*.rbi" - -Metrics/ClassLength: +Style/CaseLikeIf: Enabled: false - -Metrics/CollectionLiteralLength: - Exclude: - - "test/**/*" - -Metrics/CyclomaticComplexity: +#To eventually re-enable: +Layout/EmptyLines: Enabled: false - -Metrics/MethodLength: +Layout/EmptyLinesAroundMethodBody: Enabled: false - -Metrics/ModuleLength: +Layout/EmptyLineBetweenDefs: Enabled: false - -Metrics/ParameterLists: +Layout/EmptyLineAfterGuardClause: Enabled: false - -Metrics/PerceivedComplexity: +Layout/EmptyLinesAroundModuleBody: Enabled: false - -Naming/AccessorMethodName: +Layout/MultilineBlockLayout: Enabled: false - -# Need to preserve block identifier for documentation. -Naming/BlockForwarding: +Lint/UnusedMethodArgument: Enabled: false - -# Underscores are generally useful for disambiguation. -Naming/ClassAndModuleCamelCase: +Layout/TrailingWhitespace: + Enabled: false +Style/IfUnlessModifier: + Enabled: false +Naming/AccessorMethodName: Enabled: false - Naming/MethodParameterName: Enabled: false - -Naming/PredicatePrefix: - Exclude: - - "**/*.rbi" - -Naming/VariableNumber: +Layout/SpaceInsideHashLiteralBraces: Enabled: false - -# Nothing wrong with inline private methods. -Style/AccessModifierDeclarations: +Layout/FirstHashElementIndentation: Enabled: false - -Style/AccessorGrouping: - Exclude: - - "**/*.rbi" - -# Behaviour of alias_method is more predictable. -Style/Alias: - EnforcedStyle: prefer_alias_method - -# And/or have confusing precedence, avoid them. -Style/AndOr: - EnforcedStyle: always - -Style/ArgumentsForwarding: +Style/TrailingCommaInHashLiteral: Enabled: false - -Style/BisectedAttrAccessor: - Exclude: - - "**/*.rbi" - -# We prefer nested modules in lib/, but are currently using compact style for tests. -Style/ClassAndModuleChildren: - Exclude: - - "test/**/*" - -Style/CommentAnnotation: +Style/TrailingCommaInArrayLiteral: Enabled: false - -# We should go back and add these docs, but ignore for now. -Style/Documentation: +Layout/EmptyLinesAroundBlockBody: Enabled: false - -# Allow explicit empty elses, for clarity. -Style/EmptyElse: +Layout/EmptyLinesAroundClassBody: Enabled: false - -Style/EmptyMethod: - Exclude: - - "**/*.rbi" - -# We commonly use ENV['KEY'], it's OK. -Style/FetchEnvVar: +Style/WordArray: Enabled: false - -# Just to be safe, ensure nobody is mutating our internal strings. -Style/FrozenStringLiteralComment: - EnforcedStyle: always - Exclude: - - "**/*.rbi" - -# Nothing wrong with clear if statements. -Style/IfUnlessModifier: +Style/RedundantReturn: # https://github.com/rubocop/rubocop/issues/12394 Enabled: false - -# Rubocop is pretty bad about mangling single line lambdas. -Style/Lambda: +Style/RedundantAssignment: Enabled: false - -# Prefer consistency in method calling syntax. -Style/MethodCallWithArgsParentheses: - AllowedMethods: - - raise - Enabled: true - Exclude: - - "**/*.gemspec" - -Style/MultilineBlockChain: +Lint/LiteralAsCondition: Enabled: false - -# Perfectly fine. -Style/MultipleComparison: +Naming/VariableNumber: Enabled: false - -Style/MutableConstant: - Exclude: - - "**/*.rbi" - -# Not all parameters should be named. -Style/NumberedParameters: +# rubyfmt enforces double quotes on generated code, but customer-authored files +# (sdk_hooks, tests, etc.) may use single quotes, so we don't enforce this rule. +Style/StringLiterals: Enabled: false - -Style/NumberedParametersLimit: - Max: 2 - -# Reasonable to use brackets for errors with long messages. -Style/RaiseArgs: +Style/BlockDelimiters: Enabled: false - -# Be explicit about `RuntimeError`s. -Style/RedundantException: +Style/MultilineTernaryOperator: Enabled: false - -Style/RedundantInitialize: - Exclude: - - "**/*.rbi" - -Style/RedundantParentheses: - Exclude: - - "**/*.rbi" - -# Prefer slashes for regex literals. -Style/RegexpLiteral: - EnforcedStyle: slashes - -# Allow explicit ifs, especially for imperative use. -Style/SafeNavigation: +Layout/EmptyLinesAroundExceptionHandlingKeywords: Enabled: false - -Style/SignalException: - Exclude: - - Rakefile - - "**/*.rake" - -# We use these sparingly, where we anticipate future branches for the -# inner conditional. -Style/SoleNestedConditional: +Style/EmptyMethod: Enabled: false - -# Prefer double quotes so that interpolation can be easily added. -Style/StringLiterals: - EnforcedStyle: double_quotes - -# Prefer explicit symbols for clarity; you can search for `:the_symbol`. -Style/SymbolArray: - EnforcedStyle: brackets - -# This option makes examples harder to read for ruby novices. -Style/SymbolProc: - Exclude: - - "examples/**/*.rb" +Layout/MultilineOperationIndentation: + Enabled: false +Layout/MultilineMethodCallIndentation: + Enabled: false +Layout/SpaceInLambdaLiteral: + Enabled: false +Layout/FirstArgumentIndentation: + Enabled: false +Layout/FirstArrayElementIndentation: + EnforcedStyle: consistent diff --git a/.ruby-version b/.ruby-version deleted file mode 100644 index 944880fa..00000000 --- a/.ruby-version +++ /dev/null @@ -1 +0,0 @@ -3.2.0 diff --git a/.solargraph.yml b/.solargraph.yml deleted file mode 100644 index 43878903..00000000 --- a/.solargraph.yml +++ /dev/null @@ -1,11 +0,0 @@ ---- -max_files: 0 -include: - - '*.gemspec' - - 'Rakefile' - - 'examples/**/*.rb' - - 'lib/**/*.rb' - - 'test/moderation_api/resource_namespaces.rb' - - 'test/moderation_api/test_helper.rb' -exclude: - - 'rbi/**/*' diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock new file mode 100644 index 00000000..b102f3bd --- /dev/null +++ b/.speakeasy/gen.lock @@ -0,0 +1,2894 @@ +lockVersion: 2.0.0 +id: a78f35a2-6d8d-4b9f-8962-89b8103f2924 +management: + docChecksum: 3320e8867e978fb3c091936a85b4b990 + docVersion: 1.1.0 + speakeasyVersion: internal + generationVersion: internal + releaseVersion: 3.0.0 + configChecksum: 96571fc789a5241bf43ea33d2ada495f + repoURL: https://github.com/moderation-api/sdk-ruby + installationURL: https://github.com/moderation-api/sdk-ruby + published: true +features: + ruby: + additionalProperties: 0.1.1 + constsAndDefaults: 0.1.4 + core: 3.11.36 + examples: 2.81.8 + flattening: 2.81.1 + globalSecurity: 2.81.11 + globalSecurityFlattening: 0.1.0 + globalServerURLs: 2.83.1 + groups: 2.81.3 + ignores: 2.81.1 + nameOverrides: 2.81.4 + nullables: 0.1.0 + openEnums: 0.1.2 + pagination: 0.1.1 + responseFormat: 0.1.0 + unions: 0.1.7 +trackedFiles: + .gitattributes: + last_write_checksum: sha1:ddc1beb0214aecada04e60ef2e038729bd8d20e6 + .rubocop-strict.yml: + last_write_checksum: sha1:452cf23c1aac793c4f54d66fced59fdacab69142 + .rubocop.yml: + last_write_checksum: sha1:43650c745c2254f02a2966922cb744e87115505b + Gemfile: + last_write_checksum: sha1:8c1b6fa9505f61abd0fb6741f8094e9655a55495 + Gemfile.lock: + last_write_checksum: sha1:7988b48d711b2c19be1de58fdfc4af54b624b52b + Rakefile: + last_write_checksum: sha1:c572639efdae8c7b24141ee5c02d8f009e101ed8 + USAGE.md: + last_write_checksum: sha1:9ab3fdf1f1d6c8130977eb9e812b0587313a905f + docs/models/components/authenticationerrorcode.md: + last_write_checksum: sha1:ab6bc60a32b0b9ee2508c85248f5fe17162e2fc2 + docs/models/components/badrequesterrorcode.md: + last_write_checksum: sha1:b2a989dadc2b47532e51c236ede1e7e18b6e6c31 + docs/models/components/block.md: + last_write_checksum: sha1:85e7f9959076166397c429e3ad1b86f11e5f84e0 + docs/models/components/channel.md: + last_write_checksum: sha1:e69e7fbef661fb4ac41c09993b1066ed2160d1c8 + docs/models/components/conflicterrorcode.md: + last_write_checksum: sha1:06c222193e357259810dc0dbcf03b6330fb63eb3 + docs/models/components/contenttype.md: + last_write_checksum: sha1:560b3f9e8b9a526bae9f3671ab30f65d5d629146 + docs/models/components/errorissue.md: + last_write_checksum: sha1:d88195273e3a00245b2e88c9087548e142805643 + docs/models/components/flaggingmode.md: + last_write_checksum: sha1:abb0c500f072724746e12e5c557d035e6b576027 + docs/models/components/internalservererrorcode.md: + last_write_checksum: sha1:031c63169ea388775fab899e4aa90f2fd8331d8b + docs/models/components/metadata.md: + last_write_checksum: sha1:5bf679a558962d1ddb75c1afa8f4a8d92a7dc515 + docs/models/components/metrics.md: + last_write_checksum: sha1:b7851dce28f3aabae46767561365170ca4394c1e + docs/models/components/notfounderrorcode.md: + last_write_checksum: sha1:03545f4ad46db87f02bc362fc9d2d1ca9ae1d622 + docs/models/components/pagination.md: + last_write_checksum: sha1:a9340a257728523afd5c40ec657c125d9d81b9cd + docs/models/components/path.md: + last_write_checksum: sha1:cc4aff32a3ad21813b6b79bea1030b11d8d1c2fa + docs/models/components/permissiondeniederrorcode.md: + last_write_checksum: sha1:90a4acfe5145a829a9e43292e10b2fa2386a25ac + docs/models/components/project.md: + last_write_checksum: sha1:546b2ac41dbbaa231c9425edfd4ab5d1b7ae422b + docs/models/components/projectglobalflaggingmode.md: + last_write_checksum: sha1:072fd976ac8ec5889d5ad0409030afd9096cb2d6 + docs/models/components/projectwithkey.md: + last_write_checksum: sha1:ed95e0ec5048c65ce3a3058ebe4ad16533554dc6 + docs/models/components/projectwithkeyglobalflaggingmode.md: + last_write_checksum: sha1:e2da953b289723d0bde8b2dea53ae3522bb5b9d8 + docs/models/components/publicauthor.md: + last_write_checksum: sha1:de2dfdaf8f6a8b188b5178fc8854e9a1a47dc25c + docs/models/components/ratelimiterrorcode.md: + last_write_checksum: sha1:1e7c3a8aae271305b65271d83a0d35d1dd93831a + docs/models/components/riskevaluation.md: + last_write_checksum: sha1:c70b8d771bbc119c34e4784dcdea08f3b51a0b0c + docs/models/components/security.md: + last_write_checksum: sha1:91811992aef9c358acbff5bf8db52e478fea54c4 + docs/models/components/status.md: + last_write_checksum: sha1:5a61898f1a4ec4e66678f0e58a53e62298671d62 + docs/models/components/transcriptionquality.md: + last_write_checksum: sha1:dccb6e147867859bb55ca89d8be8b2c6a451d844 + docs/models/components/trustlevel.md: + last_write_checksum: sha1:2c6430450c436021710ec3ceb5a9daac5add8230 + docs/models/errors/authenticationerror.md: + last_write_checksum: sha1:e665b3ccf19b24995501bef53595800c18b0be1b + docs/models/errors/badrequesterror.md: + last_write_checksum: sha1:4843e4488abf939ad7fd37ecb15eefe8a05f9df0 + docs/models/errors/conflicterror.md: + last_write_checksum: sha1:21019744a14180a109cbd78fb4e3089bcca9c79c + docs/models/errors/internalservererror.md: + last_write_checksum: sha1:cddad91cd59742b52b48d3eba382b4fe093e6ac2 + docs/models/errors/notfounderror.md: + last_write_checksum: sha1:a3bccac304cb8f1441443df778cf3ed9d8fa72ce + docs/models/errors/permissiondeniederror.md: + last_write_checksum: sha1:90d71a4dfa5b10c7ec75509d3cd286c27d061eec + docs/models/errors/ratelimiterror.md: + last_write_checksum: sha1:1d8b6a1512a9df27fe36a1b613b459d65c4ff1cb + docs/models/operations/actionrequest.md: + last_write_checksum: sha1:14b53454f17b5f8c3262ac9486eadfec17601689 + docs/models/operations/actionstat.md: + last_write_checksum: sha1:f188e87a8fa8cae052d60d784c316942c7fdb75b + docs/models/operations/addwordlistwordsrequest.md: + last_write_checksum: sha1:b8a055113ac0f8072836cb469e85359da64af118 + docs/models/operations/addwordlistwordsrequestbody.md: + last_write_checksum: sha1:ba31b2426a81f08bb6484ef0cacb405e62dccfd1 + docs/models/operations/addwordlistwordsresponse.md: + last_write_checksum: sha1:e9a561bd954e8b7df0780ee3b9328aafb20929c3 + docs/models/operations/addwordlistwordsresponsebody.md: + last_write_checksum: sha1:6e30fb6fc16c5d036ca486057a904750cc985e3b + docs/models/operations/adult.md: + last_write_checksum: sha1:969a12c5fdfb0b1b78abe63361e1fa1628e4fc26 + docs/models/operations/alcohol.md: + last_write_checksum: sha1:2543c55aacd828f37e5d0696b7f8a7c76fe11ace + docs/models/operations/audiorequest.md: + last_write_checksum: sha1:a6eae479403113a3826b970f5623555a1e5ecbe7 + docs/models/operations/audioresponse.md: + last_write_checksum: sha1:9bcb66a88e7a0430f9b87e1539e497dc9b26ff0f + docs/models/operations/author.md: + last_write_checksum: sha1:34c8bc05eed5c8b718cf47fa77332c77532dab46 + docs/models/operations/authorstatus.md: + last_write_checksum: sha1:31fe1baf7eb645c33275dc87a88af5d735a47666 + docs/models/operations/behavior.md: + last_write_checksum: sha1:7d59dfb7d20044f836c22c10727f7766cf9e81b8 + docs/models/operations/block.md: + last_write_checksum: sha1:85e7f9959076166397c429e3ad1b86f11e5f84e0 + docs/models/operations/brandimpersonation.md: + last_write_checksum: sha1:d499d8bbab4a265e56c70f2029d7abb956f44246 + docs/models/operations/cannabis.md: + last_write_checksum: sha1:3869c8bf66fe39e251d985b85c17ec842177b358 + docs/models/operations/casebook.md: + last_write_checksum: sha1:f41b33e4274f6aad45c5213bb5694cf158b43faa + docs/models/operations/casebookagreement.md: + last_write_checksum: sha1:d5d446e1b2efad41991122d3fa7b5c90b7f55450 + docs/models/operations/casebookanswer.md: + last_write_checksum: sha1:0af1fef9b173d5fab843ec33e29c9d37e5b44b7f + docs/models/operations/channelcircumvention.md: + last_write_checksum: sha1:ed22af55ded3adf091f258aea8e682ff5fe849c9 + docs/models/operations/checkstatus.md: + last_write_checksum: sha1:ec088712c744159e362f4fe4470351867538238d + docs/models/operations/classifieroutput.md: + last_write_checksum: sha1:3b9861cf004b2f481ef19a480884ce63936d031e + docs/models/operations/clientaction.md: + last_write_checksum: sha1:e86547969120ea8bdf2046c9f50fee42cfc042b8 + docs/models/operations/codeabuse.md: + last_write_checksum: sha1:215187580fe9f89a3508c209d895eb5318f7fdcc + docs/models/operations/comparator.md: + last_write_checksum: sha1:eb6a81c3f0f792ccd239602a39a1ec41a79b44cf + docs/models/operations/compassioninsight.md: + last_write_checksum: sha1:3352fbb5f4b0a783f46a0b4e9ca7d37ac2256f09 + docs/models/operations/contentleafrequest.md: + last_write_checksum: sha1:635df8928df4e65ffc800a98cf72dbab1060c23a + docs/models/operations/contentleafresponse.md: + last_write_checksum: sha1:91327b159c5da2d7331e0c7fc43930a12a1ea6e2 + docs/models/operations/contentrequest.md: + last_write_checksum: sha1:b72716d23ef611d17db408f8625c434a94893726 + docs/models/operations/contentresponse.md: + last_write_checksum: sha1:3a0cccfdeac30f6350c17ba9996a0fb9543559a9 + docs/models/operations/createactionpositionrequest.md: + last_write_checksum: sha1:f7f8d49c1075adb5db4da3fad1558a07506e4897 + docs/models/operations/createactionpositionresponse.md: + last_write_checksum: sha1:d6f0fd7bc9be62e890761f4f8663b7922f260482 + docs/models/operations/createactionpossiblevaluerequest.md: + last_write_checksum: sha1:0ad551afcbf3fee8bf702876e695a31fd44f30f9 + docs/models/operations/createactionpossiblevalueresponse.md: + last_write_checksum: sha1:89fa1dce34b7a12211d1d95683e9efda90737427 + docs/models/operations/createactionqueuebehaviourrequest.md: + last_write_checksum: sha1:1f6058bde47993e977cce6af6fc2f8106974173d + docs/models/operations/createactionqueuebehaviourresponse.md: + last_write_checksum: sha1:a4655369b37d81aa27fa502f46bda8100fddf3f6 + docs/models/operations/createactionrequest.md: + last_write_checksum: sha1:f1053469a8756f45923044d1e053ad9bfbc4ca7a + docs/models/operations/createactionresponse.md: + last_write_checksum: sha1:513ccdfb7ccfb7b99470787bd487fc054ae53a67 + docs/models/operations/createactionresponsebody.md: + last_write_checksum: sha1:49fe043f91964df83edc3b2dbf51cf624da383c1 + docs/models/operations/createactiontyperequest.md: + last_write_checksum: sha1:3200a1893127355eb67e818993fd50180f1b526d + docs/models/operations/createactiontyperesponse.md: + last_write_checksum: sha1:cb96327e8fc19248431cb11c147a15f85e57109d + docs/models/operations/createauthormetadata.md: + last_write_checksum: sha1:cd50f9487a224d86aa8236fc9bf2bbe64b5dc3eb + docs/models/operations/createauthorrequest.md: + last_write_checksum: sha1:892a605d521468bfd4edbfdb3871a643096fdeea + docs/models/operations/createauthorresponse.md: + last_write_checksum: sha1:a0be0d1ee50fe47d5b58b6c0627d58b7324a8adc + docs/models/operations/createchannelcontenttype.md: + last_write_checksum: sha1:932bc9791f8f89cc186bb809dfd17375f7a26ef9 + docs/models/operations/createchannelrequest.md: + last_write_checksum: sha1:9f4e2230041e4f2f07c7182065d0d6a6ff1d6ea5 + docs/models/operations/createchannelrequestbody.md: + last_write_checksum: sha1:4f27fceca461554eb4429af95e5cb2af46ea418e + docs/models/operations/createchannelresponse.md: + last_write_checksum: sha1:62d430484b466ee342586cdb6a44824fbb9611aa + docs/models/operations/createprojectrequest.md: + last_write_checksum: sha1:4f6ebbef85afce45111483ac7257c3e60b6e421e + docs/models/operations/createprojectresponse.md: + last_write_checksum: sha1:d61ba4f55f9c5c52e2845ea4efa36225701af1e7 + docs/models/operations/createwebhookeventtyperequest.md: + last_write_checksum: sha1:ea3a7caa5e9610138767ecf90cc440403b3be658 + docs/models/operations/createwebhookeventtyperesponse.md: + last_write_checksum: sha1:cf1f757089382bdf87d90a21d43f96885b6b140c + docs/models/operations/createwebhookpayloadversion.md: + last_write_checksum: sha1:aae6bb9390f85bbafb6196605c4cf558923a59ac + docs/models/operations/createwebhookrequest.md: + last_write_checksum: sha1:19676f87b6ec4f6cb004b697d2112a541e5fa472 + docs/models/operations/createwebhookresponse.md: + last_write_checksum: sha1:a5b8d09529cf528175f605fe5040193a348db0ee + docs/models/operations/createwebhookresponsebody.md: + last_write_checksum: sha1:be6bbb84266477b45c41e203d652f611fb7aec8f + docs/models/operations/crypto.md: + last_write_checksum: sha1:2a8703d11bdf8c727645ba1b0e1c1b00f5a6ceb7 + docs/models/operations/curiosityinsight.md: + last_write_checksum: sha1:edb4775748bbcbbaf585bb09a5402a5064b0b525 + docs/models/operations/currentproject.md: + last_write_checksum: sha1:70bc5ec434483d935cddd88b235d79db280241b2 + docs/models/operations/dailyreviewcount.md: + last_write_checksum: sha1:ff25cc15027ff36a77dc8608856533e3674a5015 + docs/models/operations/dataaudio.md: + last_write_checksum: sha1:c98812853e479273cf292084c9bc6dbf124ecee7 + docs/models/operations/dataimage.md: + last_write_checksum: sha1:327719746ca9f8f4146df5cca4ba5070e132637b + docs/models/operations/datatext.md: + last_write_checksum: sha1:ae4ee70d3f2f4804170ce44c382d616cba1128bd + docs/models/operations/datavideo.md: + last_write_checksum: sha1:8ca3c16b6d36c67adda213bfe9fa68a0c05b027a + docs/models/operations/deleteactionrequest.md: + last_write_checksum: sha1:d07732b4a90377ccd7e25b2a1b4bc992b55f4cdc + docs/models/operations/deleteactionresponse.md: + last_write_checksum: sha1:c6e16fae8cc555eae48242534b93b7350c10c93e + docs/models/operations/deleteactionresponsebody.md: + last_write_checksum: sha1:51b002f6e472af8731cd199c5c8970625b3ba21c + docs/models/operations/deleteauthorrequest.md: + last_write_checksum: sha1:d2c270f0efbf5a484779268c34d4fd0919aee1e8 + docs/models/operations/deleteauthorresponse.md: + last_write_checksum: sha1:5d3c8e9f23ed73b9ee1ce64eaebca94bd9e8ef5e + docs/models/operations/deleteauthorresponsebody.md: + last_write_checksum: sha1:6bc9d00f81b40f8425a752bb9886e73db3b38593 + docs/models/operations/deletechannelrequest.md: + last_write_checksum: sha1:5081d9e4b84cb66f338265bf802be5334dbd8813 + docs/models/operations/deletechannelresponse.md: + last_write_checksum: sha1:e1237ac62620c6dc37113537c8e8395fd6bcb50b + docs/models/operations/deletechannelresponsebody.md: + last_write_checksum: sha1:275c79e2c6993b1a564865de75e8916e9e19b326 + docs/models/operations/deleteprojectrequest.md: + last_write_checksum: sha1:282f7d53457db080e9d65e5cfe36b7af25cb689a + docs/models/operations/deleteprojectresponse.md: + last_write_checksum: sha1:86be1b8b998dd2d07b20de704ed6d33372a81dbe + docs/models/operations/deleteprojectresponsebody.md: + last_write_checksum: sha1:277d4123ad842747896f48dbbc0dddad1faa5873 + docs/models/operations/deletewebhookrequest.md: + last_write_checksum: sha1:00afa991c420075e48600280257a7659e18b91b1 + docs/models/operations/deletewebhookresponse.md: + last_write_checksum: sha1:710b4cf0e9c349d8477ddc7e2e9816104dd8dccf + docs/models/operations/deletewebhookresponsebody.md: + last_write_checksum: sha1:e0adfa96b5e5d1bffd7e83c497dcd9507d1557c1 + docs/models/operations/drugs.md: + last_write_checksum: sha1:792c7ad94945aa8936f42b744846a2d6f86c0e81 + docs/models/operations/duplicatechannelrequest.md: + last_write_checksum: sha1:bc656e2a4e42cc259128fc072a3993e8a8420339 + docs/models/operations/duplicatechannelrequestbody.md: + last_write_checksum: sha1:c8513ed6743194a1fe2516383710d641fc8ef34e + docs/models/operations/duplicatechannelresponse.md: + last_write_checksum: sha1:e31eba64c68a3b0c23fef68f4c809a25a10ae26e + docs/models/operations/duplicateprojectrequest.md: + last_write_checksum: sha1:ed3ddb3f5d209d33804aa6e0e9f0272a0dadbb87 + docs/models/operations/duplicateprojectrequestbody.md: + last_write_checksum: sha1:fa94ec8eb91f2d2610fc038c6f27615eb1b74d7f + docs/models/operations/duplicateprojectresponse.md: + last_write_checksum: sha1:fbf810a559a2efef5105d8c3e4fe1bcbad461d86 + docs/models/operations/entities1.md: + last_write_checksum: sha1:7ebaf22001f8b7ec2bfe61265a95600575edcda8 + docs/models/operations/entities2.md: + last_write_checksum: sha1:fdf48f5c79e0c7719634083824f52864206921ad + docs/models/operations/entitymatcheroutput.md: + last_write_checksum: sha1:b57f6b58d47ad4cc0e135782ff0f52eebd56df34 + docs/models/operations/error.md: + last_write_checksum: sha1:ac1074b98389916e1a68364dcd4b20ad7de6199d + docs/models/operations/evaluation.md: + last_write_checksum: sha1:eb47f434922dfc46bb6e4fb408e67b2fb7a99ab2 + docs/models/operations/executeactionrequest.md: + last_write_checksum: sha1:c4b7db9057e0e0fef3dba99851b8ee37464b4b97 + docs/models/operations/executeactionresponse.md: + last_write_checksum: sha1:7f09f76bb4556f2710c60479a59f18b24c0c3671 + docs/models/operations/executeactionresponsebody.md: + last_write_checksum: sha1:7323feabab3ed5927e40553dd744bd7e824a91aa + docs/models/operations/extremism.md: + last_write_checksum: sha1:c8bbe7bd88b521e2a3a9a9e5f3bdf31eef267418 + docs/models/operations/facedetection.md: + last_write_checksum: sha1:7770141d57abe6bbeecc61fd769c16bb216769ee + docs/models/operations/filter.md: + last_write_checksum: sha1:5954a52cdd7d4533c1435b68b74a6a18aed09cda + docs/models/operations/filterlabel.md: + last_write_checksum: sha1:4b8eefda9b08a377dc50e97e02e80f42f345e166 + docs/models/operations/flaggedcontenttrend.md: + last_write_checksum: sha1:41f4eec3d41152cfa5927997f3d89ee5f925a80b + docs/models/operations/flaggingmode.md: + last_write_checksum: sha1:3733a02c68813acfa9c645a3675867473b079129 + docs/models/operations/gambling.md: + last_write_checksum: sha1:ebc6c39238132eae65e501f2cb48aa64c3e4c7b8 + docs/models/operations/getaccountresponse.md: + last_write_checksum: sha1:fd3ffbb9ee36b3dd4d0019db44b9eb9fc0c5cda0 + docs/models/operations/getaccountresponsebody.md: + last_write_checksum: sha1:8b40929286d8d88e7a28b0a9e15deae1b7d70994 + docs/models/operations/getactionposition.md: + last_write_checksum: sha1:8e9ff5d6060830ee58170a2b34afde4febec68a6 + docs/models/operations/getactionpossiblevalue.md: + last_write_checksum: sha1:6d536a6ce977b946dbd72d30f93667837b18039e + docs/models/operations/getactionqueuebehaviour.md: + last_write_checksum: sha1:932ba354f0755a846d65e07e92974bf2e9e2d81d + docs/models/operations/getactionrequest.md: + last_write_checksum: sha1:2fc0d4c8fc44b362e4622cf6fa9119b8bf280607 + docs/models/operations/getactionresponse.md: + last_write_checksum: sha1:42381e7a7d68b3ef8bdf0bb56f1d6a7e53664813 + docs/models/operations/getactionresponsebody.md: + last_write_checksum: sha1:52060b4554e895939f3614732b4294c3c81fb384 + docs/models/operations/getactiontype.md: + last_write_checksum: sha1:454036f9132b409bc60bba6041b195bbc36551ca + docs/models/operations/getauthorrequest.md: + last_write_checksum: sha1:6a3a7865aa8e06869264279d44cf966ed93ca764 + docs/models/operations/getauthorresponse.md: + last_write_checksum: sha1:15e8a7b14a3e9964cc48fd4a42982fef8d3dd4ec + docs/models/operations/getchannelrequest.md: + last_write_checksum: sha1:f84829532f666b3bfc8f3d2c89709ca6642cf49d + docs/models/operations/getchannelresponse.md: + last_write_checksum: sha1:1b180957e4ba591b5a5d5779d04971f105d8fa44 + docs/models/operations/getprojectrequest.md: + last_write_checksum: sha1:d59ca74a19e64b6662757f630c103db4c18b055d + docs/models/operations/getprojectresponse.md: + last_write_checksum: sha1:d46ea65f2c84f2ef8dbf315a1bfbac58004170b8 + docs/models/operations/getqueuecontenttype.md: + last_write_checksum: sha1:3338d4fc7876ad2958b60571b5a562e5481a7740 + docs/models/operations/getqueuerecommendationaction.md: + last_write_checksum: sha1:c548382ffde40a84cd230bfee0bedf80e04f9ab9 + docs/models/operations/getqueuerequest.md: + last_write_checksum: sha1:5515a9fc16f636d20448b1b1e88976b232c8b533 + docs/models/operations/getqueueresponse.md: + last_write_checksum: sha1:bc2deff964aaef49da56b6389b8e67b948381dd5 + docs/models/operations/getqueueresponsebody.md: + last_write_checksum: sha1:5e28b0f7a8b49b753ceca4b190c96e48aeecc619 + docs/models/operations/getqueuestatsrequest.md: + last_write_checksum: sha1:4ac2a6aedf4db492d97cfb606ba2ce236f9bab56 + docs/models/operations/getqueuestatsresponse.md: + last_write_checksum: sha1:8fe3a6b0cdfa15f8231d6c46adeac5a441648556 + docs/models/operations/getqueuestatsresponsebody.md: + last_write_checksum: sha1:94249f86dfc1ed08f1ca84dc09c28e511eb72b58 + docs/models/operations/getqueuetype.md: + last_write_checksum: sha1:9bc61edc987f54e9bf10b96694cd2ebf0666fe65 + docs/models/operations/getwebhookeventtype.md: + last_write_checksum: sha1:651bd2ffd7aba97f1053ec9f6acbd85897ae845f + docs/models/operations/getwebhookpayloadversion.md: + last_write_checksum: sha1:6c6876d8f42cc44b92f79164bbbcbbd26121669a + docs/models/operations/getwebhookrequest.md: + last_write_checksum: sha1:2eeaa09c66e9a20c0513f144fa19591ab41857fd + docs/models/operations/getwebhookresponse.md: + last_write_checksum: sha1:d88448911d8fe6345249520cc7dc0a719ff6ab1f + docs/models/operations/getwebhookresponsebody.md: + last_write_checksum: sha1:f36ce817e93a60189f120dd6f9e5b53ea075804c + docs/models/operations/getwebhooksecretresponse.md: + last_write_checksum: sha1:c05845a3d22d532a4caac45edd3a7eaa59218a78 + docs/models/operations/getwebhooksecretresponsebody.md: + last_write_checksum: sha1:df2febc57a34365bff65d3c9218d60957c95a0f9 + docs/models/operations/getwordlistembeddingstatusrequest.md: + last_write_checksum: sha1:8661ff0fe5c4270aff68a0912291a522c1b70611 + docs/models/operations/getwordlistembeddingstatusresponse.md: + last_write_checksum: sha1:76b4490efc7cc5afa40133555662ba674ebd854d + docs/models/operations/getwordlistembeddingstatusresponsebody.md: + last_write_checksum: sha1:a7e9788805217893b58f157d805c9218ff75d1c7 + docs/models/operations/getwordlistrequest.md: + last_write_checksum: sha1:16440859d5b3bb2c6dad23b75c6e16b16b3ad579 + docs/models/operations/getwordlistresponse.md: + last_write_checksum: sha1:340168e7438d7ba4b138ede2dcfda48c43af2875 + docs/models/operations/getwordlistresponsebody.md: + last_write_checksum: sha1:7607691208b4bbedb0a595155e168838cbb9db70 + docs/models/operations/globalflaggingmode.md: + last_write_checksum: sha1:2c59fdf030ebcaa08bed56621de0dab27b5c351f + docs/models/operations/guideline.md: + last_write_checksum: sha1:e4b3fce8129db36b635331f4e369bbdcd12f82f9 + docs/models/operations/hate.md: + last_write_checksum: sha1:ad3044381409c4ef34b663b785ba9ed84a960b13 + docs/models/operations/illegaltrade.md: + last_write_checksum: sha1:2845c5c95c19835f74021c153acbeea99b77d59d + docs/models/operations/illicit.md: + last_write_checksum: sha1:85d88391335c3fca525e7771f8fd480c06654c8f + docs/models/operations/illicitalcohol.md: + last_write_checksum: sha1:0c6aa413a94224d0ef7d18921620ac807af952c1 + docs/models/operations/illicitdrugs.md: + last_write_checksum: sha1:cdeeb7019bdaa9f9a16927fde0d97a2fc81ce1e7 + docs/models/operations/illicitfirearms.md: + last_write_checksum: sha1:2c08e7f2605707b5333cb63501cf359aedb2c8fe + docs/models/operations/illicitgambling.md: + last_write_checksum: sha1:1a2655cca9ef9e127834e7b6a9416cf076255c49 + docs/models/operations/illicittobacco.md: + last_write_checksum: sha1:226ca233916797b79cf0d6b8f27a635af5ec1029 + docs/models/operations/imagerequest.md: + last_write_checksum: sha1:c5c7af1b08fd86d0f867d61089b07eb0ba42f51d + docs/models/operations/imageresponse.md: + last_write_checksum: sha1:f288c3cc000408e4c0e9aa74513d2bb9de77c4cc + docs/models/operations/insight.md: + last_write_checksum: sha1:3c50a87c83b679f32361dbe798d6279c296fc751 + docs/models/operations/isflagged.md: + last_write_checksum: sha1:f2a517c1ebc1a56360feb147c0c62b76b7340422 + docs/models/operations/languageinsight.md: + last_write_checksum: sha1:c28d6b66bda6c44efcab43b6d935d8fee3e84ce0 + docs/models/operations/listactionsdata.md: + last_write_checksum: sha1:df7fc199c6efb94168f4b6b15f278dfe771e8771 + docs/models/operations/listactionsposition.md: + last_write_checksum: sha1:b5fd74c69be01bcbc250fce6a9aedc5210a354d4 + docs/models/operations/listactionspossiblevalue.md: + last_write_checksum: sha1:d886afacaf1a5d63b7c1eedde94719453157d5e0 + docs/models/operations/listactionsqueuebehaviour.md: + last_write_checksum: sha1:c45c55b748d0a1f643527f4d2212398024e84841 + docs/models/operations/listactionsrequest.md: + last_write_checksum: sha1:dc9df6a7cf5b7231794c2bdc4b48906d822979f1 + docs/models/operations/listactionsresponse.md: + last_write_checksum: sha1:f226965d72e0a1ccb696dc3299b28301a9744d85 + docs/models/operations/listactionsresponsebody.md: + last_write_checksum: sha1:2407a28ae844c29337bbac7d891a6ede61a5ea71 + docs/models/operations/listactionstype.md: + last_write_checksum: sha1:b0124bdff2185a8b2b098222116b506ebd6bbc5b + docs/models/operations/listauthorsrequest.md: + last_write_checksum: sha1:e5b67cf41d02ab25e4da777f08b56c4450199007 + docs/models/operations/listauthorsresponse.md: + last_write_checksum: sha1:f3fc55319ff6a6dfb11dd98b724aafbed49fed31 + docs/models/operations/listauthorsresponsebody.md: + last_write_checksum: sha1:e72198423ec4e35615572fce28d63b09bc9ce92f + docs/models/operations/listauthorssortdirection.md: + last_write_checksum: sha1:530f5ed9bcb8019232d25a538fcd061b6014280b + docs/models/operations/listchannelsrequest.md: + last_write_checksum: sha1:3b4acb2c5d962add99d23415bca1dc0a1ac42170 + docs/models/operations/listchannelsresponse.md: + last_write_checksum: sha1:14ef886b92fb0a93badf848eeba00f6f5655d305 + docs/models/operations/listchannelsresponsebody.md: + last_write_checksum: sha1:a7e05753bec6b8af9cb3eb7501d78f0fd14673ec + docs/models/operations/listprojectsrequest.md: + last_write_checksum: sha1:5fdd11704a0b91379ea212ac3d77d8cbff710eee + docs/models/operations/listprojectsresponse.md: + last_write_checksum: sha1:c637a4bf36e344833ff563bad19a8bd2b9c24b53 + docs/models/operations/listprojectsresponsebody.md: + last_write_checksum: sha1:fad417911f494d615fc0aade7a8a8586cc3f8471 + docs/models/operations/listqueueitemsaction.md: + last_write_checksum: sha1:45bbe44547b09b0550d352e4f357657af726fbf9 + docs/models/operations/listqueueitemsdata.md: + last_write_checksum: sha1:459ef4c5f8d78454589999825312371e0414d035 + docs/models/operations/listqueueitemslabel.md: + last_write_checksum: sha1:a003f86f14293731007260266918c992dc011fee + docs/models/operations/listqueueitemsrequest.md: + last_write_checksum: sha1:7cc1d957607de87b9b17ddf8eee73efc202c8486 + docs/models/operations/listqueueitemsresponse.md: + last_write_checksum: sha1:742d2e294f44d0f537cf4eaa8dc1b2252b5363f4 + docs/models/operations/listqueueitemsresponsebody.md: + last_write_checksum: sha1:1619b03b289990c64f265702fa30fd126aff2e1a + docs/models/operations/listqueueitemssortdirection.md: + last_write_checksum: sha1:189b90a97bf9b7048dd6f3af1561e163f5fd6e7c + docs/models/operations/listqueueitemsstatus.md: + last_write_checksum: sha1:db313459b27181518b1800969e6c7066069e6ab4 + docs/models/operations/listwebhooksdata.md: + last_write_checksum: sha1:302c2a7f955a8bb0ad5a7620c2908d5387d52c54 + docs/models/operations/listwebhookseventtype.md: + last_write_checksum: sha1:a56ff87bf9d70b298c6092adc60722f3614de667 + docs/models/operations/listwebhookspayloadversion.md: + last_write_checksum: sha1:7a0d6ff7cf56f1bffaf77661e74b5b7faa96773c + docs/models/operations/listwebhooksrequest.md: + last_write_checksum: sha1:551b5a78542f46b91ef8c7772ee1d3440f1a201e + docs/models/operations/listwebhooksresponse.md: + last_write_checksum: sha1:7f02894a48288acfa3c406ed08007258f391d7a3 + docs/models/operations/listwebhooksresponsebody.md: + last_write_checksum: sha1:5e6bba60f08f3e8f811e51ca3b6b542e0cb04200 + docs/models/operations/listwordlistsdata.md: + last_write_checksum: sha1:b367fd60cd4567cf0d6ac35f87118fa82cd682d4 + docs/models/operations/listwordlistsrequest.md: + last_write_checksum: sha1:8f1e064b6c3a08980f08bfa4823533b19e239df6 + docs/models/operations/listwordlistsresponse.md: + last_write_checksum: sha1:d33aad0d459ed94a16f2e99196cdfa08fc404039 + docs/models/operations/listwordlistsresponsebody.md: + last_write_checksum: sha1:b76c78f04c41a3ed88362413fc64648e3c8d08b9 + docs/models/operations/lowqualitycontent.md: + last_write_checksum: sha1:d27da132275af67d746eb9b8f932f6a3b0ba5cde + docs/models/operations/match.md: + last_write_checksum: sha1:0c95260fd590067ee9e2be732b7ffecfe1c84703 + docs/models/operations/matchedrule.md: + last_write_checksum: sha1:b9bc447ac612f3b21e2c5cd263493e0bafe3616a + docs/models/operations/mediatype.md: + last_write_checksum: sha1:c2c21148d29b5d0743f54d5a2b72cc55154af00c + docs/models/operations/meta.md: + last_write_checksum: sha1:06d4d930370fbbe0e0471b5367fee9ecd5057f98 + docs/models/operations/metadatafilter.md: + last_write_checksum: sha1:d89ab2c8615477fc1ffdbbcfbbe5b193798556d7 + docs/models/operations/metastatus.md: + last_write_checksum: sha1:2ea0245dd5e497f832ebbf246956f26df9910cf7 + docs/models/operations/metatype.md: + last_write_checksum: sha1:0c6c9505c377bf6650804ece18cfd60558dc7773 + docs/models/operations/method.md: + last_write_checksum: sha1:70e1f07a96dea6c810a6fd12e8bd6e5b138eab46 + docs/models/operations/modified.md: + last_write_checksum: sha1:c13f723146141839bec81a7b8280ba84841cd1be + docs/models/operations/object.md: + last_write_checksum: sha1:633cac83011833e0eae597bdd422b5f24d97280c + docs/models/operations/personalinformation.md: + last_write_checksum: sha1:3de1d5aae5678e336100b896d3261dc5f1e257fc + docs/models/operations/personalstoryinsight.md: + last_write_checksum: sha1:382d3ed7c484d5d43d2b7080953b5981a3643410 + docs/models/operations/piimasking.md: + last_write_checksum: sha1:a01bc15020346ced62c9c30b1536afce4bdd984f + docs/models/operations/policyrequest.md: + last_write_checksum: sha1:e46cc347c82e08240a589f866155752577110cff + docs/models/operations/policyresponse.md: + last_write_checksum: sha1:0d6c9ea73b10a578221db37cb594ecc86ade6ac2 + docs/models/operations/political.md: + last_write_checksum: sha1:2e9360bac5b226f5213e89e319a1a0efe702d2c2 + docs/models/operations/profanity.md: + last_write_checksum: sha1:96db22d6e0f87e1439e0988b5487673123195acb + docs/models/operations/promotion.md: + last_write_checksum: sha1:6d7348fa027a7ca998f58ee0b9daf700c4287b61 + docs/models/operations/queue.md: + last_write_checksum: sha1:0543bc886b79a12f00176c9c9376f16186da3b79 + docs/models/operations/reasoncode.md: + last_write_checksum: sha1:45782bac9cb0e92c833339788eab208fdc85ec5b + docs/models/operations/reasoncodeenum.md: + last_write_checksum: sha1:9b2f9fe2aafa6b75258e9ae6f3a474f0e32cd2f0 + docs/models/operations/recommendation.md: + last_write_checksum: sha1:3711e3a2f928491b32bc2c6ca59b1c71a54e6e42 + docs/models/operations/religion.md: + last_write_checksum: sha1:60a7524aee8d44058881d8a10476e8ba57c7d461 + docs/models/operations/removewordlistwordsrequest.md: + last_write_checksum: sha1:423ebbb91d546eb7e65ab8e0a354f44615a7ec11 + docs/models/operations/removewordlistwordsresponse.md: + last_write_checksum: sha1:37952680c9ae4ddd92d0f937e2461bb4b67b8023 + docs/models/operations/removewordlistwordsresponsebody.md: + last_write_checksum: sha1:def6fad308c85268f2497306789d01bbd6def4bf + docs/models/operations/resolvequeueitemrequest.md: + last_write_checksum: sha1:fcb6e6d8f107141525cc14f9ceec5e0290b9e66c + docs/models/operations/resolvequeueitemrequestbody.md: + last_write_checksum: sha1:5d9c9ecc2d27f1273a86d3d53339a33679ce4657 + docs/models/operations/resolvequeueitemresponse.md: + last_write_checksum: sha1:2b979b11815dd8da34ad0cda2e962f86f82ffe9d + docs/models/operations/resolvequeueitemresponsebody.md: + last_write_checksum: sha1:b9cf836bb5f6543401171c776aa9bca1563ccf19 + docs/models/operations/respectinsight.md: + last_write_checksum: sha1:2234db7794940b4f0f4c39e255a9b5e33114d335 + docs/models/operations/reviewstats.md: + last_write_checksum: sha1:8b7a0be8e30a14a0fc872297b49f91ff8417389c + docs/models/operations/scores.md: + last_write_checksum: sha1:008988e12b8b0d73c42789af9a36f61ca47bbd92 + docs/models/operations/selfharm.md: + last_write_checksum: sha1:56bc1be916c52555d06fffda5f2075c8349b4649 + docs/models/operations/selfpromotion.md: + last_write_checksum: sha1:8bf8af41628d09a219e2bbaf27f126d9a0e9e6fd + docs/models/operations/sentimentinsight.md: + last_write_checksum: sha1:0a47678c5dbf1e7accedbccdb5c5b7e30650e1ed + docs/models/operations/sexual.md: + last_write_checksum: sha1:dadb5d7012315b70ebd3598ae1bfa7978c93a06d + docs/models/operations/sexualminors.md: + last_write_checksum: sha1:fef80140c5b66e4d8713e1348633086c88b56ecf + docs/models/operations/sexualsolicitation.md: + last_write_checksum: sha1:24d37adede05398ce01cddcd5ab997926b1a02c8 + docs/models/operations/signalsrequest.md: + last_write_checksum: sha1:8f43e6165bdfa6ef83c3db7c22238358a9f23263 + docs/models/operations/signalsresponse.md: + last_write_checksum: sha1:5b353278302ad0b1cbdd679f0bcba3d3f7daa12a + docs/models/operations/sortby.md: + last_write_checksum: sha1:caa2f37d963e5a7897ef0e4c7e834ef2112ea1b9 + docs/models/operations/sortfield.md: + last_write_checksum: sha1:9995e8f3c61c255061d4313dddbde9015f9faead + docs/models/operations/spam.md: + last_write_checksum: sha1:116eddb4243c96f3edcdbf1f54f247d27cc9e1f5 + docs/models/operations/submitcontentlabel.md: + last_write_checksum: sha1:3a0ae77b3a47a2b76c6dc64214a54c1052a9912c + docs/models/operations/submitcontentrecommendationaction.md: + last_write_checksum: sha1:6bfd5d79248f31aabbc398a94fc7f86212e914dc + docs/models/operations/submitcontentrequest.md: + last_write_checksum: sha1:4a74b63a60c76cded86d070e9cd4c661c7b2cf1a + docs/models/operations/submitcontentresponse.md: + last_write_checksum: sha1:c7f8c3160bb9f0334022cd29f35780cada7e2a22 + docs/models/operations/submitcontentresponsebody.md: + last_write_checksum: sha1:e3c1813a1eb958d8c67283f7ab0b179e0bc21329 + docs/models/operations/textrequest.md: + last_write_checksum: sha1:5504d33c603553cf5434bcc71ea51e6ffa339493 + docs/models/operations/textresponse.md: + last_write_checksum: sha1:91d3e3ee4bd9643aa7a6f71edcf13ebd730f6831 + docs/models/operations/threat.md: + last_write_checksum: sha1:1774765bb79ede6c95f1dc78b423b8ddd4039119 + docs/models/operations/tobacco.md: + last_write_checksum: sha1:61e28f869e7520be39d7acd75a6ab347329200f1 + docs/models/operations/topaction.md: + last_write_checksum: sha1:cb6d3f756ccfe4d1a7e40c134c2949478a5d6acf + docs/models/operations/topic.md: + last_write_checksum: sha1:44f7f7f6b3658bb1c3c82e1c2eb6ba488eefc173 + docs/models/operations/topreviewer.md: + last_write_checksum: sha1:6e523866fcd571ae5b482b456d2201e03632051d + docs/models/operations/toxicity.md: + last_write_checksum: sha1:ea0d03623c248213108d8c94ffc773b492fae9b9 + docs/models/operations/transcriptionquality.md: + last_write_checksum: sha1:e726da3903b3351d3d54222ac23926721482a134 + docs/models/operations/trends.md: + last_write_checksum: sha1:b94d60c5c8769b7f02f8f7949533917c4ea2f993 + docs/models/operations/trustlevel.md: + last_write_checksum: sha1:2c6430450c436021710ec3ceb5a9daac5add8230 + docs/models/operations/unicodespoofing.md: + last_write_checksum: sha1:79534af1086c3960979eeadb5a132cbba08a993a + docs/models/operations/unresolvequeueitemrequest.md: + last_write_checksum: sha1:d0eb50151cb16164746267ecbd4d52a319981057 + docs/models/operations/unresolvequeueitemrequestbody.md: + last_write_checksum: sha1:e3bc1ac8ae2c278f883964a8a04beb4af0ccd7d3 + docs/models/operations/unresolvequeueitemresponse.md: + last_write_checksum: sha1:b83c7f0e09b623e5a18cb3f1cfc976d21f6c6cb9 + docs/models/operations/unresolvequeueitemresponsebody.md: + last_write_checksum: sha1:e187a2c89ef31c0200698fcd2b8cf92593393980 + docs/models/operations/updateactionpositionrequest.md: + last_write_checksum: sha1:c25a31224f616bb58276096e828d021e5856d405 + docs/models/operations/updateactionpositionresponse.md: + last_write_checksum: sha1:e31d06c029fd3370ca5fcef8c33bbf88644df852 + docs/models/operations/updateactionpossiblevaluerequest.md: + last_write_checksum: sha1:eb7a2101b87ccab6409a4e14628fb399d7f052b2 + docs/models/operations/updateactionpossiblevalueresponse.md: + last_write_checksum: sha1:ea05656e3bf49d938476126b06df0002c24886a9 + docs/models/operations/updateactionqueuebehaviourrequest.md: + last_write_checksum: sha1:d039bc219ab26dd20d96a5db3a4d29a67454f750 + docs/models/operations/updateactionqueuebehaviourresponse.md: + last_write_checksum: sha1:59ae0036f1021859681cd67d605936219ec9ff2e + docs/models/operations/updateactionrequest.md: + last_write_checksum: sha1:377658dddae1306fd12974358879cd2298207b51 + docs/models/operations/updateactionrequestbody.md: + last_write_checksum: sha1:bf288fb88758ed516fc055ae541ae171a3db848c + docs/models/operations/updateactionresponse.md: + last_write_checksum: sha1:1c9710f871dea1648236516836c627e132b70352 + docs/models/operations/updateactionresponsebody.md: + last_write_checksum: sha1:4925709b5ea80af3cabcee6929cfd46ba43682be + docs/models/operations/updateactiontyperequest.md: + last_write_checksum: sha1:2beb67f3fc9a72488b5b4acc8c34196ba2ac5132 + docs/models/operations/updateactiontyperesponse.md: + last_write_checksum: sha1:4277afd0fda3969ed432071a08862362fcf0e88b + docs/models/operations/updateauthormetadata.md: + last_write_checksum: sha1:19f1c36225459beae124087d1919a5f20373db33 + docs/models/operations/updateauthorrequest.md: + last_write_checksum: sha1:d6b7212630faac1e1bc8a305131269b4bd464c72 + docs/models/operations/updateauthorrequestbody.md: + last_write_checksum: sha1:6ac6aed5642dd8b5ad732df5ebdcd90c3b318c8e + docs/models/operations/updateauthorresponse.md: + last_write_checksum: sha1:dc18e5fe403a76c8172025a4a40e9eb5b18b989d + docs/models/operations/updatechannelcontenttype.md: + last_write_checksum: sha1:e394b81438e4a469bd4120048260ac3b4b2a3585 + docs/models/operations/updatechannelrequest.md: + last_write_checksum: sha1:8d61b7d6bcc1ba99af6268bad78aa61168f60a1e + docs/models/operations/updatechannelrequestbody.md: + last_write_checksum: sha1:57684af1b5402d6e3bdb6462b49de06730c1f1fe + docs/models/operations/updatechannelresponse.md: + last_write_checksum: sha1:2c0dcdb3cd94279c79dd35e5e3ce9ab16b538d1e + docs/models/operations/updateprojectrequest.md: + last_write_checksum: sha1:52c355d137d9c723b357a0220ca5ae0ceb0f2ca1 + docs/models/operations/updateprojectrequestbody.md: + last_write_checksum: sha1:68f1c44c052dbbe87addbf0f92b78ee75abf5d34 + docs/models/operations/updateprojectresponse.md: + last_write_checksum: sha1:dc70853b3ee225ed7967dab13cac3b1ebba126f1 + docs/models/operations/updatewebhookeventtyperequest.md: + last_write_checksum: sha1:2a5eb0755f714a4dbe33d9b8ac74a486e86545ab + docs/models/operations/updatewebhookeventtyperesponse.md: + last_write_checksum: sha1:61ba1eb92292b7de20d960bf3640114420deaa77 + docs/models/operations/updatewebhookpayloadversion.md: + last_write_checksum: sha1:0e7216f64eb36beaf459a533edc2f454cb55c910 + docs/models/operations/updatewebhookrequest.md: + last_write_checksum: sha1:6ee2e26b8ea7c1302507909f1fe4481541445cc3 + docs/models/operations/updatewebhookrequestbody.md: + last_write_checksum: sha1:2227e58ef090e34aa938a855fd852af5fc854d3a + docs/models/operations/updatewebhookresponse.md: + last_write_checksum: sha1:897d7b896364d2433ad3c1b4fe52ca5e8b4675e6 + docs/models/operations/updatewebhookresponsebody.md: + last_write_checksum: sha1:c9ae9ad53cf50e0505407e7148372645b332ebd9 + docs/models/operations/updatewordlistrequest.md: + last_write_checksum: sha1:eea5ac6f2ec61d093168b1860105e8781fc4569d + docs/models/operations/updatewordlistrequestbody.md: + last_write_checksum: sha1:3087cb17ef97b5adc13488d30fc6a80ad59030f6 + docs/models/operations/updatewordlistresponse.md: + last_write_checksum: sha1:be2498787f1a4d91d09d34ea85c4be1013ed5228 + docs/models/operations/updatewordlistresponsebody.md: + last_write_checksum: sha1:0ac2bc16b2df0c4bb30cda956cd40a883cc06503 + docs/models/operations/urlmasking.md: + last_write_checksum: sha1:2e64164c7a308d9a9552a8e460aef96b2ee97a86 + docs/models/operations/urlrisk.md: + last_write_checksum: sha1:946fdfc1e08f857e019ad435ac912d179d071e3b + docs/models/operations/value.md: + last_write_checksum: sha1:ceb746fe365b1ee8efdd2a897483aa5f90c8fa93 + docs/models/operations/verdict.md: + last_write_checksum: sha1:aa543f9599b9bd5171d9d5bcbfd7a76b0780fd7e + docs/models/operations/videorequest.md: + last_write_checksum: sha1:364bff078655a2803240ce8a90bfda234dd06247 + docs/models/operations/videoresponse.md: + last_write_checksum: sha1:b89d6ace94664bc13b917b6cfacab1503931233a + docs/models/operations/violence.md: + last_write_checksum: sha1:89749fd561e43b1e43d6a8a5b384f13d95739e46 + docs/models/operations/weapons.md: + last_write_checksum: sha1:ca042d36ecc6db37ed645eb2e54358a59baf02ed + docs/models/operations/withinunit.md: + last_write_checksum: sha1:466d94909b10b82969067ddba11085bb507fb3d4 + docs/sdks/account/README.md: + last_write_checksum: sha1:c827ed210a5b14e78ad8ac5fe7bff8c7b81f2fd0 + docs/sdks/actions/README.md: + last_write_checksum: sha1:0204521d0498074ed7c0b838bb138f00a52e0665 + docs/sdks/authors/README.md: + last_write_checksum: sha1:2655cdf6a6a03a4baaa4c4ddec2cd4909ea5d572 + docs/sdks/channels/README.md: + last_write_checksum: sha1:ed1f37cd92ff8ef60df01de8567e533f4c2adf26 + docs/sdks/content/README.md: + last_write_checksum: sha1:9b4d93c86c13742aea2429ebbb3fb7fc9f5f503f + docs/sdks/items/README.md: + last_write_checksum: sha1:6a69a96684b38faf9d6d73ab93b990f04b04a45b + docs/sdks/projects/README.md: + last_write_checksum: sha1:623605cf28283e448ae1c5a1137bb3005725b6cf + docs/sdks/queue/README.md: + last_write_checksum: sha1:59a4690991d711f19e32b055c1ee8d5906150476 + docs/sdks/webhooks/README.md: + last_write_checksum: sha1:ee6d998dc6f14d48ca64a0a03188f08bb0d75e85 + docs/sdks/webhooksecret/README.md: + last_write_checksum: sha1:ecd7113636171d245200cf13b734155cfac6ae4b + docs/sdks/wordlist/README.md: + last_write_checksum: sha1:1075eaac7fd574ab14f39ea7703c4a7cc93b8622 + docs/sdks/words/README.md: + last_write_checksum: sha1:1db444ac51e24a35f57b2bf702c2c8f2f5c5c6d9 + lib/crystalline.rb: + last_write_checksum: sha1:b6ec0a2833f58ba9a6f07c9637fdca05e59006d3 + lib/crystalline/enum.rbi: + last_write_checksum: sha1:548b19d96bcf832792c1e54f0065c293934a9ce5 + lib/crystalline/metadata_fields.rb: + last_write_checksum: sha1:fd3fb667a441554f212e7eff01bcdb608bdd3f44 + lib/crystalline/module.rb: + last_write_checksum: sha1:982a74d52424b54de1760728a85e4c3be15cd875 + lib/crystalline/types.rb: + last_write_checksum: sha1:d7a70117f4c6504cc9c602bbd13f46df31d15119 + lib/crystalline/utils.rb: + last_write_checksum: sha1:b32469851da6f9f729e484ade6a23b38639a652a + lib/moderation_api.rb: + last_write_checksum: sha1:763da34902f08acf7a9d8e7924a5b6c5393bfffa + lib/moderation_api/account.rb: + last_write_checksum: sha1:2c4e3b0d811e0ad99e425a0342a6256c8a1eb604 + lib/moderation_api/actions.rb: + last_write_checksum: sha1:4c1f9a74fd6ee6462e1fbac9dc73ba5047b69949 + lib/moderation_api/authors.rb: + last_write_checksum: sha1:633509139be7aa4b6e2ead60ecc79728fb8e8988 + lib/moderation_api/channels.rb: + last_write_checksum: sha1:8d995eac91d890d34e95f9c6120c503337bda145 + lib/moderation_api/content.rb: + last_write_checksum: sha1:a8546b5b5701ec4cbdd6bc5c877d6237b02e2e6b + lib/moderation_api/items.rb: + last_write_checksum: sha1:8de45ed736912a96b5cb88f919237e4ae4694ba4 + lib/moderation_api/models/callbacks.rb: + last_write_checksum: sha1:00479d36cc70b26d311a89c2162e1eecd7986e77 + lib/moderation_api/models/components.rb: + last_write_checksum: sha1:41136496ef989b93db5c1803bcc62f11c01cd389 + lib/moderation_api/models/components/authenticationerror_code.rb: + last_write_checksum: sha1:474270271c2fe89211e7f982de9c2ac9e6e86515 + lib/moderation_api/models/components/authenticationerror_code.rbi: + last_write_checksum: sha1:a1a0028346f661780407ec3c9c34637d1c0ec430 + lib/moderation_api/models/components/badrequesterror_code.rb: + last_write_checksum: sha1:639da08d2fc2194c7a6ce76cb78423828faf409d + lib/moderation_api/models/components/badrequesterror_code.rbi: + last_write_checksum: sha1:b8873c1661cf42e27ff7442421c0767fe3f59634 + lib/moderation_api/models/components/block.rb: + last_write_checksum: sha1:b3427a04f7c6489ec6955218eda769d88860840a + lib/moderation_api/models/components/block.rbi: + last_write_checksum: sha1:00b25db66e907f497a0f22d11388616ce25e7e76 + lib/moderation_api/models/components/channel.rb: + last_write_checksum: sha1:1eb0454dc22b2912db8aa45b9cbb298848f57040 + lib/moderation_api/models/components/channel.rbi: + last_write_checksum: sha1:b8bf47383bb090f11dc92b53febff6759942efb6 + lib/moderation_api/models/components/conflicterror_code.rb: + last_write_checksum: sha1:6742ed313ef546357c6effa4c6b218830c4e30ee + lib/moderation_api/models/components/conflicterror_code.rbi: + last_write_checksum: sha1:052832b83d8d5fde070ddcfed5d65e966eae56c2 + lib/moderation_api/models/components/contenttype.rb: + last_write_checksum: sha1:351f4b2719e19df7dbf705679740699c2577df6a + lib/moderation_api/models/components/contenttype.rbi: + last_write_checksum: sha1:54ac22b59efda8c200d466d2d033c710d3e67891 + lib/moderation_api/models/components/errorissue.rb: + last_write_checksum: sha1:afba8d77e51a901f3234a91ca28d57f135f3347b + lib/moderation_api/models/components/errorissue.rbi: + last_write_checksum: sha1:213a6c93d0d87f7577ed90f42d397e11ca4a3f43 + lib/moderation_api/models/components/flaggingmode.rb: + last_write_checksum: sha1:545fd936288d4d9eeed6efbac34e903585a50438 + lib/moderation_api/models/components/flaggingmode.rbi: + last_write_checksum: sha1:68ebada633295e2a4996934df476801cf9d8ba1e + lib/moderation_api/models/components/internalservererror_code.rb: + last_write_checksum: sha1:db61f2867e6c8680e68a049f092aca106ac43c06 + lib/moderation_api/models/components/internalservererror_code.rbi: + last_write_checksum: sha1:cebc65ed8fef50bf0bd22361938f89f87221667d + lib/moderation_api/models/components/metadata.rb: + last_write_checksum: sha1:7589c546c3b1b2bd1d4fa2996cda559d914cfa34 + lib/moderation_api/models/components/metadata.rbi: + last_write_checksum: sha1:c4dde3ca7ab910ae2b621ccb85ab5fe4030e99bf + lib/moderation_api/models/components/metrics.rb: + last_write_checksum: sha1:ec01315b8f412dc7c8243180e5e7e60a528ad4fd + lib/moderation_api/models/components/metrics.rbi: + last_write_checksum: sha1:95c03d4a4bd7d62c1ade2d222c880a0bf13fa734 + lib/moderation_api/models/components/notfounderror_code.rb: + last_write_checksum: sha1:494c688e2d10322d898b37b8fdefec4f92e47151 + lib/moderation_api/models/components/notfounderror_code.rbi: + last_write_checksum: sha1:06e1179caa437bd9cff61b84e19a423c6a59bab7 + lib/moderation_api/models/components/pagination.rb: + last_write_checksum: sha1:59ededd73d445e61bcb033bb701b67dff14e2330 + lib/moderation_api/models/components/pagination.rbi: + last_write_checksum: sha1:f85b1b28e9a5e55011df75f75d7e5316e58e6208 + lib/moderation_api/models/components/path.rb: + last_write_checksum: sha1:4e6988cd19f9a104149384d0a7127c2b69649bc3 + lib/moderation_api/models/components/path.rbi: + last_write_checksum: sha1:4be829f458e8e386941b7a16126e5e24b4db2c84 + lib/moderation_api/models/components/permissiondeniederror_code.rb: + last_write_checksum: sha1:f3d3075c46dd693731463cb2bad865b7822f0da8 + lib/moderation_api/models/components/permissiondeniederror_code.rbi: + last_write_checksum: sha1:68fdd8eca128e2541d41f34ee535f787be26a471 + lib/moderation_api/models/components/project.rb: + last_write_checksum: sha1:7220f1a8b8b9b9df4bfbcf67c37360e691468360 + lib/moderation_api/models/components/project.rbi: + last_write_checksum: sha1:4f2ad2a34b31f123227e3e3a7d4e38d78eca804b + lib/moderation_api/models/components/project_globalflaggingmode.rb: + last_write_checksum: sha1:514e5e9787e2d1e62aba24122df521db11fb2b53 + lib/moderation_api/models/components/project_globalflaggingmode.rbi: + last_write_checksum: sha1:68d569f50527cf888bdab1b61a7f7b35dc313fd1 + lib/moderation_api/models/components/projectwithkey.rb: + last_write_checksum: sha1:465f81b2880e77c70a4edac8523043e6cc7571ea + lib/moderation_api/models/components/projectwithkey.rbi: + last_write_checksum: sha1:6a4a6fbe80ab89c78b19a86600a5be12e32c3f6d + lib/moderation_api/models/components/projectwithkey_globalflaggingmode.rb: + last_write_checksum: sha1:3398563f248c28da117eaa5078360727f783790e + lib/moderation_api/models/components/projectwithkey_globalflaggingmode.rbi: + last_write_checksum: sha1:0c00dc18e9aab8ffce7e6d094c34d28d1e5a0393 + lib/moderation_api/models/components/publicauthor.rb: + last_write_checksum: sha1:ba51f8f9b4a6590ea847106151c658d816d8cd94 + lib/moderation_api/models/components/publicauthor.rbi: + last_write_checksum: sha1:05281e976183d5b33938ce072b6e6a12b33b97b8 + lib/moderation_api/models/components/ratelimiterror_code.rb: + last_write_checksum: sha1:5d63967fc31ff7c8541ed743d8d38fa1658582f0 + lib/moderation_api/models/components/ratelimiterror_code.rbi: + last_write_checksum: sha1:1e1525b72a2ed069463fa17b6d57897206dc1204 + lib/moderation_api/models/components/risk_evaluation.rb: + last_write_checksum: sha1:245d24bbf13f0550d217f8543f513744758b8a81 + lib/moderation_api/models/components/risk_evaluation.rbi: + last_write_checksum: sha1:cdf2b238d3cd12ba2a6c33269a170f9c2f4eb9be + lib/moderation_api/models/components/security.rb: + last_write_checksum: sha1:3b3cfd771a9725dae7df228092a8fcc2e2d8503b + lib/moderation_api/models/components/security.rbi: + last_write_checksum: sha1:65509ac3a5faacfbc7a050f889e3dd412dc4b68f + lib/moderation_api/models/components/status.rb: + last_write_checksum: sha1:fdb496b020ef5ede196059319713408f3f7dee29 + lib/moderation_api/models/components/status.rbi: + last_write_checksum: sha1:0d5f3c64c85a917d9e2d8efbc992ce5de852e207 + lib/moderation_api/models/components/transcriptionquality.rb: + last_write_checksum: sha1:0d0484fa9a41ca3f9625a96f0b81b03eb672b77e + lib/moderation_api/models/components/transcriptionquality.rbi: + last_write_checksum: sha1:9eb77d1a9db6ed81a5478cacf358dfb2d53f38d8 + lib/moderation_api/models/components/trust_level.rb: + last_write_checksum: sha1:d3c1ac2c2a063f1ff62f1afee61e71fc2884503f + lib/moderation_api/models/components/trust_level.rbi: + last_write_checksum: sha1:28595bd1fca0f3cc042c5585ab2101da30443dcf + lib/moderation_api/models/errors.rb: + last_write_checksum: sha1:e6e5c18a0692e2d4ee4eac057f96a605c5c0605c + lib/moderation_api/models/errors/apierror.rb: + last_write_checksum: sha1:b74c2934c8e5bf170963c190eb48c2f4fc7afc82 + lib/moderation_api/models/errors/apierror.rbi: + last_write_checksum: sha1:c53cccc1650dbdb77a668055e54c047eb85dd29a + lib/moderation_api/models/errors/authenticationerror.rb: + last_write_checksum: sha1:f5445334be249348028ff0866ea1da7cb6705d9b + lib/moderation_api/models/errors/authenticationerror.rbi: + last_write_checksum: sha1:ae0e6dd56230d6baf55a5296d2919658868019e6 + lib/moderation_api/models/errors/badrequesterror.rb: + last_write_checksum: sha1:82b4f5236b893a06666a1bc42b31ce4a338429af + lib/moderation_api/models/errors/badrequesterror.rbi: + last_write_checksum: sha1:02ffdc87b1bd37f7308a67f19be1d108c8998ef2 + lib/moderation_api/models/errors/conflicterror.rb: + last_write_checksum: sha1:5eb9a5fc04dfb0862601aca50b63aeb75e8634da + lib/moderation_api/models/errors/conflicterror.rbi: + last_write_checksum: sha1:57c03f8c300a7011f92330ba09e565797af16d0d + lib/moderation_api/models/errors/internalservererror.rb: + last_write_checksum: sha1:1058cb6a1fac14d5c9c853e8d3c27db89cb3ee85 + lib/moderation_api/models/errors/internalservererror.rbi: + last_write_checksum: sha1:af6e1e572554b55fafdff411f7da2e12d9fe62e3 + lib/moderation_api/models/errors/notfounderror.rb: + last_write_checksum: sha1:635ddfbbc097626cb9458f97faf1b42e30ccd1f2 + lib/moderation_api/models/errors/notfounderror.rbi: + last_write_checksum: sha1:a79456942da7d91ab6a36ac8477d6b165c776e61 + lib/moderation_api/models/errors/permissiondeniederror.rb: + last_write_checksum: sha1:f65d1f2f59ad91c5f0f50f8f4de2b3d7160721a7 + lib/moderation_api/models/errors/permissiondeniederror.rbi: + last_write_checksum: sha1:40154e330952ff9ce2e8f849ef8b9ece27e9b911 + lib/moderation_api/models/errors/ratelimiterror.rb: + last_write_checksum: sha1:d25aedc57e43e7afcbc60f4a107aea698e364ece + lib/moderation_api/models/errors/ratelimiterror.rbi: + last_write_checksum: sha1:87922693e4ec7f67110e261b50d041d6591d3a6b + lib/moderation_api/models/operations.rb: + last_write_checksum: sha1:2e8b032e1e39008d36eaf415bee0ddd0a142c74a + lib/moderation_api/models/operations/action_request.rb: + last_write_checksum: sha1:dfab71edc86fbc3977a4b8a8a5b781c24536b087 + lib/moderation_api/models/operations/action_request.rbi: + last_write_checksum: sha1:9b55f6ab3d2ce69f75863a53e4d66f30c04b203b + lib/moderation_api/models/operations/actionstat.rb: + last_write_checksum: sha1:a28c65e13c2d3886c45c5b6dd8d76626d9d1c712 + lib/moderation_api/models/operations/actionstat.rbi: + last_write_checksum: sha1:635fbf99142aa22e216389ef0ff639f4f1411986 + lib/moderation_api/models/operations/addwordlistwords_request.rb: + last_write_checksum: sha1:c1edcae4172e7346250d86883331bbe2d0ac2adb + lib/moderation_api/models/operations/addwordlistwords_request.rbi: + last_write_checksum: sha1:1ed57e299dedb792ed8f32420cade61aadd18523 + lib/moderation_api/models/operations/addwordlistwords_requestbody.rb: + last_write_checksum: sha1:5dc513bcfba2f83e79291121945356d0f9f8f616 + lib/moderation_api/models/operations/addwordlistwords_requestbody.rbi: + last_write_checksum: sha1:c507c8a51ef2839fcf6a4fc3ad5130c00935023f + lib/moderation_api/models/operations/addwordlistwords_response.rb: + last_write_checksum: sha1:0d73a8732fbe46ad1e4a72f6b7650ee2d66c2e53 + lib/moderation_api/models/operations/addwordlistwords_response.rbi: + last_write_checksum: sha1:90aec397eddd9c73e7681ef8b62cee41f4e312a3 + lib/moderation_api/models/operations/addwordlistwords_responsebody.rb: + last_write_checksum: sha1:24d2fdd76f6a6edb979454d5584b8ab53db8392a + lib/moderation_api/models/operations/addwordlistwords_responsebody.rbi: + last_write_checksum: sha1:77b1a76d83d85d735da4b91d67816f39af06d691 + lib/moderation_api/models/operations/adult.rb: + last_write_checksum: sha1:507fe860159659366f7750c0dec838d9698388c7 + lib/moderation_api/models/operations/adult.rbi: + last_write_checksum: sha1:d71939092955c7f850b07534efd635c05e9d80f5 + lib/moderation_api/models/operations/alcohol.rb: + last_write_checksum: sha1:f7c82df8e8e3c6b6133dd498f154b8ed1eb017d8 + lib/moderation_api/models/operations/alcohol.rbi: + last_write_checksum: sha1:a18912c78aa45cd1816f1f671a613a36ccc28ede + lib/moderation_api/models/operations/audio_request.rb: + last_write_checksum: sha1:8b07425430cd7bd96317e68130d28b8e8b07d422 + lib/moderation_api/models/operations/audio_request.rbi: + last_write_checksum: sha1:ea57a798bfd7512e062554f8d8d3c21d25a456ee + lib/moderation_api/models/operations/audio_response.rb: + last_write_checksum: sha1:8afe62f525dc92cc2166c40b803812765c876af2 + lib/moderation_api/models/operations/audio_response.rbi: + last_write_checksum: sha1:d4fbd725ba9b7110dd1767eb90f24ff297f7df1f + lib/moderation_api/models/operations/author.rb: + last_write_checksum: sha1:c60eedad30bbb4b16f349753596db457274eb68c + lib/moderation_api/models/operations/author.rbi: + last_write_checksum: sha1:f10a84a06fe01b81472633a5fddddb3dc31ae639 + lib/moderation_api/models/operations/author_status.rb: + last_write_checksum: sha1:a05cac37ff9da2bb9d39158e7ba82efc2498b573 + lib/moderation_api/models/operations/author_status.rbi: + last_write_checksum: sha1:5e76d928684dc3846dedde2ffb5263e8f7fed7e2 + lib/moderation_api/models/operations/behavior.rb: + last_write_checksum: sha1:7cd32ed4e3941845ea567249164dfa2981d0206e + lib/moderation_api/models/operations/behavior.rbi: + last_write_checksum: sha1:f1808017ac4351dbf82c3857436c29a841a4d443 + lib/moderation_api/models/operations/block.rb: + last_write_checksum: sha1:0db271858041f1d44b1ec1b86ad160ebe9492141 + lib/moderation_api/models/operations/block.rbi: + last_write_checksum: sha1:20f7fb992b0329290177fe82792568f5642b4614 + lib/moderation_api/models/operations/brand_impersonation.rb: + last_write_checksum: sha1:987e096717f8ea05b9f81c72cb98106c88d5580d + lib/moderation_api/models/operations/brand_impersonation.rbi: + last_write_checksum: sha1:5798503e2d8d52cf90320c3ab0d369a02e0a15ef + lib/moderation_api/models/operations/cannabis.rb: + last_write_checksum: sha1:16988f88755ac344b67e388fc940931009231322 + lib/moderation_api/models/operations/cannabis.rbi: + last_write_checksum: sha1:13374c446e8893058628f17320bd50e39f881520 + lib/moderation_api/models/operations/casebook.rb: + last_write_checksum: sha1:40f5fa6b984a0faa4717cb5aedd9558153e399d4 + lib/moderation_api/models/operations/casebook.rbi: + last_write_checksum: sha1:3cc450913e722b0b9a1b42d0303269dfcebee810 + lib/moderation_api/models/operations/casebookagreement.rb: + last_write_checksum: sha1:eeabf36f3af449adbb1da67f0faf093ca43a360c + lib/moderation_api/models/operations/casebookagreement.rbi: + last_write_checksum: sha1:db7de07fdd72f282c32b9effa7f05f974fb494ef + lib/moderation_api/models/operations/casebookanswer.rb: + last_write_checksum: sha1:76975a988b65e7d212ec466880953f6ba937759e + lib/moderation_api/models/operations/casebookanswer.rbi: + last_write_checksum: sha1:c7725e7b039c6363f093c368779ffd90160126eb + lib/moderation_api/models/operations/channel_circumvention.rb: + last_write_checksum: sha1:13111c0afef8a66e38cb83b451f549c3c9a1b2d3 + lib/moderation_api/models/operations/channel_circumvention.rbi: + last_write_checksum: sha1:3285883d27d5f5b7538e79ca1baec97b98b54d48 + lib/moderation_api/models/operations/checkstatus.rb: + last_write_checksum: sha1:1c2d218ae61eaa5cd870c9957ac7eee11801a383 + lib/moderation_api/models/operations/checkstatus.rbi: + last_write_checksum: sha1:1d4c6c13ca76f1857258f394cfc0683b0ea6e4c7 + lib/moderation_api/models/operations/classifier_output.rb: + last_write_checksum: sha1:4da59fecf40b0198ff748d1b1b244b55e67e38e5 + lib/moderation_api/models/operations/classifier_output.rbi: + last_write_checksum: sha1:df0b635d8d1fbdf710f4dcf91859166595c079f7 + lib/moderation_api/models/operations/clientaction.rb: + last_write_checksum: sha1:7efc2f252acf0ac4c7fa05b80b7c298181086220 + lib/moderation_api/models/operations/clientaction.rbi: + last_write_checksum: sha1:1769551969ad98edc5bb62e55c34f2af0970247b + lib/moderation_api/models/operations/code_abuse.rb: + last_write_checksum: sha1:380fe99a9ad99fcce216f7611a659b17565a0d83 + lib/moderation_api/models/operations/code_abuse.rbi: + last_write_checksum: sha1:5d045e43fb9821f2fab55e08e1155dda7900cfce + lib/moderation_api/models/operations/comparator.rb: + last_write_checksum: sha1:e92e6b65af1f5f43f4c9c7c214ae9c53b689fff5 + lib/moderation_api/models/operations/comparator.rbi: + last_write_checksum: sha1:ba1a431a27404a47dc137796231ce89035e90506 + lib/moderation_api/models/operations/compassion_insight.rb: + last_write_checksum: sha1:55663d82ffb5c020dab8f89d5eaf6ebbb63dc2da + lib/moderation_api/models/operations/compassion_insight.rbi: + last_write_checksum: sha1:3fd8406cc8d288c321ac60e6cf3f6c8e7ae38c10 + lib/moderation_api/models/operations/content_leaf_request.rb: + last_write_checksum: sha1:660118dbe77a7040cb9b98d0da15198ae4e67037 + lib/moderation_api/models/operations/content_leaf_request.rbi: + last_write_checksum: sha1:a61b5f20b4156314e49e5999bd40752a6e02a6e5 + lib/moderation_api/models/operations/content_leaf_response.rb: + last_write_checksum: sha1:afd58933bacc32baa04e01011593733f889af558 + lib/moderation_api/models/operations/content_leaf_response.rbi: + last_write_checksum: sha1:11b03d32a31b064d4cf0ffe7a0016d78c240c440 + lib/moderation_api/models/operations/content_request.rb: + last_write_checksum: sha1:84219105f4fca6ad7333c3257dc9274ae4d99d13 + lib/moderation_api/models/operations/content_request.rbi: + last_write_checksum: sha1:7b43fdc523acefb61433f3391fc56013531abe4a + lib/moderation_api/models/operations/content_response.rb: + last_write_checksum: sha1:0030be6cbf31dfd6b2af01062237cdc6b824b0a6 + lib/moderation_api/models/operations/content_response.rbi: + last_write_checksum: sha1:38fe26b75348199a24a8e5144d909f666d4d0670 + lib/moderation_api/models/operations/createaction_position_request.rb: + last_write_checksum: sha1:363e194cb1d8ee588a58d868a65f8768f4cc7e9e + lib/moderation_api/models/operations/createaction_position_request.rbi: + last_write_checksum: sha1:15e78df2d432716eb35cd206caafddacc4a03fb4 + lib/moderation_api/models/operations/createaction_position_response.rb: + last_write_checksum: sha1:a63e46dc1a11b909438542ae2c3d641021b600cd + lib/moderation_api/models/operations/createaction_position_response.rbi: + last_write_checksum: sha1:83850c0c2b170e90f86efa348f78065ba30d3bf7 + lib/moderation_api/models/operations/createaction_possiblevalue_request.rb: + last_write_checksum: sha1:9fa099b538658b459969b7a890f5b6a8e34afa1e + lib/moderation_api/models/operations/createaction_possiblevalue_request.rbi: + last_write_checksum: sha1:a013a0cc871bd903b1e9a514d2d6c49a0d3754a9 + lib/moderation_api/models/operations/createaction_possiblevalue_response.rb: + last_write_checksum: sha1:ba24c2f006814ed36b443b28174d2935bb1bc493 + lib/moderation_api/models/operations/createaction_possiblevalue_response.rbi: + last_write_checksum: sha1:9512ac5d231afb61a00e6862dfa94fd535047d07 + lib/moderation_api/models/operations/createaction_queuebehaviour_request.rb: + last_write_checksum: sha1:1fbc073257b1d005af5577c211104763b537c3bd + lib/moderation_api/models/operations/createaction_queuebehaviour_request.rbi: + last_write_checksum: sha1:a1f7025b84cdfaf58991e5ba5d4e4a1e1898fca4 + lib/moderation_api/models/operations/createaction_queuebehaviour_response.rb: + last_write_checksum: sha1:a2e16ae4572bd47e673b23246c09c6cf059e71f3 + lib/moderation_api/models/operations/createaction_queuebehaviour_response.rbi: + last_write_checksum: sha1:853a04df51eb97327381a7d4d027942838808e3d + lib/moderation_api/models/operations/createaction_request.rb: + last_write_checksum: sha1:0fb4bc55f78f95268c6d53e555d1e0a9d40afad0 + lib/moderation_api/models/operations/createaction_request.rbi: + last_write_checksum: sha1:710c402063f88e254b6fb54f62e917cc45647b1e + lib/moderation_api/models/operations/createaction_response.rb: + last_write_checksum: sha1:33da5aeb1f7ab8025ad717199d3e8cb5808edc65 + lib/moderation_api/models/operations/createaction_response.rbi: + last_write_checksum: sha1:05a128a6ef6acb55bb29d553fe9f9e4460fd50ce + lib/moderation_api/models/operations/createaction_responsebody.rb: + last_write_checksum: sha1:a85c9dcbf2024ae8fad211badd0b80566a465020 + lib/moderation_api/models/operations/createaction_responsebody.rbi: + last_write_checksum: sha1:eb04026bfa4d214fa7f5ddebc01456f2a3627b5e + lib/moderation_api/models/operations/createaction_type_request.rb: + last_write_checksum: sha1:5ca00abad9c63a5159950a3a0cd9bb92782ba154 + lib/moderation_api/models/operations/createaction_type_request.rbi: + last_write_checksum: sha1:342d90553e8cb6449b0dd513d733aed1f1fc4730 + lib/moderation_api/models/operations/createaction_type_response.rb: + last_write_checksum: sha1:910f3e2ebf16638bfa5a3debe7d93c3e4aa24df5 + lib/moderation_api/models/operations/createaction_type_response.rbi: + last_write_checksum: sha1:a16762601fd1cbe96ec29894cb5e36ab2c58dcea + lib/moderation_api/models/operations/createauthor_metadata.rb: + last_write_checksum: sha1:c74d054490db253770ae5d81be05978b079dbb89 + lib/moderation_api/models/operations/createauthor_metadata.rbi: + last_write_checksum: sha1:dd2823e16e0e18fd338752e2ff0211cb7f15a8aa + lib/moderation_api/models/operations/createauthor_request.rb: + last_write_checksum: sha1:9a53e07f79c947afbf8b3fe29c59ead8bf07207b + lib/moderation_api/models/operations/createauthor_request.rbi: + last_write_checksum: sha1:294487213bc64d4416d2ef4e426525c6a43b180a + lib/moderation_api/models/operations/createauthor_response.rb: + last_write_checksum: sha1:d2163c72dbcb59104fadc04ff1411d39d84ad359 + lib/moderation_api/models/operations/createauthor_response.rbi: + last_write_checksum: sha1:fb89a32d54296bc9349f41671dbba649fcca1612 + lib/moderation_api/models/operations/createchannel_contenttype.rb: + last_write_checksum: sha1:44b229c003805a1d265e8f71469e7495b2cb0a2c + lib/moderation_api/models/operations/createchannel_contenttype.rbi: + last_write_checksum: sha1:5155063882cbb9b5e900c6ba52041df1a1a9de23 + lib/moderation_api/models/operations/createchannel_request.rb: + last_write_checksum: sha1:dbd8e0838e73a4c989addfc1888e148af56a9e6a + lib/moderation_api/models/operations/createchannel_request.rbi: + last_write_checksum: sha1:2c1f16e1cf6ddd511ba64618edeccfdb37a3ccf3 + lib/moderation_api/models/operations/createchannel_requestbody.rb: + last_write_checksum: sha1:7d75ba54e4360a4bb7319d893b113f8ad1996da0 + lib/moderation_api/models/operations/createchannel_requestbody.rbi: + last_write_checksum: sha1:e9e0b24481af229d281345a55bbb66c5ab6b1cb1 + lib/moderation_api/models/operations/createchannel_response.rb: + last_write_checksum: sha1:1d6b69e30743496c597c42ffed13be240dfbbdad + lib/moderation_api/models/operations/createchannel_response.rbi: + last_write_checksum: sha1:25a88b1effd2743f491cbcfce687d2a2fdfaaf54 + lib/moderation_api/models/operations/createproject_request.rb: + last_write_checksum: sha1:0261b62d1fa59def33337ff51466182ff16f2b11 + lib/moderation_api/models/operations/createproject_request.rbi: + last_write_checksum: sha1:b5c23ed550b51adb3a8edecc9a37c53af36e16bc + lib/moderation_api/models/operations/createproject_response.rb: + last_write_checksum: sha1:12b44a9344000be347d7526ba7e9acfb8ae266c9 + lib/moderation_api/models/operations/createproject_response.rbi: + last_write_checksum: sha1:77a1e7edede46f0f0e401f9e654e2ee1c7cc193d + lib/moderation_api/models/operations/createwebhook_eventtype_request.rb: + last_write_checksum: sha1:0643416d09f87ef794d21c67f530ac7bc792f00c + lib/moderation_api/models/operations/createwebhook_eventtype_request.rbi: + last_write_checksum: sha1:7921673f1c1d9c8cadeb772897e09977a872ee8b + lib/moderation_api/models/operations/createwebhook_eventtype_response.rb: + last_write_checksum: sha1:3c14a8cd1c9bacaf507974b31a6768e0033b28ee + lib/moderation_api/models/operations/createwebhook_eventtype_response.rbi: + last_write_checksum: sha1:56ca3b2cf8be519f6d9478df11e069a0ccf825bd + lib/moderation_api/models/operations/createwebhook_payloadversion.rb: + last_write_checksum: sha1:c4c2e5c275f88c46f0611eae2169c5696d81f610 + lib/moderation_api/models/operations/createwebhook_payloadversion.rbi: + last_write_checksum: sha1:2e45b0084d0ed4e0434f63850dbb48a556cde35c + lib/moderation_api/models/operations/createwebhook_request.rb: + last_write_checksum: sha1:6d924f88260762e704f01bf00dc20f86e7a82926 + lib/moderation_api/models/operations/createwebhook_request.rbi: + last_write_checksum: sha1:8f2237118d7bd6191a0c30cf032d6ed0af1340a2 + lib/moderation_api/models/operations/createwebhook_response.rb: + last_write_checksum: sha1:f7af74f2f34b2a32af7b0f3f6a6bad862717cbd3 + lib/moderation_api/models/operations/createwebhook_response.rbi: + last_write_checksum: sha1:238ad1e5d519732ed3c64287cf9a4fe3ce8137ba + lib/moderation_api/models/operations/createwebhook_responsebody.rb: + last_write_checksum: sha1:4b3526db4633bd11409b756e2b1c0e2c4c1750e9 + lib/moderation_api/models/operations/createwebhook_responsebody.rbi: + last_write_checksum: sha1:19c7c026b2ad865c2ae766af0d3fab2dc2afc9b4 + lib/moderation_api/models/operations/crypto.rb: + last_write_checksum: sha1:95dd12f4058ece1f9a4228eb9057ba9ae354a15d + lib/moderation_api/models/operations/crypto.rbi: + last_write_checksum: sha1:cc1c90e44d9527db501984b116e8fe75d5beb976 + lib/moderation_api/models/operations/curiosity_insight.rb: + last_write_checksum: sha1:66dfc5eb21ef2695aa17687749505f878e3ff1c6 + lib/moderation_api/models/operations/curiosity_insight.rbi: + last_write_checksum: sha1:f406b6089e2a3abc361cd6fb78d7ea9d72b4b769 + lib/moderation_api/models/operations/current_project.rb: + last_write_checksum: sha1:250396f14aac989d0a06895939f5b09520a0f0ea + lib/moderation_api/models/operations/current_project.rbi: + last_write_checksum: sha1:70e0338f1910d1daea51fa51ea2d63cf88aa1616 + lib/moderation_api/models/operations/dailyreviewcount.rb: + last_write_checksum: sha1:342241820838b83eda4e9a78309e4125b51ea5ea + lib/moderation_api/models/operations/dailyreviewcount.rbi: + last_write_checksum: sha1:8e030c4eddce6c55d3a72d0a02e676a02bd00f3f + lib/moderation_api/models/operations/data_audio.rb: + last_write_checksum: sha1:a0ba673f603950852f3eb3c98f413b8e93274f1d + lib/moderation_api/models/operations/data_audio.rbi: + last_write_checksum: sha1:6f868654dcbe83528ff02a54e44c2e216764a46d + lib/moderation_api/models/operations/data_image.rb: + last_write_checksum: sha1:146fad22e99de067814ea59f55fa39963b2fe745 + lib/moderation_api/models/operations/data_image.rbi: + last_write_checksum: sha1:aadfa20d973aa15cd0a270abcd327f7214f5afd1 + lib/moderation_api/models/operations/data_text.rb: + last_write_checksum: sha1:39f61af1977a818a58b145e8dcfa26f6ca9c3c5e + lib/moderation_api/models/operations/data_text.rbi: + last_write_checksum: sha1:815e6e1903374564cae0ff1ffe497a65ddeb0573 + lib/moderation_api/models/operations/data_video.rb: + last_write_checksum: sha1:77fb820ec1c252d8d310f84aec0cabdbc475aa21 + lib/moderation_api/models/operations/data_video.rbi: + last_write_checksum: sha1:a12143277ab2373c81cd11e614de744ece622ca8 + lib/moderation_api/models/operations/deleteaction_request.rb: + last_write_checksum: sha1:7272c747ca6397d6fcb55d4bb7ca33f681f0513c + lib/moderation_api/models/operations/deleteaction_request.rbi: + last_write_checksum: sha1:7786932f0b0eb4d866a55b1b9a5cc2a79af680b5 + lib/moderation_api/models/operations/deleteaction_response.rb: + last_write_checksum: sha1:2cd62c515e3de0f88fc7b4c691aa06caf37f3dea + lib/moderation_api/models/operations/deleteaction_response.rbi: + last_write_checksum: sha1:8a4beef1b124de2fe0187bd825a771c2d52904f3 + lib/moderation_api/models/operations/deleteaction_responsebody.rb: + last_write_checksum: sha1:0cd2d68317c69b59b5dd1811142fdfdfbe067801 + lib/moderation_api/models/operations/deleteaction_responsebody.rbi: + last_write_checksum: sha1:42d7625788ac5d314387ccb47c555c828dd55210 + lib/moderation_api/models/operations/deleteauthor_request.rb: + last_write_checksum: sha1:973d362f3a3a36558c083828dd3bd8e08bda71ba + lib/moderation_api/models/operations/deleteauthor_request.rbi: + last_write_checksum: sha1:8a3e6b8308afb73955fa393df815cecf006fe139 + lib/moderation_api/models/operations/deleteauthor_response.rb: + last_write_checksum: sha1:49e79f5e40d77fdae6ea3996988b6c856e532466 + lib/moderation_api/models/operations/deleteauthor_response.rbi: + last_write_checksum: sha1:7b1fcf96cf4182d6b889f1d80acb0c47131763e6 + lib/moderation_api/models/operations/deleteauthor_responsebody.rb: + last_write_checksum: sha1:e710866700eca6e258e94fb37d958ee710fb2793 + lib/moderation_api/models/operations/deleteauthor_responsebody.rbi: + last_write_checksum: sha1:bf018b813c8f08b53fe9ae5fe3c85d0ab68dff58 + lib/moderation_api/models/operations/deletechannel_request.rb: + last_write_checksum: sha1:7b63337bf404505b908c90e386838217e1e07161 + lib/moderation_api/models/operations/deletechannel_request.rbi: + last_write_checksum: sha1:3898b944aafb2df68d078774c57a680e77419462 + lib/moderation_api/models/operations/deletechannel_response.rb: + last_write_checksum: sha1:1cedbbeafc13de6c58b717fdf12afcfcddde04a2 + lib/moderation_api/models/operations/deletechannel_response.rbi: + last_write_checksum: sha1:793350c2e17cc23db4dfcddfebe7e991717d7846 + lib/moderation_api/models/operations/deletechannel_responsebody.rb: + last_write_checksum: sha1:89505ff3ec9ce84a475a0a5da10112a8e7c1e6fd + lib/moderation_api/models/operations/deletechannel_responsebody.rbi: + last_write_checksum: sha1:af0096a8da3a5bd2196f7c6bacbf9e11284108f5 + lib/moderation_api/models/operations/deleteproject_request.rb: + last_write_checksum: sha1:433171eee160d035de399b9bf549287fcc86855b + lib/moderation_api/models/operations/deleteproject_request.rbi: + last_write_checksum: sha1:8225b79125ef04946320f52c48c3d6040cd6c635 + lib/moderation_api/models/operations/deleteproject_response.rb: + last_write_checksum: sha1:519ad95043897ca1b73c8f7a99e645703dc41aa7 + lib/moderation_api/models/operations/deleteproject_response.rbi: + last_write_checksum: sha1:5ca31751d04632407d80d2f8f933ed128208a386 + lib/moderation_api/models/operations/deleteproject_responsebody.rb: + last_write_checksum: sha1:65045c2879c07cb70632f2628c8106544b6a6b34 + lib/moderation_api/models/operations/deleteproject_responsebody.rbi: + last_write_checksum: sha1:b3d8297878bddf23e6de4f27658aee9b839489a4 + lib/moderation_api/models/operations/deletewebhook_request.rb: + last_write_checksum: sha1:5b812d5de6adb8b80a8082ccac6e36a3701a42e4 + lib/moderation_api/models/operations/deletewebhook_request.rbi: + last_write_checksum: sha1:5de250983f03e57fe75bd777d0f4253b15e89a82 + lib/moderation_api/models/operations/deletewebhook_response.rb: + last_write_checksum: sha1:b0157eb932f790b22c8648d55b123c70fb80c37d + lib/moderation_api/models/operations/deletewebhook_response.rbi: + last_write_checksum: sha1:834eb428369e34a2654ab3da0999e08945ef8d4b + lib/moderation_api/models/operations/deletewebhook_responsebody.rb: + last_write_checksum: sha1:d02d6845bbe248684b041c074db9607d67a2f8a1 + lib/moderation_api/models/operations/deletewebhook_responsebody.rbi: + last_write_checksum: sha1:40de1639f53aff5282809248f807557701711009 + lib/moderation_api/models/operations/drugs.rb: + last_write_checksum: sha1:9a658147ecce726db9fa93f3c8d17322dde370f8 + lib/moderation_api/models/operations/drugs.rbi: + last_write_checksum: sha1:645e1c572cb9bd221804ebb92f735ae8dddea311 + lib/moderation_api/models/operations/duplicatechannel_request.rb: + last_write_checksum: sha1:f70c16505abf2033f182e77c58a971e4c13ed881 + lib/moderation_api/models/operations/duplicatechannel_request.rbi: + last_write_checksum: sha1:8c37db27d35fb2525c6d36bc4d501939e3aa6e6c + lib/moderation_api/models/operations/duplicatechannel_requestbody.rb: + last_write_checksum: sha1:453db122a6c2acaca22fd063984b57bb4aabfb30 + lib/moderation_api/models/operations/duplicatechannel_requestbody.rbi: + last_write_checksum: sha1:f4f743d768b8767969804d2a63fae4028e9f2752 + lib/moderation_api/models/operations/duplicatechannel_response.rb: + last_write_checksum: sha1:60282e2605a4939db37673891fc327d5c7a94380 + lib/moderation_api/models/operations/duplicatechannel_response.rbi: + last_write_checksum: sha1:f4b7333852ea2f19e94a70049db25456117cdd39 + lib/moderation_api/models/operations/duplicateproject_request.rb: + last_write_checksum: sha1:5b917887969aafb8d0450059dc909996bc24ab60 + lib/moderation_api/models/operations/duplicateproject_request.rbi: + last_write_checksum: sha1:f28d087ad8e6ff07cf4c5623b5d02a9f302b239d + lib/moderation_api/models/operations/duplicateproject_requestbody.rb: + last_write_checksum: sha1:31b9a84882e63aa8f430634501887e080496c013 + lib/moderation_api/models/operations/duplicateproject_requestbody.rbi: + last_write_checksum: sha1:e83bb9203f279fdb4fcbe421dc4c01ea6339c5ca + lib/moderation_api/models/operations/duplicateproject_response.rb: + last_write_checksum: sha1:764f2f0db291280e1c2781d567291c15bfb8c926 + lib/moderation_api/models/operations/duplicateproject_response.rbi: + last_write_checksum: sha1:08a3853b4990618e7011249c5262fdc3cacacdcd + lib/moderation_api/models/operations/entities_1.rb: + last_write_checksum: sha1:2fffb1be2886e3a3344a3cecb6b31528e7a1920a + lib/moderation_api/models/operations/entities_1.rbi: + last_write_checksum: sha1:a942d864c0ac4e5928a7741144a51f482e803a94 + lib/moderation_api/models/operations/entities_2.rb: + last_write_checksum: sha1:a90b56301630f4d4591c68d07f911e5c3dd890fe + lib/moderation_api/models/operations/entities_2.rbi: + last_write_checksum: sha1:2dc458526044eb086f1939d7af00b3fd267e7bff + lib/moderation_api/models/operations/entity_matcher_output.rb: + last_write_checksum: sha1:af0c7d2aab68449dd20b558db12d01ef06ce372c + lib/moderation_api/models/operations/entity_matcher_output.rbi: + last_write_checksum: sha1:4a8669d163b0b5d7f078dca418f89f8bcc219ebf + lib/moderation_api/models/operations/error.rb: + last_write_checksum: sha1:3f3da0586553e0c8643fc2d2c06f3bb3995259c9 + lib/moderation_api/models/operations/error.rbi: + last_write_checksum: sha1:7dc0d9bb473592fc0b330dfae85d436b80910fa4 + lib/moderation_api/models/operations/evaluation.rb: + last_write_checksum: sha1:326cb986db0e5cb1fb748b4bf4374f18b9aeb1c8 + lib/moderation_api/models/operations/evaluation.rbi: + last_write_checksum: sha1:7ede0a62266263475bbf0f6ec4ff029f180e1d2b + lib/moderation_api/models/operations/executeaction_request.rb: + last_write_checksum: sha1:284dc648138d8bb2356e92a7ac24de77b5ec6ff0 + lib/moderation_api/models/operations/executeaction_request.rbi: + last_write_checksum: sha1:3ccef1f5e1852b76d86829c5ae93fed18d0557b7 + lib/moderation_api/models/operations/executeaction_response.rb: + last_write_checksum: sha1:da59db1849ef77e0bf76977365fa7f09f1aba52e + lib/moderation_api/models/operations/executeaction_response.rbi: + last_write_checksum: sha1:df110449e3d5e683ffaa29600c38b8251ac4473f + lib/moderation_api/models/operations/executeaction_responsebody.rb: + last_write_checksum: sha1:9aa0ee714dab0bb08002ca26240fedee56a3e02e + lib/moderation_api/models/operations/executeaction_responsebody.rbi: + last_write_checksum: sha1:608f39874805e9681e22202cbd0f8685d66dfa28 + lib/moderation_api/models/operations/extremism.rb: + last_write_checksum: sha1:e40dc3aceea367fcf15acf8a34b3a778ec175eb0 + lib/moderation_api/models/operations/extremism.rbi: + last_write_checksum: sha1:e5b7f49d750e2bcbd034e93c9bc0208cc51d143e + lib/moderation_api/models/operations/face_detection.rb: + last_write_checksum: sha1:63c3b2ae3caf228f670cee297a9556925f35f57d + lib/moderation_api/models/operations/face_detection.rbi: + last_write_checksum: sha1:099a343d2798722cc63bf9c3d8751210f1990f88 + lib/moderation_api/models/operations/filter.rb: + last_write_checksum: sha1:f715edc09013054f9ab12c899d57dcc04900791e + lib/moderation_api/models/operations/filter.rbi: + last_write_checksum: sha1:779c2c88b491f719935dbce9b23e4ed9ebf66630 + lib/moderation_api/models/operations/filterlabel.rb: + last_write_checksum: sha1:40a567c7fea672e8498c7d3f591527255d87cf2a + lib/moderation_api/models/operations/filterlabel.rbi: + last_write_checksum: sha1:d6698f157a3c40c77cda13332f946bc377cc93f7 + lib/moderation_api/models/operations/flaggedcontenttrend.rb: + last_write_checksum: sha1:ef536be9fb316d947c464c52c28700f685930bfe + lib/moderation_api/models/operations/flaggedcontenttrend.rbi: + last_write_checksum: sha1:00252e78a6646c1c95fe6a7ac5b2b2b4c6f798f4 + lib/moderation_api/models/operations/flaggingmode.rb: + last_write_checksum: sha1:d10a21ea7982dc2008eed06a64ce1986f9bcc7a5 + lib/moderation_api/models/operations/flaggingmode.rbi: + last_write_checksum: sha1:13c5d6fefbadfbe0cba84bb9f97cd507ca2a215b + lib/moderation_api/models/operations/gambling.rb: + last_write_checksum: sha1:7aea31107d581302bd1d13c17c68d43631c8c813 + lib/moderation_api/models/operations/gambling.rbi: + last_write_checksum: sha1:3c0dca992e2a39fe1477750ca106948527a73016 + lib/moderation_api/models/operations/getaccount_response.rb: + last_write_checksum: sha1:5fc0170954a792776ddfb8d515494dad652305e1 + lib/moderation_api/models/operations/getaccount_response.rbi: + last_write_checksum: sha1:203d6a6bdcac7617495ad2f31df89728a999ad15 + lib/moderation_api/models/operations/getaccount_responsebody.rb: + last_write_checksum: sha1:5f0f0335104f9058bbadca944f47423013bb28b1 + lib/moderation_api/models/operations/getaccount_responsebody.rbi: + last_write_checksum: sha1:34c44e6f1b90e63b990448168ecc12f5d90d638e + lib/moderation_api/models/operations/getaction_position.rb: + last_write_checksum: sha1:558f79a2e0006949e31547eacb0e01925773e243 + lib/moderation_api/models/operations/getaction_position.rbi: + last_write_checksum: sha1:5b85be7f85e4f5ab649f8fad76ac0eea708d6752 + lib/moderation_api/models/operations/getaction_possiblevalue.rb: + last_write_checksum: sha1:5d8da38c81d50ed9f68ebd32c95e2d30bf71098f + lib/moderation_api/models/operations/getaction_possiblevalue.rbi: + last_write_checksum: sha1:9a78fb23622019e60d3933518bc834babbb4dd1c + lib/moderation_api/models/operations/getaction_queuebehaviour.rb: + last_write_checksum: sha1:96329455bc2a28cb0bc302985ae8fdcb8f6c92f3 + lib/moderation_api/models/operations/getaction_queuebehaviour.rbi: + last_write_checksum: sha1:c0c32f0051a476d112ad505e50be9517375d5286 + lib/moderation_api/models/operations/getaction_request.rb: + last_write_checksum: sha1:46fa64cd5646a22a75ed12fcf6c89d1044b1e446 + lib/moderation_api/models/operations/getaction_request.rbi: + last_write_checksum: sha1:9bf34d6850f0256523924baca8f35c33fa97a666 + lib/moderation_api/models/operations/getaction_response.rb: + last_write_checksum: sha1:3151d35644fe5c81e17c079cf2eb5a5f36fe00e1 + lib/moderation_api/models/operations/getaction_response.rbi: + last_write_checksum: sha1:6eafa9a0e486cd2114e16d059d3d8666e206a029 + lib/moderation_api/models/operations/getaction_responsebody.rb: + last_write_checksum: sha1:565e362546bcd8bbe693d0ab640b50c709dbfd9f + lib/moderation_api/models/operations/getaction_responsebody.rbi: + last_write_checksum: sha1:978072d62accf48e17df882817a0a7e0b9f461b8 + lib/moderation_api/models/operations/getaction_type.rb: + last_write_checksum: sha1:da0122b903cb8d9db5f72a3f3fa5a967e8c18397 + lib/moderation_api/models/operations/getaction_type.rbi: + last_write_checksum: sha1:394a433ae22d77a213ba8d2ef7863f41e723eed2 + lib/moderation_api/models/operations/getauthor_request.rb: + last_write_checksum: sha1:ace6bf7dc2a9460e046136ab38c8e61327dc96ac + lib/moderation_api/models/operations/getauthor_request.rbi: + last_write_checksum: sha1:fbc1ec4a50f603b7e335e3d0cc90e1cedbd04ffa + lib/moderation_api/models/operations/getauthor_response.rb: + last_write_checksum: sha1:d74e5faf867afe8f64cbd0b5accedc57c509bd3e + lib/moderation_api/models/operations/getauthor_response.rbi: + last_write_checksum: sha1:a5f348c7afe03d4787c55fb96ea534fa19fdabd8 + lib/moderation_api/models/operations/getchannel_request.rb: + last_write_checksum: sha1:c7e25a2fc9820377eefc5d8c427cec4fc340dc0b + lib/moderation_api/models/operations/getchannel_request.rbi: + last_write_checksum: sha1:bc9167aa21f02b9944b1c84b0b66210cce817570 + lib/moderation_api/models/operations/getchannel_response.rb: + last_write_checksum: sha1:a8edf439c05a9715c02700577bd9d30f0920ab19 + lib/moderation_api/models/operations/getchannel_response.rbi: + last_write_checksum: sha1:862c2d948175d41f8639f8449e6543bafdb53181 + lib/moderation_api/models/operations/getproject_request.rb: + last_write_checksum: sha1:45ddb8f83616b47e162064b775fac78ae6d7d29b + lib/moderation_api/models/operations/getproject_request.rbi: + last_write_checksum: sha1:9268c75a37fa9c65cd17ae0540ad52bff8761d63 + lib/moderation_api/models/operations/getproject_response.rb: + last_write_checksum: sha1:742f592ecaffd9d8eb5454950955b8fd262b75ae + lib/moderation_api/models/operations/getproject_response.rbi: + last_write_checksum: sha1:58665f3b5316d7ddd3e75c63584aa5e350e7576f + lib/moderation_api/models/operations/getqueue_contenttype.rb: + last_write_checksum: sha1:27850722042b4e2ada96167aec59b2c61be0a479 + lib/moderation_api/models/operations/getqueue_contenttype.rbi: + last_write_checksum: sha1:c469a99b79ce904587ae87d3b46807a7bbe1a7d4 + lib/moderation_api/models/operations/getqueue_recommendationaction.rb: + last_write_checksum: sha1:7e5de8439843bf4815c641a898b4ca23134945d2 + lib/moderation_api/models/operations/getqueue_recommendationaction.rbi: + last_write_checksum: sha1:c954bc135e25e58683bed62e31de157fe586139a + lib/moderation_api/models/operations/getqueue_request.rb: + last_write_checksum: sha1:fcb7d14ea4ba727ec002e69bc810854d1430dbed + lib/moderation_api/models/operations/getqueue_request.rbi: + last_write_checksum: sha1:1a86a1f2f0346746e127b7f2d8209522f2693b82 + lib/moderation_api/models/operations/getqueue_response.rb: + last_write_checksum: sha1:b4634c35bac1d582a3b01efa6d75299b79954cd3 + lib/moderation_api/models/operations/getqueue_response.rbi: + last_write_checksum: sha1:7ac069f5030357b19efc79f776e434d223e2ff4c + lib/moderation_api/models/operations/getqueue_responsebody.rb: + last_write_checksum: sha1:0638a3bde7be72d3912b31d969f347e14eab7fd9 + lib/moderation_api/models/operations/getqueue_responsebody.rbi: + last_write_checksum: sha1:0046e8d7a4d9b65f83cbc697d813a1dd0bd0b29a + lib/moderation_api/models/operations/getqueue_type.rb: + last_write_checksum: sha1:aa9b9220ec1669603f70c07568121223e06ef6cb + lib/moderation_api/models/operations/getqueue_type.rbi: + last_write_checksum: sha1:077545165e946578e697d7663bfd89d006f05f75 + lib/moderation_api/models/operations/getqueuestats_request.rb: + last_write_checksum: sha1:a5ad808317aecb93eb30120359f1b8e3177ad4c8 + lib/moderation_api/models/operations/getqueuestats_request.rbi: + last_write_checksum: sha1:9f609cd174f7938a7839ec24a7b2cf69608e0aef + lib/moderation_api/models/operations/getqueuestats_response.rb: + last_write_checksum: sha1:990d9a88096821ab8f60fdcc2b8665b1f3ff514c + lib/moderation_api/models/operations/getqueuestats_response.rbi: + last_write_checksum: sha1:592e8b81f46313f4f48035e3e8400649d955bd4f + lib/moderation_api/models/operations/getqueuestats_responsebody.rb: + last_write_checksum: sha1:2386cac908d9c803ff53619a57c9b0a08fc3fe4a + lib/moderation_api/models/operations/getqueuestats_responsebody.rbi: + last_write_checksum: sha1:52b1283b6885d4a1a27396b7bee1ce0a9d966ace + lib/moderation_api/models/operations/getwebhook_eventtype.rb: + last_write_checksum: sha1:ebd229aaab7bcc520b3ee229384d15d62d17c10d + lib/moderation_api/models/operations/getwebhook_eventtype.rbi: + last_write_checksum: sha1:adf2daab018df749e54f0e9565e1ad9b3cae1134 + lib/moderation_api/models/operations/getwebhook_payloadversion.rb: + last_write_checksum: sha1:8ad22a096c16dc64715d8b325905d96eaaf9d28d + lib/moderation_api/models/operations/getwebhook_payloadversion.rbi: + last_write_checksum: sha1:6b50974441d14d33f34e3737b7163330e8675b44 + lib/moderation_api/models/operations/getwebhook_request.rb: + last_write_checksum: sha1:81037556f00e3256613849b2cc113c805c1cc4ce + lib/moderation_api/models/operations/getwebhook_request.rbi: + last_write_checksum: sha1:65a3eb0585f23cf6f962dd6b8be9645e5391693f + lib/moderation_api/models/operations/getwebhook_response.rb: + last_write_checksum: sha1:ba64499e52581a7272465eecc2ee08f6d7828563 + lib/moderation_api/models/operations/getwebhook_response.rbi: + last_write_checksum: sha1:018b869f6fd7d2a9970425d17d1206130c743019 + lib/moderation_api/models/operations/getwebhook_responsebody.rb: + last_write_checksum: sha1:5c8f484feba7fa5e366edac51f69171a00fce5c1 + lib/moderation_api/models/operations/getwebhook_responsebody.rbi: + last_write_checksum: sha1:5655f9ab43c4c522fb653dd1883bbb56f2c3d9cb + lib/moderation_api/models/operations/getwebhooksecret_response.rb: + last_write_checksum: sha1:0cd9020ca4a4533dcef841ce223ff2566f036daf + lib/moderation_api/models/operations/getwebhooksecret_response.rbi: + last_write_checksum: sha1:1cdbcdc402dd10214ed5524aed4ce2334119c116 + lib/moderation_api/models/operations/getwebhooksecret_responsebody.rb: + last_write_checksum: sha1:06532e546a07f84f224f4c390f0dacd05b3d5d9d + lib/moderation_api/models/operations/getwebhooksecret_responsebody.rbi: + last_write_checksum: sha1:252bd188afed0a23c0f5cbb9339d14d905dbec1c + lib/moderation_api/models/operations/getwordlist_request.rb: + last_write_checksum: sha1:c3d51a9149c6d3f99867385c46bca66a3e1f5e60 + lib/moderation_api/models/operations/getwordlist_request.rbi: + last_write_checksum: sha1:9b3c5f558311c488833efc04da0531cf644039c6 + lib/moderation_api/models/operations/getwordlist_response.rb: + last_write_checksum: sha1:ff5945c2f923c6e982c9d43ad61b07ac8c1e9628 + lib/moderation_api/models/operations/getwordlist_response.rbi: + last_write_checksum: sha1:057f2feb13a3151106ff4892e08e0c9b3f52421f + lib/moderation_api/models/operations/getwordlist_responsebody.rb: + last_write_checksum: sha1:4b8ef36c5e8ed85db1cbcd5eaeeeb3bdfc56646e + lib/moderation_api/models/operations/getwordlist_responsebody.rbi: + last_write_checksum: sha1:dd7cb338ff0927708f3a523f3bd0e487f056b975 + lib/moderation_api/models/operations/getwordlistembeddingstatus_request.rb: + last_write_checksum: sha1:df6904cd7c1bcec7de418b59606ac45450c9c206 + lib/moderation_api/models/operations/getwordlistembeddingstatus_request.rbi: + last_write_checksum: sha1:6d8c11b3f533d1f3234a169d65b8ab9f34bfb51a + lib/moderation_api/models/operations/getwordlistembeddingstatus_response.rb: + last_write_checksum: sha1:be9808e6812bbc42cad3366a5dd06f3c4e153409 + lib/moderation_api/models/operations/getwordlistembeddingstatus_response.rbi: + last_write_checksum: sha1:608e0017d5bc420bf7b6f44ea28e0d9b1a72a515 + lib/moderation_api/models/operations/getwordlistembeddingstatus_responsebody.rb: + last_write_checksum: sha1:2d0f5c07155c942683bcd746fb7db21361300759 + lib/moderation_api/models/operations/getwordlistembeddingstatus_responsebody.rbi: + last_write_checksum: sha1:3e5a98bbe7e83345dac5e1d8c36d0c5cd5f62567 + lib/moderation_api/models/operations/globalflaggingmode.rb: + last_write_checksum: sha1:d8de855972890716ebd5ee2fe68c1bf38e7bc660 + lib/moderation_api/models/operations/globalflaggingmode.rbi: + last_write_checksum: sha1:0e10856f8f07110fb62faa697c6b7bbe85287345 + lib/moderation_api/models/operations/guideline.rb: + last_write_checksum: sha1:e228f2de26720c1892dff00d9da83489207b4298 + lib/moderation_api/models/operations/guideline.rbi: + last_write_checksum: sha1:13251f192ecef2175e68d205ad7ad1e733aadc9c + lib/moderation_api/models/operations/hate.rb: + last_write_checksum: sha1:4182088129ca2d41c161ecb1ad30a4e559956b68 + lib/moderation_api/models/operations/hate.rbi: + last_write_checksum: sha1:b4c64c1ce4027f18f9cd9c311d7ce27fa884b074 + lib/moderation_api/models/operations/illegal_trade.rb: + last_write_checksum: sha1:5ba96c2ec263aaa52ec4cb0169040ffaef2f3ddf + lib/moderation_api/models/operations/illegal_trade.rbi: + last_write_checksum: sha1:60b543dfd01cb78471c2b610a7002fa459f22e5b + lib/moderation_api/models/operations/illicit.rb: + last_write_checksum: sha1:7ffeddcf722fedb1f6c6ed3d914c37d0231c3a07 + lib/moderation_api/models/operations/illicit.rbi: + last_write_checksum: sha1:6a8141411cfa92dc3e7bc56ccd568bf5fa405dd9 + lib/moderation_api/models/operations/illicit_alcohol.rb: + last_write_checksum: sha1:a2889d084b4b679a8805c12216462656b22bb655 + lib/moderation_api/models/operations/illicit_alcohol.rbi: + last_write_checksum: sha1:14a0195bc09122132a1a87d417c0bc525f75567a + lib/moderation_api/models/operations/illicit_drugs.rb: + last_write_checksum: sha1:bf180aa00e73d063db4f8d9022292b17df09d57c + lib/moderation_api/models/operations/illicit_drugs.rbi: + last_write_checksum: sha1:6e62d7c94ad828d44c0dca4966eeb73985ca7c7b + lib/moderation_api/models/operations/illicit_firearms.rb: + last_write_checksum: sha1:abdf6ac3e248f6a13de6261ec6fc13cfe6a95b43 + lib/moderation_api/models/operations/illicit_firearms.rbi: + last_write_checksum: sha1:11ca8586ad9b3a451beeb59d0da94fb7248438b6 + lib/moderation_api/models/operations/illicit_gambling.rb: + last_write_checksum: sha1:e87f1d3c32510aad49e0e6e302f778a8bf9b26d5 + lib/moderation_api/models/operations/illicit_gambling.rbi: + last_write_checksum: sha1:e853c55db082c6371045f34d9d6a0bc1a1abb131 + lib/moderation_api/models/operations/illicit_tobacco.rb: + last_write_checksum: sha1:bf7ca5a1b525fa642dd163ff739cf914318c9851 + lib/moderation_api/models/operations/illicit_tobacco.rbi: + last_write_checksum: sha1:16fd9e0cda672a610afd49676f0677f6a359f8ac + lib/moderation_api/models/operations/image_request.rb: + last_write_checksum: sha1:9e4a616634badff1b45774931365e868ea1bf2f3 + lib/moderation_api/models/operations/image_request.rbi: + last_write_checksum: sha1:b82aa68e70d30e5df9efb47c005b98522f9ef0d8 + lib/moderation_api/models/operations/image_response.rb: + last_write_checksum: sha1:b09fc13ce13c4fc6c9518ddc4837c15fc3ec3b87 + lib/moderation_api/models/operations/image_response.rbi: + last_write_checksum: sha1:5d6e8aea39d1dfe7a98c6fa7005d133ba267f64f + lib/moderation_api/models/operations/insight.rb: + last_write_checksum: sha1:bcc77ba22cd729fd5555347267dbead601d60c43 + lib/moderation_api/models/operations/insight.rbi: + last_write_checksum: sha1:a83ac42a83389b6b85364edd536b2aecebaed387 + lib/moderation_api/models/operations/isflagged.rb: + last_write_checksum: sha1:292a325ffbd9a1199ca7b787702450fc5e68bcc7 + lib/moderation_api/models/operations/isflagged.rbi: + last_write_checksum: sha1:3ccad3ef23f6acc93164bf0670401d2701559e48 + lib/moderation_api/models/operations/language_insight.rb: + last_write_checksum: sha1:2321adc5fca35866046b419d7f48a6bc8d6e308b + lib/moderation_api/models/operations/language_insight.rbi: + last_write_checksum: sha1:085e3c0cd18d806676382dbe7b5c5b729e1667cb + lib/moderation_api/models/operations/listactions_data.rb: + last_write_checksum: sha1:c8dc8f04fe4169042359cea79909e81503005234 + lib/moderation_api/models/operations/listactions_data.rbi: + last_write_checksum: sha1:f9fcda7d608ecb053f116a147b372c468a1b17d8 + lib/moderation_api/models/operations/listactions_position.rb: + last_write_checksum: sha1:697dcc0026d928effca764ffafb15ce47f9a5410 + lib/moderation_api/models/operations/listactions_position.rbi: + last_write_checksum: sha1:cfb479d15e3490eabcd5ba402eab0495d384c1a6 + lib/moderation_api/models/operations/listactions_possiblevalue.rb: + last_write_checksum: sha1:108da70182554e4d673c379b439906dc61154f9b + lib/moderation_api/models/operations/listactions_possiblevalue.rbi: + last_write_checksum: sha1:059adb110a2fe7d3d5b6c0e245dd022c48baa1b3 + lib/moderation_api/models/operations/listactions_queuebehaviour.rb: + last_write_checksum: sha1:455bdd9aefa002356ef98f4789c940587fb4fa67 + lib/moderation_api/models/operations/listactions_queuebehaviour.rbi: + last_write_checksum: sha1:d6764692ddbd8f19451e8a1c08f44266b46b2ec3 + lib/moderation_api/models/operations/listactions_request.rb: + last_write_checksum: sha1:fc26d2f1106adc3a495672df766a060a01a6318b + lib/moderation_api/models/operations/listactions_request.rbi: + last_write_checksum: sha1:d51513303bca2d298d7a303f4fb6b15006259255 + lib/moderation_api/models/operations/listactions_response.rb: + last_write_checksum: sha1:ed6e3b428ea9954f35bfe0359e841720f6307d8b + lib/moderation_api/models/operations/listactions_response.rbi: + last_write_checksum: sha1:d49aabd013234a31c721a4dda175852c7a65ea30 + lib/moderation_api/models/operations/listactions_responsebody.rb: + last_write_checksum: sha1:a0cf5a2109ed4a02a779968aed2bbccc8333afd3 + lib/moderation_api/models/operations/listactions_responsebody.rbi: + last_write_checksum: sha1:fbc774f730f0ad0b71cacdccaf433eff2f130e37 + lib/moderation_api/models/operations/listactions_type.rb: + last_write_checksum: sha1:37a709d4106517963d744d19ce741c76624b6dd0 + lib/moderation_api/models/operations/listactions_type.rbi: + last_write_checksum: sha1:66c5ffe83807695824181754cf0d2fe709659f99 + lib/moderation_api/models/operations/listauthors_request.rb: + last_write_checksum: sha1:0e837626e310df7c6744741975896ba668070cc9 + lib/moderation_api/models/operations/listauthors_request.rbi: + last_write_checksum: sha1:54ae7332fdeeea02061588a7d9d6356c6fb4b064 + lib/moderation_api/models/operations/listauthors_response.rb: + last_write_checksum: sha1:5cfcfb662f34f24cd6ef58bead5d7a575570be65 + lib/moderation_api/models/operations/listauthors_response.rbi: + last_write_checksum: sha1:59eabe73fd87a16363150b2c8ede0c270cf701be + lib/moderation_api/models/operations/listauthors_responsebody.rb: + last_write_checksum: sha1:8bb151952da2daed0fc4d5a75802816dc7830b61 + lib/moderation_api/models/operations/listauthors_responsebody.rbi: + last_write_checksum: sha1:345e089adc3156cd22abe353c1a0ef35de224db9 + lib/moderation_api/models/operations/listauthors_sortdirection.rb: + last_write_checksum: sha1:3c8e607ea5639d8ca4800cb826d60daf6540ddca + lib/moderation_api/models/operations/listauthors_sortdirection.rbi: + last_write_checksum: sha1:8a3ba1e652ea22bb15f4bdee413087b88664e652 + lib/moderation_api/models/operations/listchannels_request.rb: + last_write_checksum: sha1:3fbbc71854b7cc8b9148e21b7c2bd204a0f10d81 + lib/moderation_api/models/operations/listchannels_request.rbi: + last_write_checksum: sha1:e075f41a229e09bbc0e8f42a076b6ff4d7c69850 + lib/moderation_api/models/operations/listchannels_response.rb: + last_write_checksum: sha1:77e980b756b34848ad434483f0f24fefc6232e3c + lib/moderation_api/models/operations/listchannels_response.rbi: + last_write_checksum: sha1:b31ac80fa9e51defff679423a9c05b160ad6b183 + lib/moderation_api/models/operations/listchannels_responsebody.rb: + last_write_checksum: sha1:c097fb945aa227325eb175b782e681341df7dc15 + lib/moderation_api/models/operations/listchannels_responsebody.rbi: + last_write_checksum: sha1:2f62e90ba10e566195dcbce297b9d0401af9d2e1 + lib/moderation_api/models/operations/listprojects_request.rb: + last_write_checksum: sha1:b8c9bcce5ae4b482c5804e3122e02f1162802e71 + lib/moderation_api/models/operations/listprojects_request.rbi: + last_write_checksum: sha1:a9f99ad70a20252e59acd00f99f5dcd69e84742e + lib/moderation_api/models/operations/listprojects_response.rb: + last_write_checksum: sha1:1fda9c230743054c4821c7f2d7bdfeb4f661c6b8 + lib/moderation_api/models/operations/listprojects_response.rbi: + last_write_checksum: sha1:a2a38f95136f1afcf5cc82a2ca96f2684e36e608 + lib/moderation_api/models/operations/listprojects_responsebody.rb: + last_write_checksum: sha1:66bc1a4f4f96d504956d5915f95f70de4d12dabe + lib/moderation_api/models/operations/listprojects_responsebody.rbi: + last_write_checksum: sha1:086aa49b3877f7f03db28e4ba53dc4a0e5e77560 + lib/moderation_api/models/operations/listqueueitems_action.rb: + last_write_checksum: sha1:0716fad123e56f3df10f23089e107e4f036e187c + lib/moderation_api/models/operations/listqueueitems_action.rbi: + last_write_checksum: sha1:52f90ec4a1333099270063c3588f9dd1261775b7 + lib/moderation_api/models/operations/listqueueitems_data.rb: + last_write_checksum: sha1:c9ecbb98123d298e5b0dc87508b2f426e1d693e3 + lib/moderation_api/models/operations/listqueueitems_data.rbi: + last_write_checksum: sha1:0bafaf656618270323373041ba0c51301d72bdca + lib/moderation_api/models/operations/listqueueitems_label.rb: + last_write_checksum: sha1:848b005d31d3079ab16ffa638b9392705dc28669 + lib/moderation_api/models/operations/listqueueitems_label.rbi: + last_write_checksum: sha1:83d777ef7ae4c7839fc6138384dbbb56f0fd3e08 + lib/moderation_api/models/operations/listqueueitems_request.rb: + last_write_checksum: sha1:78dbcc950eec059116af7bef3abed196e1143a47 + lib/moderation_api/models/operations/listqueueitems_request.rbi: + last_write_checksum: sha1:1b983600092e467f3a744f6dedb7083ab57e6578 + lib/moderation_api/models/operations/listqueueitems_response.rb: + last_write_checksum: sha1:1dbdccc4868d6177bfd8d85b16ade10ceca76f7f + lib/moderation_api/models/operations/listqueueitems_response.rbi: + last_write_checksum: sha1:286a580b1403f6eb19727f52fdafb1d8e484dd26 + lib/moderation_api/models/operations/listqueueitems_responsebody.rb: + last_write_checksum: sha1:da3f8e3585f94a6c8080b1fc4e805f4e9d0ef655 + lib/moderation_api/models/operations/listqueueitems_responsebody.rbi: + last_write_checksum: sha1:7c9215e07da136ebf95a98f6780c681727875cf2 + lib/moderation_api/models/operations/listqueueitems_sortdirection.rb: + last_write_checksum: sha1:21aef73dfeed3e90b4d827e4f84cd8c343629f49 + lib/moderation_api/models/operations/listqueueitems_sortdirection.rbi: + last_write_checksum: sha1:95773e200f152bf72ee802385b4e31c897391db0 + lib/moderation_api/models/operations/listqueueitems_status.rb: + last_write_checksum: sha1:2c11c87320efe5a695fcd1150991f09cd8fe52a3 + lib/moderation_api/models/operations/listqueueitems_status.rbi: + last_write_checksum: sha1:9bb588ba2eeaecf8f72f14f078417c3b983d6e5d + lib/moderation_api/models/operations/listwebhooks_data.rb: + last_write_checksum: sha1:090c5e0317c4b2d5578d90bf8b327845cc2202fa + lib/moderation_api/models/operations/listwebhooks_data.rbi: + last_write_checksum: sha1:cbe1219a63dd21e8d55d8cd39e65203ece651875 + lib/moderation_api/models/operations/listwebhooks_eventtype.rb: + last_write_checksum: sha1:c07f1ff0320b2e927c3343491d3d77d51d7fd715 + lib/moderation_api/models/operations/listwebhooks_eventtype.rbi: + last_write_checksum: sha1:fbdc0749bd8c67c937c862a46cad6b8633359537 + lib/moderation_api/models/operations/listwebhooks_payloadversion.rb: + last_write_checksum: sha1:8cb1f2f7f216821ced3619b9462b84e4e4552e46 + lib/moderation_api/models/operations/listwebhooks_payloadversion.rbi: + last_write_checksum: sha1:c2e21de84fb31da5f26358faac088e192dd9d97c + lib/moderation_api/models/operations/listwebhooks_request.rb: + last_write_checksum: sha1:ca01cb3006143e3082e2745de5747836726e6da6 + lib/moderation_api/models/operations/listwebhooks_request.rbi: + last_write_checksum: sha1:a6c313c406fd5a356c3042e3568c194542131a53 + lib/moderation_api/models/operations/listwebhooks_response.rb: + last_write_checksum: sha1:fdb790a1bb0138145237318ad691928a69ee5483 + lib/moderation_api/models/operations/listwebhooks_response.rbi: + last_write_checksum: sha1:420f3ca9b01c43e2466c84d2a918bfd5d840adf6 + lib/moderation_api/models/operations/listwebhooks_responsebody.rb: + last_write_checksum: sha1:5509387a40fdec6edd7d5bdf2a87253002040de9 + lib/moderation_api/models/operations/listwebhooks_responsebody.rbi: + last_write_checksum: sha1:1c9b8dd4427e96fc375e40dc681f13b1c0f9b269 + lib/moderation_api/models/operations/listwordlists_data.rb: + last_write_checksum: sha1:7d006801aa8cd3b3b4c2af319993e57455d34f9c + lib/moderation_api/models/operations/listwordlists_data.rbi: + last_write_checksum: sha1:af42bf5e255857f2eb738670969b63c1cf5df9cb + lib/moderation_api/models/operations/listwordlists_request.rb: + last_write_checksum: sha1:eae93f932ade11ec153d97538b2583332a36abc4 + lib/moderation_api/models/operations/listwordlists_request.rbi: + last_write_checksum: sha1:fe2c9e36e5c343909ddbcb28deaad5053e0bf3e1 + lib/moderation_api/models/operations/listwordlists_response.rb: + last_write_checksum: sha1:f4f343b64de5e2fc13aeb8a1e2945c41534d99d8 + lib/moderation_api/models/operations/listwordlists_response.rbi: + last_write_checksum: sha1:8fd261cd9bc9172b28b42a051167bcf78cb89c84 + lib/moderation_api/models/operations/listwordlists_responsebody.rb: + last_write_checksum: sha1:9a98dfde218a664b75dc931ce797363c8a4db72c + lib/moderation_api/models/operations/listwordlists_responsebody.rbi: + last_write_checksum: sha1:a08658556fd4b2d552b5b328b209beaf592d6152 + lib/moderation_api/models/operations/low_quality_content.rb: + last_write_checksum: sha1:8b299bfad25efcfea8f5855c24d3cf984ae65360 + lib/moderation_api/models/operations/low_quality_content.rbi: + last_write_checksum: sha1:b26f2bb45a529c2d5dba9faf2f031b69a04631e8 + lib/moderation_api/models/operations/match.rb: + last_write_checksum: sha1:1a8f17d7d93775bada8506b73d70f31d9936b278 + lib/moderation_api/models/operations/match.rbi: + last_write_checksum: sha1:4f1d11fa11d1de9008b293f514b64aa060a485bd + lib/moderation_api/models/operations/matched_rule.rb: + last_write_checksum: sha1:5e958e95ee4d22ec6e7b1863ef2688158f45151f + lib/moderation_api/models/operations/matched_rule.rbi: + last_write_checksum: sha1:cf7529e1270941ef1b1de6fdf0847f1413ef6def + lib/moderation_api/models/operations/mediatype.rb: + last_write_checksum: sha1:acd09b23b6ac7995caf3e688fd9cc0f8730c7b27 + lib/moderation_api/models/operations/mediatype.rbi: + last_write_checksum: sha1:e50f22220fdb2659b4029c837574bd19b90f6f74 + lib/moderation_api/models/operations/meta.rb: + last_write_checksum: sha1:85253b83e34e6d8e926859c1768aff206c5f9385 + lib/moderation_api/models/operations/meta.rbi: + last_write_checksum: sha1:639b38b8e7ac0f61f9b510de4a60f1dd56a03d30 + lib/moderation_api/models/operations/meta_status.rb: + last_write_checksum: sha1:00c5da68261f22bd2148c22aa160776460a945a0 + lib/moderation_api/models/operations/meta_status.rbi: + last_write_checksum: sha1:ce915dd40454838de0ab7f346c810abff3203a4f + lib/moderation_api/models/operations/metadatafilter.rb: + last_write_checksum: sha1:9c653f80f8d0088d6a195a8d4f6c15010f14c5b3 + lib/moderation_api/models/operations/metadatafilter.rbi: + last_write_checksum: sha1:3a9f220bac160938174a18c22f84def23e6ae40b + lib/moderation_api/models/operations/metatype.rb: + last_write_checksum: sha1:7b1037d7c18e66f31eac5633380376a8a38cb837 + lib/moderation_api/models/operations/metatype.rbi: + last_write_checksum: sha1:862ad541125b06987dd3a1b2ff4ed35dcf5d7ec4 + lib/moderation_api/models/operations/method.rb: + last_write_checksum: sha1:b422dbde326eb0ef66773692e8d140e679c60248 + lib/moderation_api/models/operations/method.rbi: + last_write_checksum: sha1:27640bc04418a0c92ec8011d620d8ec55a5b446c + lib/moderation_api/models/operations/modified.rb: + last_write_checksum: sha1:3958f21d352e46d6b0772d2507e304e46293d85e + lib/moderation_api/models/operations/modified.rbi: + last_write_checksum: sha1:cc8cad1d19bed1c1d08fe199cbf0af9b9f3b1870 + lib/moderation_api/models/operations/object.rb: + last_write_checksum: sha1:f9f1d1edab1b232ce45a7a0279aa75c8d60fe738 + lib/moderation_api/models/operations/object.rbi: + last_write_checksum: sha1:e5106ff5f6e78741a011758a2ca6685c83e46673 + lib/moderation_api/models/operations/personal_information.rb: + last_write_checksum: sha1:85f7e39915efdff98cb4816730c989d671fca26b + lib/moderation_api/models/operations/personal_information.rbi: + last_write_checksum: sha1:d3bc1e75aa5308dc426e670e7823b01473187499 + lib/moderation_api/models/operations/personal_story_insight.rb: + last_write_checksum: sha1:c9fed0ca42cdcd2a3344fec177f2976c017f1f68 + lib/moderation_api/models/operations/personal_story_insight.rbi: + last_write_checksum: sha1:b798d20d1ac5153ffb2db25b5a584948f9e540e6 + lib/moderation_api/models/operations/pii_masking.rb: + last_write_checksum: sha1:2da4d827b3ff7d3241fc3a3ac1ed98ccc8e78a39 + lib/moderation_api/models/operations/pii_masking.rbi: + last_write_checksum: sha1:daf3e037453476b483231b8e75026b81977d89c9 + lib/moderation_api/models/operations/policy_request.rb: + last_write_checksum: sha1:80a9ae7fd8d58b4219a05a14bd672a4c92bfefb9 + lib/moderation_api/models/operations/policy_request.rbi: + last_write_checksum: sha1:0d95f3f2100a2c855f8d8a5129d1646e25e62dae + lib/moderation_api/models/operations/policy_response.rb: + last_write_checksum: sha1:1a7685017a3129cf4cd023b9122b42f6157e0b2d + lib/moderation_api/models/operations/policy_response.rbi: + last_write_checksum: sha1:02aecee4d8d450b5d647be29629f27b7f0789b71 + lib/moderation_api/models/operations/political.rb: + last_write_checksum: sha1:69fb50a50b1f499cf8930e4b380ed95fd53c1754 + lib/moderation_api/models/operations/political.rbi: + last_write_checksum: sha1:7370ef4479a98c5699b32b4b9f4048fdbb9bdf15 + lib/moderation_api/models/operations/profanity.rb: + last_write_checksum: sha1:6baa89c05b003a8dd46216fbb55b51df38993a0f + lib/moderation_api/models/operations/profanity.rbi: + last_write_checksum: sha1:b4a5d462e55fbd1a491d304c0c1acf5591db21e6 + lib/moderation_api/models/operations/promotion.rb: + last_write_checksum: sha1:dba40574091ce031aeb2266baf6b1c695ac74e2e + lib/moderation_api/models/operations/promotion.rbi: + last_write_checksum: sha1:dc22e906ea5dbb88989fdcfc509228a0c979fc70 + lib/moderation_api/models/operations/queue.rb: + last_write_checksum: sha1:ce7ac1135b6f0b1ac52e7935e069f912fb575ed1 + lib/moderation_api/models/operations/queue.rbi: + last_write_checksum: sha1:e84b3dd15116bebf018b74f8fcde2eda821e3dc5 + lib/moderation_api/models/operations/reason_code.rb: + last_write_checksum: sha1:18ec89ea39b92e87649c52eee54c72347b04a5c5 + lib/moderation_api/models/operations/reason_code.rbi: + last_write_checksum: sha1:8c05354a507c744398b72566e6a2bd875a5b3a86 + lib/moderation_api/models/operations/reason_code_enum.rb: + last_write_checksum: sha1:2f072e021b670d199b749c14eaced49cfa5f7eba + lib/moderation_api/models/operations/reason_code_enum.rbi: + last_write_checksum: sha1:b8bb8e9df36accaf7d3856b586c46d7f68bb7455 + lib/moderation_api/models/operations/recommendation.rb: + last_write_checksum: sha1:e5231948d3f23620e5c7d18be7ddb5eacb7429d2 + lib/moderation_api/models/operations/recommendation.rbi: + last_write_checksum: sha1:20a88cdefbd0d8599acb625e728c9ce459fb2b27 + lib/moderation_api/models/operations/religion.rb: + last_write_checksum: sha1:f413eaedc03cf11bebefb587ffbe3e9dd4ea521e + lib/moderation_api/models/operations/religion.rbi: + last_write_checksum: sha1:879ecea96ee34baca3a0cf1d8c5f1f71cd09c42f + lib/moderation_api/models/operations/removewordlistwords_request.rb: + last_write_checksum: sha1:84486be04fe8f6a49286082caa4c3cadba26e7a8 + lib/moderation_api/models/operations/removewordlistwords_request.rbi: + last_write_checksum: sha1:eab0b511f75ed228bd77e324867e5f5563e7fb59 + lib/moderation_api/models/operations/removewordlistwords_response.rb: + last_write_checksum: sha1:cc044b603654e01f48a343f041ef9ed49656055e + lib/moderation_api/models/operations/removewordlistwords_response.rbi: + last_write_checksum: sha1:570363ff5c95899430b88ed0b8c059249aaaee98 + lib/moderation_api/models/operations/removewordlistwords_responsebody.rb: + last_write_checksum: sha1:6eced73d273b24e1a4a13e531e85de16fe83c85a + lib/moderation_api/models/operations/removewordlistwords_responsebody.rbi: + last_write_checksum: sha1:356759040681697022af0658456acc63000fd0dc + lib/moderation_api/models/operations/resolvequeueitem_request.rb: + last_write_checksum: sha1:ba417596b06ef4c84cfdd087035b380a085e4d42 + lib/moderation_api/models/operations/resolvequeueitem_request.rbi: + last_write_checksum: sha1:5efc70f0fae264e79bf8884412197a5aa367c4fe + lib/moderation_api/models/operations/resolvequeueitem_requestbody.rb: + last_write_checksum: sha1:b4869b07ac0e9f8d146828388cab29da8b4cb40e + lib/moderation_api/models/operations/resolvequeueitem_requestbody.rbi: + last_write_checksum: sha1:b848b26f1c0c45181ddee9d6c4ade9c6495b2139 + lib/moderation_api/models/operations/resolvequeueitem_response.rb: + last_write_checksum: sha1:d7ba70e342c3abc851dea6a3032a8c82b32776f9 + lib/moderation_api/models/operations/resolvequeueitem_response.rbi: + last_write_checksum: sha1:d6fe166955e11d85c1acd2e5145e33f73c9852d0 + lib/moderation_api/models/operations/resolvequeueitem_responsebody.rb: + last_write_checksum: sha1:feb1fa0eeb71198d56cafd9ef27875f747f3617a + lib/moderation_api/models/operations/resolvequeueitem_responsebody.rbi: + last_write_checksum: sha1:54d3b9438f58a8bffce4f0c453529cc49be5552c + lib/moderation_api/models/operations/respect_insight.rb: + last_write_checksum: sha1:c1d98e49a2613384ed077fb7a1a3990dedadf81f + lib/moderation_api/models/operations/respect_insight.rbi: + last_write_checksum: sha1:483c04d8cc88dc02461c275ba4d594535cc50582 + lib/moderation_api/models/operations/reviewstats.rb: + last_write_checksum: sha1:e3df90b4b61ede333bd652eb230dbee6cd24aba7 + lib/moderation_api/models/operations/reviewstats.rbi: + last_write_checksum: sha1:f4f1a2b7aa7398fc52e97996678f7d824072b11a + lib/moderation_api/models/operations/scores.rb: + last_write_checksum: sha1:a9842bfc24dd3f9db22739a2ae31be7023fba8ae + lib/moderation_api/models/operations/scores.rbi: + last_write_checksum: sha1:21d9a78f8eb47e2dc621e27e6176f52b33406f2a + lib/moderation_api/models/operations/self_harm.rb: + last_write_checksum: sha1:bfa76d87aa06ba91acc7fbdb42c0c8d3c4ca9f56 + lib/moderation_api/models/operations/self_harm.rbi: + last_write_checksum: sha1:1c9877f8f06f256a4e484a2c0ba572c281d0e0c6 + lib/moderation_api/models/operations/self_promotion.rb: + last_write_checksum: sha1:af838761776ea3449215a6e075e78d543f03b549 + lib/moderation_api/models/operations/self_promotion.rbi: + last_write_checksum: sha1:b4a9b0699be9f368d4f76d32e3afa0cd7a3c6136 + lib/moderation_api/models/operations/sentiment_insight.rb: + last_write_checksum: sha1:38fa94ed88ba851c0a4bf15372260d79f42d88ab + lib/moderation_api/models/operations/sentiment_insight.rbi: + last_write_checksum: sha1:02c2f64fc707b279af7068aa46eb65abb6e6bee4 + lib/moderation_api/models/operations/sexual.rb: + last_write_checksum: sha1:1f661af79a38490412eb8301dccded4d0c2b8557 + lib/moderation_api/models/operations/sexual.rbi: + last_write_checksum: sha1:954914414b0094d214ffa3d86a630eb8aee8fd0f + lib/moderation_api/models/operations/sexual_minors.rb: + last_write_checksum: sha1:b0008ecf4d9e6229a975ef1df933db0c672eb77d + lib/moderation_api/models/operations/sexual_minors.rbi: + last_write_checksum: sha1:379ecaffc06def374e29e5b22ce3e010d80ac4f5 + lib/moderation_api/models/operations/sexual_solicitation.rb: + last_write_checksum: sha1:121aea908da1e3029eaf9349e9e0d12b18ccd5f0 + lib/moderation_api/models/operations/sexual_solicitation.rbi: + last_write_checksum: sha1:d58d52e847bd96aefe5f9dca85fd4bd517968e19 + lib/moderation_api/models/operations/signals_request.rb: + last_write_checksum: sha1:6b59efe3ae211fef3f2c70e6b8f53bb2315604e3 + lib/moderation_api/models/operations/signals_request.rbi: + last_write_checksum: sha1:876fadbe182967227bbf3bd734c44f1b8e273b38 + lib/moderation_api/models/operations/signals_response.rb: + last_write_checksum: sha1:b06362c298cf15edbf1db019e1672d6468b52ada + lib/moderation_api/models/operations/signals_response.rbi: + last_write_checksum: sha1:940bd85b83ca55cde1d96a9ebb6b8b48505cc75f + lib/moderation_api/models/operations/sortby.rb: + last_write_checksum: sha1:149e53d9b44fdba00fe3b9564a0bbfe48c87c096 + lib/moderation_api/models/operations/sortby.rbi: + last_write_checksum: sha1:72f9e71673cbb31e677d6f5a2f4e4809b42d7eee + lib/moderation_api/models/operations/sortfield.rb: + last_write_checksum: sha1:f15cd97b1fcd4be016ce93398412892a852ea800 + lib/moderation_api/models/operations/sortfield.rbi: + last_write_checksum: sha1:4bc422e5253ff1e111742d265831b1980ced2eb9 + lib/moderation_api/models/operations/spam.rb: + last_write_checksum: sha1:485e38cfed615e41d3360810c4c47869c200ab90 + lib/moderation_api/models/operations/spam.rbi: + last_write_checksum: sha1:952869b546993fffd43baff63033fec74e2222f9 + lib/moderation_api/models/operations/submitcontent_label.rb: + last_write_checksum: sha1:b24c7a6a41f3c8c7eab9065e3ca41b2cdf3e2fd1 + lib/moderation_api/models/operations/submitcontent_label.rbi: + last_write_checksum: sha1:48821b6994625e619f429dc6772c7385fa934234 + lib/moderation_api/models/operations/submitcontent_recommendation_action.rb: + last_write_checksum: sha1:24f306a3d08adf91246b0a75ed7b3481ea1330a7 + lib/moderation_api/models/operations/submitcontent_recommendation_action.rbi: + last_write_checksum: sha1:5d19a64d3e146b8ec755d4cc48f0dd3a8753c5b6 + lib/moderation_api/models/operations/submitcontent_request.rb: + last_write_checksum: sha1:4f699149c1dc50b50d1ae11a9aed4f5b02163b34 + lib/moderation_api/models/operations/submitcontent_request.rbi: + last_write_checksum: sha1:43687c98c8281c611f26cd9118f4e116e5d6f334 + lib/moderation_api/models/operations/submitcontent_response.rb: + last_write_checksum: sha1:3029db8f04ceb75f80f33034573e4639b8468274 + lib/moderation_api/models/operations/submitcontent_response.rbi: + last_write_checksum: sha1:0492b2ded4b334a3d9fe57d6d32a7b374ff00bbc + lib/moderation_api/models/operations/submitcontent_responsebody.rb: + last_write_checksum: sha1:eb4cfbf580fb5333aea1492553daf279db1efcff + lib/moderation_api/models/operations/submitcontent_responsebody.rbi: + last_write_checksum: sha1:e0fabb1cacec37c365400b79867ae09b48112717 + lib/moderation_api/models/operations/text_request.rb: + last_write_checksum: sha1:d8ca25b0e420051d42bda6bc462f628369aef3c5 + lib/moderation_api/models/operations/text_request.rbi: + last_write_checksum: sha1:48d12e1f0fe9835b6bf55aded1dd6a1f3f53499c + lib/moderation_api/models/operations/text_response.rb: + last_write_checksum: sha1:9f468d47dd7ff88da4d8134e19d5738511bc2c62 + lib/moderation_api/models/operations/text_response.rbi: + last_write_checksum: sha1:4ee5b9f4d7562b6b79cb981cce960596337da269 + lib/moderation_api/models/operations/threat.rb: + last_write_checksum: sha1:a22e149e8471f5c88ba5fa40c265cd3e65a1f545 + lib/moderation_api/models/operations/threat.rbi: + last_write_checksum: sha1:b3f729cbc1cbe52246b644afdeb0a352aa7afe5f + lib/moderation_api/models/operations/tobacco.rb: + last_write_checksum: sha1:a5a7c5c54264e034d9c9935710e5843dfc4faac9 + lib/moderation_api/models/operations/tobacco.rbi: + last_write_checksum: sha1:9ea13e6ff7f9b9fe8ab4de91c1305a20928e8244 + lib/moderation_api/models/operations/topaction.rb: + last_write_checksum: sha1:c56f1a509d90cddccb32ae5d5aecfc830ef6f223 + lib/moderation_api/models/operations/topaction.rbi: + last_write_checksum: sha1:a52597ca3e1fff736ee9a7e4baa0b88f94787887 + lib/moderation_api/models/operations/topic.rb: + last_write_checksum: sha1:25ed0d7ade8b598a0d1fa73606072643f3b25aad + lib/moderation_api/models/operations/topic.rbi: + last_write_checksum: sha1:95ec31c3964a81205e4e8908367ce7cb946bb455 + lib/moderation_api/models/operations/topreviewer.rb: + last_write_checksum: sha1:e43c294cd28184439d957404b087e43e812b96e2 + lib/moderation_api/models/operations/topreviewer.rbi: + last_write_checksum: sha1:40ff8c42484b5a26a64715048005ad95ea3e513c + lib/moderation_api/models/operations/toxicity.rb: + last_write_checksum: sha1:ef7d39491211cf583f145bf73c73eaedd0f37f0c + lib/moderation_api/models/operations/toxicity.rbi: + last_write_checksum: sha1:453b97e39685048b8ac4489764b31abcce44d529 + lib/moderation_api/models/operations/transcriptionquality.rb: + last_write_checksum: sha1:84db0f70a44da78cb649116cbca7b015d9f1d356 + lib/moderation_api/models/operations/transcriptionquality.rbi: + last_write_checksum: sha1:9f3613403af81df0fb32b103549c3a800225742f + lib/moderation_api/models/operations/trends.rb: + last_write_checksum: sha1:c1718c068b971d09c3d1c9e2d2c715cd25268c75 + lib/moderation_api/models/operations/trends.rbi: + last_write_checksum: sha1:17292713470a7312a7357351e10c7dfacd3fd009 + lib/moderation_api/models/operations/trust_level.rb: + last_write_checksum: sha1:c059f420bb935dfe26e632b2f5d98ffb7139264b + lib/moderation_api/models/operations/trust_level.rbi: + last_write_checksum: sha1:851cc3b44b9bc61eefc82aa80e238a54766c3185 + lib/moderation_api/models/operations/unicode_spoofing.rb: + last_write_checksum: sha1:0727fb610bfaa91f2a8dab9edc155cfd097d4a21 + lib/moderation_api/models/operations/unicode_spoofing.rbi: + last_write_checksum: sha1:7656bced8fbc58bd5d5acd35faf840f724c02f2f + lib/moderation_api/models/operations/unresolvequeueitem_request.rb: + last_write_checksum: sha1:296429b92295622e1d69e93b1fe9df22834ab505 + lib/moderation_api/models/operations/unresolvequeueitem_request.rbi: + last_write_checksum: sha1:db2170c43aa9acdb4bba2800ff0b3c8d673cd707 + lib/moderation_api/models/operations/unresolvequeueitem_requestbody.rb: + last_write_checksum: sha1:5abd72cc8d7303023982e8ba5815e58b6170c071 + lib/moderation_api/models/operations/unresolvequeueitem_requestbody.rbi: + last_write_checksum: sha1:ff251d771ffcd731b5a3b7d0315a6163d0b44bba + lib/moderation_api/models/operations/unresolvequeueitem_response.rb: + last_write_checksum: sha1:ae8032f3b043c7921c63329e0e4eaf77186e0a45 + lib/moderation_api/models/operations/unresolvequeueitem_response.rbi: + last_write_checksum: sha1:9f38a0871546343af346d4bc6cc2e8426cc5287d + lib/moderation_api/models/operations/unresolvequeueitem_responsebody.rb: + last_write_checksum: sha1:592f673944089e616126996080191df6aa87fe43 + lib/moderation_api/models/operations/unresolvequeueitem_responsebody.rbi: + last_write_checksum: sha1:a1306d5c1ced8b55071685fbf4346b9cc76698fa + lib/moderation_api/models/operations/updateaction_position_request.rb: + last_write_checksum: sha1:faff2a83b619c39bef97092632139631a74b2b75 + lib/moderation_api/models/operations/updateaction_position_request.rbi: + last_write_checksum: sha1:68563efc629dbe2e6a3b7bf7d3fdf5b7c3698080 + lib/moderation_api/models/operations/updateaction_position_response.rb: + last_write_checksum: sha1:8c3abe4a5875dd635ff9cdd51c3a01bdaa14873a + lib/moderation_api/models/operations/updateaction_position_response.rbi: + last_write_checksum: sha1:52e9c0c6b8d554093f7aa853a412f37f6f065a4a + lib/moderation_api/models/operations/updateaction_possiblevalue_request.rb: + last_write_checksum: sha1:161d96a9314480a96f389b21a4075ea1cd0721d2 + lib/moderation_api/models/operations/updateaction_possiblevalue_request.rbi: + last_write_checksum: sha1:1e466a1cbd82b9d803cb3d110669edc32be15844 + lib/moderation_api/models/operations/updateaction_possiblevalue_response.rb: + last_write_checksum: sha1:abb69029b428d57e274f91e03e37a7ca54976a5d + lib/moderation_api/models/operations/updateaction_possiblevalue_response.rbi: + last_write_checksum: sha1:6ec348b4f907ac33d6119c93fcf2104e2abad465 + lib/moderation_api/models/operations/updateaction_queuebehaviour_request.rb: + last_write_checksum: sha1:4ff0bc1ef694fffd47022a4c2dabde7260d514b7 + lib/moderation_api/models/operations/updateaction_queuebehaviour_request.rbi: + last_write_checksum: sha1:7b0cd4c42b07039bcb88dac083963e8ea62b421c + lib/moderation_api/models/operations/updateaction_queuebehaviour_response.rb: + last_write_checksum: sha1:035923ec399c8497d99f2863c0d2b3ee7d2528b1 + lib/moderation_api/models/operations/updateaction_queuebehaviour_response.rbi: + last_write_checksum: sha1:fcf4ef617b2df643481b62f4f12bdfdbb6ad85bf + lib/moderation_api/models/operations/updateaction_request.rb: + last_write_checksum: sha1:ad1caf0b73322633b5a6dbf42a483463f1c4e06a + lib/moderation_api/models/operations/updateaction_request.rbi: + last_write_checksum: sha1:76ce102b12d37d0a8f200514ccea15f0d8d4b3b5 + lib/moderation_api/models/operations/updateaction_requestbody.rb: + last_write_checksum: sha1:6afea12f92cbc6f21f282032a6f6799b78cee47b + lib/moderation_api/models/operations/updateaction_requestbody.rbi: + last_write_checksum: sha1:3fd871037afea913af54a323a932c982ed5c554b + lib/moderation_api/models/operations/updateaction_response.rb: + last_write_checksum: sha1:16f7dce2118e662b941552a1e5301a0941f4b0ce + lib/moderation_api/models/operations/updateaction_response.rbi: + last_write_checksum: sha1:75f82000514077533f67d13d37817b84e55eeaf7 + lib/moderation_api/models/operations/updateaction_responsebody.rb: + last_write_checksum: sha1:bf03ee924fa0fd6028f1d3f949f065827256cba4 + lib/moderation_api/models/operations/updateaction_responsebody.rbi: + last_write_checksum: sha1:dd513260973cf53c5fad26b30322047b96de93fa + lib/moderation_api/models/operations/updateaction_type_request.rb: + last_write_checksum: sha1:7f28609cdede1bc53681cf474fdd60b770d0c126 + lib/moderation_api/models/operations/updateaction_type_request.rbi: + last_write_checksum: sha1:769b78b1e1a7148ee2f93b81399dd19107217bec + lib/moderation_api/models/operations/updateaction_type_response.rb: + last_write_checksum: sha1:4b48bf2a7109d7e5a3d537fc2b1e217e93a993d1 + lib/moderation_api/models/operations/updateaction_type_response.rbi: + last_write_checksum: sha1:4dc5ac2510454c09eb5c63f255185073cc5b08cd + lib/moderation_api/models/operations/updateauthor_metadata.rb: + last_write_checksum: sha1:24360a5b686bce121d87286fa27d8f964e1ec41e + lib/moderation_api/models/operations/updateauthor_metadata.rbi: + last_write_checksum: sha1:7ca981866b53c4f7d35053bb4364138553074e25 + lib/moderation_api/models/operations/updateauthor_request.rb: + last_write_checksum: sha1:3aeb4235c0047518041bd23b394edcd06e129743 + lib/moderation_api/models/operations/updateauthor_request.rbi: + last_write_checksum: sha1:4bd392cd8a4c1241f7fa5913fcfddbe08766219f + lib/moderation_api/models/operations/updateauthor_requestbody.rb: + last_write_checksum: sha1:0ee72aa167f4c71c99a01757b36240bab84c1c4f + lib/moderation_api/models/operations/updateauthor_requestbody.rbi: + last_write_checksum: sha1:50ad53105ec050b48a8fe755357569cb2ac536ac + lib/moderation_api/models/operations/updateauthor_response.rb: + last_write_checksum: sha1:4829a5c9f7feedaa149733312316fd05f9010ad5 + lib/moderation_api/models/operations/updateauthor_response.rbi: + last_write_checksum: sha1:7cb514cce2c77c222712313f843159a0c689fd84 + lib/moderation_api/models/operations/updatechannel_contenttype.rb: + last_write_checksum: sha1:a40c527daf5ba4100023c6a441674ae2dfbeb571 + lib/moderation_api/models/operations/updatechannel_contenttype.rbi: + last_write_checksum: sha1:be5e86fa694b6c309afd27f953b011e79145a2d7 + lib/moderation_api/models/operations/updatechannel_request.rb: + last_write_checksum: sha1:c6b8821282f497e33195b5a9bca9659c5432bbfc + lib/moderation_api/models/operations/updatechannel_request.rbi: + last_write_checksum: sha1:271605d020f2d96c5540400768d78e8babc2a3a3 + lib/moderation_api/models/operations/updatechannel_requestbody.rb: + last_write_checksum: sha1:9ce648647c752e5907e4d33e6030450754eeea82 + lib/moderation_api/models/operations/updatechannel_requestbody.rbi: + last_write_checksum: sha1:a5a35eb11d08091c279d7314dbb03802987a65d2 + lib/moderation_api/models/operations/updatechannel_response.rb: + last_write_checksum: sha1:dcd0aedcc34b440694785d076c333e08da0a5393 + lib/moderation_api/models/operations/updatechannel_response.rbi: + last_write_checksum: sha1:f756ee7b848740987302203048250b8aea44ef70 + lib/moderation_api/models/operations/updateproject_request.rb: + last_write_checksum: sha1:d0dfb056b03d03cf32af43f398f3d819eb19127f + lib/moderation_api/models/operations/updateproject_request.rbi: + last_write_checksum: sha1:7d93651f1823badd27061d8a237ee433038c7408 + lib/moderation_api/models/operations/updateproject_requestbody.rb: + last_write_checksum: sha1:652f19cf91490b3a7ac6ea90c725a38eb45539b8 + lib/moderation_api/models/operations/updateproject_requestbody.rbi: + last_write_checksum: sha1:9abef3a262d3868c2a0e4fa552ec2f1c5a694632 + lib/moderation_api/models/operations/updateproject_response.rb: + last_write_checksum: sha1:bd31f39fd8102603f15087ad1f88c6ec92433e8e + lib/moderation_api/models/operations/updateproject_response.rbi: + last_write_checksum: sha1:2b7e574b4e21dd122dfce393e64738b2ed150ef9 + lib/moderation_api/models/operations/updatewebhook_eventtype_request.rb: + last_write_checksum: sha1:1ad9fcd93d63a4ab56caac6694aa2a58ad78e82a + lib/moderation_api/models/operations/updatewebhook_eventtype_request.rbi: + last_write_checksum: sha1:5c0f66e2726f6bcb5725510fb0834c51e9c5cf89 + lib/moderation_api/models/operations/updatewebhook_eventtype_response.rb: + last_write_checksum: sha1:8cb4c7fe3ee8b7eaf49bee1d4b854a8c19e994a8 + lib/moderation_api/models/operations/updatewebhook_eventtype_response.rbi: + last_write_checksum: sha1:91b3e72d9dd5cdd6572b2bb282fa0d3d469df3f8 + lib/moderation_api/models/operations/updatewebhook_payloadversion.rb: + last_write_checksum: sha1:72ca2d313706c0bcf6ab6ed8c3f1122ad0a76950 + lib/moderation_api/models/operations/updatewebhook_payloadversion.rbi: + last_write_checksum: sha1:e290a3d66acbb9d0e7222ad1a8c553dded8dc137 + lib/moderation_api/models/operations/updatewebhook_request.rb: + last_write_checksum: sha1:c33fb4d9557560983f3e6b05dc09dbafba7a7ddd + lib/moderation_api/models/operations/updatewebhook_request.rbi: + last_write_checksum: sha1:7bbc89d33a6e4d28fc5e5350c8acfc9361d54227 + lib/moderation_api/models/operations/updatewebhook_requestbody.rb: + last_write_checksum: sha1:014e32b0b7a7b5d0eeb599051d276528baafa548 + lib/moderation_api/models/operations/updatewebhook_requestbody.rbi: + last_write_checksum: sha1:4be36cc776031854ee4baf549d4bda74711ea71d + lib/moderation_api/models/operations/updatewebhook_response.rb: + last_write_checksum: sha1:51afb8797b7f8ee1357786766c6836b802bda638 + lib/moderation_api/models/operations/updatewebhook_response.rbi: + last_write_checksum: sha1:1c62dc43a53d6a9b710c3ebcc111668a9bf5f4b6 + lib/moderation_api/models/operations/updatewebhook_responsebody.rb: + last_write_checksum: sha1:54881db450be984c3f43087875092918c2d2e63f + lib/moderation_api/models/operations/updatewebhook_responsebody.rbi: + last_write_checksum: sha1:64c63cab1792f0b0338902ba2956315e447b1e83 + lib/moderation_api/models/operations/updatewordlist_request.rb: + last_write_checksum: sha1:ee03cc65430eb26bd5826c43927543815092c489 + lib/moderation_api/models/operations/updatewordlist_request.rbi: + last_write_checksum: sha1:2186c460adb42d3bc2d6bd7fc395320cafdeec70 + lib/moderation_api/models/operations/updatewordlist_requestbody.rb: + last_write_checksum: sha1:7ec0910e339404fc82c78efd7b67dc0fde58e22e + lib/moderation_api/models/operations/updatewordlist_requestbody.rbi: + last_write_checksum: sha1:ec8647cb9817bf2a438f8842f872f6e372f33763 + lib/moderation_api/models/operations/updatewordlist_response.rb: + last_write_checksum: sha1:86776b2abd17b7046c317764aa52ede9f813d118 + lib/moderation_api/models/operations/updatewordlist_response.rbi: + last_write_checksum: sha1:bb936f71de0f231561b246b6d856bf44cc4dad59 + lib/moderation_api/models/operations/updatewordlist_responsebody.rb: + last_write_checksum: sha1:5fc9c53e0ec6a494dba5a6728a3a40fe5486aacf + lib/moderation_api/models/operations/updatewordlist_responsebody.rbi: + last_write_checksum: sha1:10882aa34ae3a6fe6e4759b2cf403daba8bbce08 + lib/moderation_api/models/operations/url_masking.rb: + last_write_checksum: sha1:653ac62579bb150139d8cd12a3d46dfae09690e6 + lib/moderation_api/models/operations/url_masking.rbi: + last_write_checksum: sha1:0932487538daa415033f25fe4136e9ef8c9802ee + lib/moderation_api/models/operations/url_risk.rb: + last_write_checksum: sha1:35a699052b18a90255ef55a89ccdf5df09c72b37 + lib/moderation_api/models/operations/url_risk.rbi: + last_write_checksum: sha1:0cc19c70fb2ab0309c0f16d47b20c229b891bfb0 + lib/moderation_api/models/operations/value.rb: + last_write_checksum: sha1:3d3164ecfa879c9e00cd89078335d71ed7d053aa + lib/moderation_api/models/operations/value.rbi: + last_write_checksum: sha1:9f00efcfa94c37dfa386e5b77eae5ee65564a55d + lib/moderation_api/models/operations/verdict.rb: + last_write_checksum: sha1:4f2192772691e1d1eeadd35956e92f54678f8121 + lib/moderation_api/models/operations/verdict.rbi: + last_write_checksum: sha1:d459112a21bd4f521f887d4cd69f0bd8065f3d3f + lib/moderation_api/models/operations/video_request.rb: + last_write_checksum: sha1:f7a8098cd4d9966447b7fdab5be1f795a9cc9315 + lib/moderation_api/models/operations/video_request.rbi: + last_write_checksum: sha1:15f237d3cf73b558165678507605ebe31b1382f6 + lib/moderation_api/models/operations/video_response.rb: + last_write_checksum: sha1:9b0cfad55dbbe8791108c269cc7f8c51203dc907 + lib/moderation_api/models/operations/video_response.rbi: + last_write_checksum: sha1:367897603960a66c00dc14f1b96de1a20efd2732 + lib/moderation_api/models/operations/violence.rb: + last_write_checksum: sha1:4d35b33ce7a1fba38d88eef3f967a80228c11285 + lib/moderation_api/models/operations/violence.rbi: + last_write_checksum: sha1:6dc6dbf9b319062d132a04d7574daf59e44c096f + lib/moderation_api/models/operations/weapons.rb: + last_write_checksum: sha1:909a3a92cae7ed09ce11e8b1f34c6de0e1f76350 + lib/moderation_api/models/operations/weapons.rbi: + last_write_checksum: sha1:4364de74124b139535fb707c2adc59b643a8aa40 + lib/moderation_api/models/operations/withinunit.rb: + last_write_checksum: sha1:6b4b0476c16d04d3939fb3565ad6fb644b5caad8 + lib/moderation_api/models/operations/withinunit.rbi: + last_write_checksum: sha1:f9b1959cccd494af9434c1f4645a6a5042f0733d + lib/moderation_api/moderationapi.rb: + last_write_checksum: sha1:fddb1b1ea02048b98a9d7c9db22c8e9fc87cba49 + lib/moderation_api/projects.rb: + last_write_checksum: sha1:1257d22a0c8172739041b3f86fa36a9347d747e5 + lib/moderation_api/queue.rb: + last_write_checksum: sha1:2e562d5891cc29e53618c0ddf19eb142af87489c + lib/moderation_api/sdk_hooks/hooks.rb: + last_write_checksum: sha1:5b983b37647a1a8a2c35dd4cd4bc68bbde83906f + lib/moderation_api/sdk_hooks/types.rb: + last_write_checksum: sha1:4c965332c50ba795946cf8df50a6202e89db0a45 + lib/moderation_api/sdkconfiguration.rb: + last_write_checksum: sha1:39164d01c276c1066afd589443e19e26bb2e10b9 + lib/moderation_api/sdkconfiguration.rbi: + last_write_checksum: sha1:0ff7c53716ae2b6668c84ad4f83b9a8697482c33 + lib/moderation_api/utils/forms.rb: + last_write_checksum: sha1:9e8bfbd371a8202d4009070f4ef988231239f9ea + lib/moderation_api/utils/headers.rb: + last_write_checksum: sha1:2ba91bc74f02809aedd80eda0d61999f94496e02 + lib/moderation_api/utils/query_params.rb: + last_write_checksum: sha1:e79c1c22e15e2aac61a2dfe44394623b843aa7e7 + lib/moderation_api/utils/request_bodies.rb: + last_write_checksum: sha1:0dc749aa4e33a62b125239514d299f271ff75259 + lib/moderation_api/utils/retries.rb: + last_write_checksum: sha1:8e11f1d0b74c87b6225275c5a7f9b2840a72e8cd + lib/moderation_api/utils/security.rb: + last_write_checksum: sha1:fd3839ddf8db01bf841a25bca4a422ddf6017156 + lib/moderation_api/utils/url.rb: + last_write_checksum: sha1:eee311ee6b7cb95cf6936fd5953d9cf1090dbfd2 + lib/moderation_api/utils/utils.rb: + last_write_checksum: sha1:3c34cf92cf1e72373dc5ea07493b6af559df8e4c + lib/moderation_api/webhooks.rb: + last_write_checksum: sha1:7f8e5738d0c40c2f101866b6c3c326c7b1ead192 + lib/moderation_api/webhooksecret.rb: + last_write_checksum: sha1:abe50afd77daec174c0c48b3675d1e0e48c05c8f + lib/moderation_api/wordlist.rb: + last_write_checksum: sha1:6c5b36ba48a0f4549fb9693f245e0e92f0408d25 + lib/moderation_api/words.rb: + last_write_checksum: sha1:a03506834e2710a829573b48f24a404a6828307a + moderation_api.gemspec: + last_write_checksum: sha1:975375ed18f35086a7e013e0b10f6a08276cc6fe + sorbet/config: + last_write_checksum: sha1:d02b32628dad70edc5929a9b9801d5e2dca15d40 + sorbet/rbi/annotations/.gitattributes: + last_write_checksum: sha1:c683580f06441d46622a00a7aac20eeefdae4087 + sorbet/rbi/gems/.gitattributes: + last_write_checksum: sha1:737a5b4c7736cfd651133334bf4cdfabbe78ac69 + sorbet/tapioca/config.yml: + last_write_checksum: sha1:0b9c1ef96625b48230f1e888e468628d36d9d287 + sorbet/tapioca/require.rb: + last_write_checksum: sha1:29b5fbd716704c2996f36f62fb32515705cfe56a +examples: + listAuthors: + speakeasy-default-list-authors: + parameters: + query: + page: 1 + pageSize: 20 + sortDirection: "desc" + responses: + "200": + application/json: {"data": [{"id": "", "first_seen": 4938.47, "last_seen": 5385.02, "status": "suspended", "trust_level": {"level": 3349.53, "manual": false}, "block": null, "risk_evaluation": {}, "metrics": {"total_content": 7036.05, "flagged_content": 1522.44}, "metadata": {}}], "pagination": {"page": 669906, "pageSize": 764456, "total": 2694, "totalPages": 420848, "hasMore": true}} + "400": + application/json: {"type": "invalid_request_error", "code": "invalid_request", "message": "Invalid input data", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://terrible-order.com/"} + "401": + application/json: {"type": "authentication_error", "code": "unauthorized", "message": "Authorization not provided", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://doting-creator.name/"} + "403": + application/json: {"type": "permission_error", "code": "permission_denied", "message": "Insufficient access", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://ignorant-brook.net"} + "404": + application/json: {"type": "not_found_error", "code": "resource_not_found", "message": "Not found", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://fair-spirit.com/"} + "429": + application/json: {"type": "rate_limit_error", "code": "rate_limit_exceeded", "message": "Rate limit exceeded", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://biodegradable-bar.net"} + "500": + application/json: {"type": "api_error", "code": "internal_error", "message": "Internal server error", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://warmhearted-eternity.com/"} + createAuthor: + speakeasy-default-create-author: + requestBody: + application/json: {"external_id": ""} + responses: + "200": + application/json: {"id": "", "first_seen": 4812.06, "last_seen": 5162.05, "status": "enabled", "trust_level": {"level": 9033.2, "manual": true}, "block": {}, "risk_evaluation": null, "metrics": {"total_content": 3527.05, "flagged_content": 6547.27}, "metadata": {}} + "400": + application/json: {"type": "invalid_request_error", "code": "invalid_request", "message": "Invalid input data", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://worldly-oil.info"} + "401": + application/json: {"type": "authentication_error", "code": "unauthorized", "message": "Authorization not provided", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://glorious-runway.net/"} + "403": + application/json: {"type": "permission_error", "code": "permission_denied", "message": "Insufficient access", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://cluttered-vision.net"} + "429": + application/json: {"type": "rate_limit_error", "code": "rate_limit_exceeded", "message": "Rate limit exceeded", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://secret-netsuke.biz/"} + "500": + application/json: {"type": "api_error", "code": "internal_error", "message": "Internal server error", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://favorite-mozzarella.biz/"} + getAuthor: + speakeasy-default-get-author: + parameters: + path: + id: "" + responses: + "200": + application/json: {"id": "", "first_seen": 6376.87, "last_seen": 9245.24, "status": "suspended", "trust_level": {"level": 7361.01, "manual": true}, "block": {}, "risk_evaluation": null, "metrics": {"total_content": 5954.29, "flagged_content": 964.41}, "metadata": {}} + "400": + application/json: {"type": "invalid_request_error", "code": "invalid_request", "message": "Invalid input data", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://thorny-grandson.net"} + "401": + application/json: {"type": "authentication_error", "code": "unauthorized", "message": "Authorization not provided", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://tinted-caption.org"} + "403": + application/json: {"type": "permission_error", "code": "permission_denied", "message": "Insufficient access", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://sorrowful-zebra.biz"} + "404": + application/json: {"type": "not_found_error", "code": "resource_not_found", "message": "Not found", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://worthless-lamp.biz/"} + "429": + application/json: {"type": "rate_limit_error", "code": "rate_limit_exceeded", "message": "Rate limit exceeded", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://mindless-certification.info/"} + "500": + application/json: {"type": "api_error", "code": "internal_error", "message": "Internal server error", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://snappy-precedent.info/"} + updateAuthor: + speakeasy-default-update-author: + parameters: + path: + id: "" + requestBody: + application/json: {} + responses: + "200": + application/json: {"id": "", "first_seen": 4195.42, "last_seen": 5769.79, "status": "blocked", "trust_level": {"level": 3132.55, "manual": false}, "block": null, "risk_evaluation": {}, "metrics": {"total_content": 75.01, "flagged_content": 9143.95}, "metadata": {}} + "400": + application/json: {"type": "invalid_request_error", "code": "invalid_request", "message": "Invalid input data", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://edible-cycle.net/"} + "401": + application/json: {"type": "authentication_error", "code": "unauthorized", "message": "Authorization not provided", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://legal-advertisement.org/"} + "403": + application/json: {"type": "permission_error", "code": "permission_denied", "message": "Insufficient access", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://tough-vibraphone.info"} + "404": + application/json: {"type": "not_found_error", "code": "resource_not_found", "message": "Not found", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://appropriate-pharmacopoeia.info/"} + "429": + application/json: {"type": "rate_limit_error", "code": "rate_limit_exceeded", "message": "Rate limit exceeded", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://shiny-muscat.biz"} + "500": + application/json: {"type": "api_error", "code": "internal_error", "message": "Internal server error", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://trivial-label.org"} + deleteAuthor: + speakeasy-default-delete-author: + parameters: + path: + id: "" + responses: + "200": + application/json: {"success": false} + "400": + application/json: {"type": "invalid_request_error", "code": "invalid_request", "message": "Invalid input data", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://heavenly-cycle.org"} + "401": + application/json: {"type": "authentication_error", "code": "unauthorized", "message": "Authorization not provided", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://dead-forgery.name/"} + "403": + application/json: {"type": "permission_error", "code": "permission_denied", "message": "Insufficient access", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://fragrant-baseboard.net"} + "404": + application/json: {"type": "not_found_error", "code": "resource_not_found", "message": "Not found", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://doting-affect.biz/"} + "429": + application/json: {"type": "rate_limit_error", "code": "rate_limit_exceeded", "message": "Rate limit exceeded", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://devoted-complication.com"} + "500": + application/json: {"type": "api_error", "code": "internal_error", "message": "Internal server error", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://palatable-transparency.com/"} + getQueue: + speakeasy-default-get-queue: + parameters: + path: + id: "" + responses: + "200": + application/json: {"queue": {"id": "", "name": "", "description": "furiously certification tighten", "filter": {}, "unresolvedItemsCount": 1559.96, "resolvedItemsCount": 1949.18, "totalItemsCount": 1912.44}} + "400": + application/json: {"type": "invalid_request_error", "code": "invalid_request", "message": "Invalid input data", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://actual-thyme.biz/"} + "401": + application/json: {"type": "authentication_error", "code": "unauthorized", "message": "Authorization not provided", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://weary-precedent.com"} + "403": + application/json: {"type": "permission_error", "code": "permission_denied", "message": "Insufficient access", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://polite-pepper.com"} + "404": + application/json: {"type": "not_found_error", "code": "resource_not_found", "message": "Not found", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://posh-exhaust.name"} + "429": + application/json: {"type": "rate_limit_error", "code": "rate_limit_exceeded", "message": "Rate limit exceeded", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://insistent-sermon.info"} + "500": + application/json: {"type": "api_error", "code": "internal_error", "message": "Internal server error", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://burly-markup.info"} + getQueueStats: + speakeasy-default-get-queue-stats: + parameters: + path: + id: "" + query: + withinDays: 30 + responses: + "200": + application/json: {"reviewStats": {"averageTimeToReview": 3713.81, "totalReviewed": 9855.4, "totalPending": 2413.77}, "actionStats": [{"actionId": "", "actionName": "", "count": 4507.74, "percentageOfTotal": 3785.01}], "topReviewers": [], "trends": {"dailyReviewCounts": [{"date": "2024-07-26", "count": 794.3}], "flaggedContentTrends": []}} + "400": + application/json: {"type": "invalid_request_error", "code": "invalid_request", "message": "Invalid input data", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://accomplished-councilman.com/"} + "401": + application/json: {"type": "authentication_error", "code": "unauthorized", "message": "Authorization not provided", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://married-accelerator.name"} + "403": + application/json: {"type": "permission_error", "code": "permission_denied", "message": "Insufficient access", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://stingy-wheel.info"} + "404": + application/json: {"type": "not_found_error", "code": "resource_not_found", "message": "Not found", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://sudden-nudge.biz/"} + "429": + application/json: {"type": "rate_limit_error", "code": "rate_limit_exceeded", "message": "Rate limit exceeded", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://incomplete-populist.name"} + "500": + application/json: {"type": "api_error", "code": "internal_error", "message": "Internal server error", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://quixotic-version.name/"} + listQueueItems: + speakeasy-default-list-queue-items: + parameters: + path: + id: "" + query: + page: 1 + pageSize: 20 + sortDirection: "desc" + responses: + "200": + application/json: {"data": [{"id": "", "content": "", "labels": [{"label": "", "score": 3108.5, "flagged": false}], "flagged": false, "status": "resolved", "timestamp": 79.16}], "pagination": {"page": 42752, "pageSize": 933228, "total": 306038, "totalPages": 947297, "hasMore": true}} + "400": + application/json: {"type": "invalid_request_error", "code": "invalid_request", "message": "Invalid input data", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://back-status.info"} + "401": + application/json: {"type": "authentication_error", "code": "unauthorized", "message": "Authorization not provided", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://complicated-premier.info/"} + "403": + application/json: {"type": "permission_error", "code": "permission_denied", "message": "Insufficient access", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://nocturnal-vanadyl.info/"} + "404": + application/json: {"type": "not_found_error", "code": "resource_not_found", "message": "Not found", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://hot-corporation.info/"} + "429": + application/json: {"type": "rate_limit_error", "code": "rate_limit_exceeded", "message": "Rate limit exceeded", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://vast-pension.biz/"} + "500": + application/json: {"type": "api_error", "code": "internal_error", "message": "Internal server error", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://glorious-marten.biz/"} + resolveQueueItem: + speakeasy-default-resolve-queue-item: + parameters: + path: + id: "" + itemId: "" + requestBody: + application/json: {} + responses: + "200": + application/json: {"success": true, "resolvedAt": ""} + "400": + application/json: {"type": "invalid_request_error", "code": "invalid_request", "message": "Invalid input data", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://heartfelt-orchid.net/"} + "401": + application/json: {"type": "authentication_error", "code": "unauthorized", "message": "Authorization not provided", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://rotating-heartbeat.net"} + "403": + application/json: {"type": "permission_error", "code": "permission_denied", "message": "Insufficient access", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://discrete-maintainer.org/"} + "429": + application/json: {"type": "rate_limit_error", "code": "rate_limit_exceeded", "message": "Rate limit exceeded", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://powerful-wombat.org"} + "500": + application/json: {"type": "api_error", "code": "internal_error", "message": "Internal server error", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://precious-napkin.biz"} + unresolveQueueItem: + speakeasy-default-unresolve-queue-item: + parameters: + path: + id: "" + itemId: "" + requestBody: + application/json: {} + responses: + "200": + application/json: {"success": false, "status": "", "unresolvedAt": ""} + "400": + application/json: {"type": "invalid_request_error", "code": "invalid_request", "message": "Invalid input data", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://passionate-partridge.net"} + "401": + application/json: {"type": "authentication_error", "code": "unauthorized", "message": "Authorization not provided", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://velvety-pocket-watch.info/"} + "403": + application/json: {"type": "permission_error", "code": "permission_denied", "message": "Insufficient access", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://jaunty-mantua.name/"} + "429": + application/json: {"type": "rate_limit_error", "code": "rate_limit_exceeded", "message": "Rate limit exceeded", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://shameless-cleaner.biz/"} + "500": + application/json: {"type": "api_error", "code": "internal_error", "message": "Internal server error", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://vivacious-edge.net/"} + listActions: + speakeasy-default-list-actions: + parameters: + query: + page: 1 + pageSize: 20 + responses: + "200": + application/json: {"data": [{"id": "", "createdAt": "1725087768413", "name": "", "builtIn": false, "queueBehaviour": "NO_CHANGE", "filterInQueueIds": ["", "", ""], "position": "ALL_QUEUES", "possibleValues": [], "valueRequired": false, "freeText": false}], "pagination": {"page": 985516, "pageSize": 779890, "total": 313182, "totalPages": 263422, "hasMore": false}} + "400": + application/json: {"type": "invalid_request_error", "code": "invalid_request", "message": "Invalid input data", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://alive-dividend.org"} + "401": + application/json: {"type": "authentication_error", "code": "unauthorized", "message": "Authorization not provided", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://energetic-coliseum.info"} + "403": + application/json: {"type": "permission_error", "code": "permission_denied", "message": "Insufficient access", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://that-awareness.info/"} + "404": + application/json: {"type": "not_found_error", "code": "resource_not_found", "message": "Not found", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://big-blowgun.com/"} + "429": + application/json: {"type": "rate_limit_error", "code": "rate_limit_exceeded", "message": "Rate limit exceeded", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://glaring-t-shirt.org"} + "500": + application/json: {"type": "api_error", "code": "internal_error", "message": "Internal server error", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://sure-footed-valuable.com"} + createAction: + speakeasy-default-create-action: + requestBody: + application/json: {"name": "", "builtIn": false, "queueBehaviour": "NO_CHANGE", "position": "ALL_QUEUES", "valueRequired": false, "freeText": false} + responses: + "200": + application/json: {"id": "", "createdAt": "1720941674984", "name": "", "builtIn": false, "queueBehaviour": "NO_CHANGE", "filterInQueueIds": [], "position": "ALL_QUEUES", "possibleValues": [], "valueRequired": false, "freeText": false} + "400": + application/json: {"type": "invalid_request_error", "code": "invalid_request", "message": "Invalid input data", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://tense-piglet.biz"} + "401": + application/json: {"type": "authentication_error", "code": "unauthorized", "message": "Authorization not provided", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://ornate-earth.com/"} + "409": + application/json: {"type": "conflict_error", "code": "resource_conflict", "message": "Action with this key already exists", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://electric-injunction.info/"} + "429": + application/json: {"type": "rate_limit_error", "code": "rate_limit_exceeded", "message": "Rate limit exceeded", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://far-premeditation.com/"} + getAction: + speakeasy-default-get-action: + parameters: + path: + id: "" + responses: + "200": + application/json: {"id": "", "createdAt": "1718494238717", "name": "", "builtIn": false, "queueBehaviour": "NO_CHANGE", "filterInQueueIds": ["", ""], "position": "ALL_QUEUES", "possibleValues": [{"value": ""}], "valueRequired": false, "freeText": false} + "400": + application/json: {"type": "invalid_request_error", "code": "invalid_request", "message": "Invalid input data", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://homely-bowler.net"} + "401": + application/json: {"type": "authentication_error", "code": "unauthorized", "message": "Authorization not provided", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://bony-disappointment.org"} + "404": + application/json: {"type": "not_found_error", "code": "resource_not_found", "message": "Not found", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://reckless-disposer.biz"} + "429": + application/json: {"type": "rate_limit_error", "code": "rate_limit_exceeded", "message": "Rate limit exceeded", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://political-subsidy.name/"} + updateAction: + speakeasy-default-update-action: + parameters: + path: + id: "" + requestBody: + application/json: {"builtIn": false, "queueBehaviour": "NO_CHANGE", "position": "ALL_QUEUES", "valueRequired": false, "freeText": false} + responses: + "200": + application/json: {"id": "", "createdAt": "1714762506766", "name": "", "builtIn": false, "queueBehaviour": "NO_CHANGE", "filterInQueueIds": [], "position": "ALL_QUEUES", "possibleValues": [], "valueRequired": false, "freeText": false} + "400": + application/json: {"type": "invalid_request_error", "code": "invalid_request", "message": "Invalid input data", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://second-hand-pigsty.biz/"} + "401": + application/json: {"type": "authentication_error", "code": "unauthorized", "message": "Authorization not provided", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://accurate-morbidity.biz"} + "404": + application/json: {"type": "not_found_error", "code": "resource_not_found", "message": "Not found", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://useless-leading.biz"} + "409": + application/json: {"type": "conflict_error", "code": "resource_conflict", "message": "Action with this key already exists", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://advanced-bog.biz/"} + "429": + application/json: {"type": "rate_limit_error", "code": "rate_limit_exceeded", "message": "Rate limit exceeded", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://needy-longboat.org"} + deleteAction: + speakeasy-default-delete-action: + parameters: + path: + id: "" + responses: + "200": + application/json: {"deleted": false, "id": ""} + "400": + application/json: {"type": "invalid_request_error", "code": "invalid_request", "message": "Invalid input data", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://parallel-whack.net"} + "401": + application/json: {"type": "authentication_error", "code": "unauthorized", "message": "Authorization not provided", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://advanced-barge.net/"} + "404": + application/json: {"type": "not_found_error", "code": "resource_not_found", "message": "Not found", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://raw-offset.info"} + "429": + application/json: {"type": "rate_limit_error", "code": "rate_limit_exceeded", "message": "Rate limit exceeded", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://filthy-acquaintance.com"} + executeAction: + speakeasy-default-execute-action: + requestBody: + application/json: {"actionKey": ""} + responses: + "200": + application/json: {"success": false} + "400": + application/json: {"type": "invalid_request_error", "code": "invalid_request", "message": "Invalid input data", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://near-bog.org"} + "401": + application/json: {"type": "authentication_error", "code": "unauthorized", "message": "Authorization not provided", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://harmful-atrium.biz/"} + "404": + application/json: {"type": "not_found_error", "code": "resource_not_found", "message": "Not found", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://upright-slime.info/"} + "429": + application/json: {"type": "rate_limit_error", "code": "rate_limit_exceeded", "message": "Rate limit exceeded", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://practical-slipper.net/"} + listWebhooks: + speakeasy-default-list-webhooks: + parameters: + query: + page: 1 + pageSize: 20 + responses: + "200": + application/json: {"data": [], "pagination": {"page": 110833, "pageSize": 63381, "total": 164724, "totalPages": 881973, "hasMore": false}} + "401": + application/json: {"type": "authentication_error", "code": "unauthorized", "message": "Authorization not provided", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://grubby-tabletop.info"} + "429": + application/json: {"type": "rate_limit_error", "code": "rate_limit_exceeded", "message": "Rate limit exceeded", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://circular-legend.biz"} + createWebhook: + speakeasy-default-create-webhook: + requestBody: + application/json: {"name": "", "url": "https://experienced-sailor.biz/", "eventTypes": ["QUEUE_ITEM_ACTION"]} + responses: + "200": + application/json: {"id": "", "name": "", "url": "https://experienced-seagull.name/", "eventTypes": ["AUTHOR_UPDATED"], "payloadVersion": "V2", "createdAt": "1722763687109"} + "400": + application/json: {"type": "invalid_request_error", "code": "invalid_request", "message": "Invalid input data", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://burly-permafrost.name"} + "401": + application/json: {"type": "authentication_error", "code": "unauthorized", "message": "Authorization not provided", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://flickering-bonnet.name"} + "429": + application/json: {"type": "rate_limit_error", "code": "rate_limit_exceeded", "message": "Rate limit exceeded", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://exhausted-swordfish.net/"} + getWebhook: + speakeasy-default-get-webhook: + parameters: + path: + id: "" + responses: + "200": + application/json: {"id": "", "name": "", "url": "https://unknown-tray.net", "eventTypes": [], "payloadVersion": "V2", "createdAt": "1705930134329"} + "401": + application/json: {"type": "authentication_error", "code": "unauthorized", "message": "Authorization not provided", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://low-doorpost.net/"} + "404": + application/json: {"type": "not_found_error", "code": "resource_not_found", "message": "Not found", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://avaricious-overcoat.net/"} + "429": + application/json: {"type": "rate_limit_error", "code": "rate_limit_exceeded", "message": "Rate limit exceeded", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://same-translation.net/"} + updateWebhook: + speakeasy-default-update-webhook: + parameters: + path: + id: "" + requestBody: + application/json: {} + responses: + "200": + application/json: {"id": "", "name": "", "url": "https://nimble-affect.name", "eventTypes": [], "payloadVersion": "V1", "createdAt": "1713502971647"} + "400": + application/json: {"type": "invalid_request_error", "code": "invalid_request", "message": "Invalid input data", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://better-guacamole.biz/"} + "401": + application/json: {"type": "authentication_error", "code": "unauthorized", "message": "Authorization not provided", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://impeccable-story.info/"} + "404": + application/json: {"type": "not_found_error", "code": "resource_not_found", "message": "Not found", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://brown-developmental.info"} + "429": + application/json: {"type": "rate_limit_error", "code": "rate_limit_exceeded", "message": "Rate limit exceeded", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://gigantic-jump.biz"} + deleteWebhook: + speakeasy-default-delete-webhook: + parameters: + path: + id: "" + responses: + "200": + application/json: {"deleted": true, "id": ""} + "401": + application/json: {"type": "authentication_error", "code": "unauthorized", "message": "Authorization not provided", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://familiar-scratch.org"} + "404": + application/json: {"type": "not_found_error", "code": "resource_not_found", "message": "Not found", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://timely-sweatshop.info/"} + "429": + application/json: {"type": "rate_limit_error", "code": "rate_limit_exceeded", "message": "Rate limit exceeded", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://hospitable-sundae.com/"} + getWebhookSecret: + speakeasy-default-get-webhook-secret: + responses: + "200": + application/json: {"secret": ""} + "401": + application/json: {"type": "authentication_error", "code": "unauthorized", "message": "Authorization not provided", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://worse-palate.net/"} + "429": + application/json: {"type": "rate_limit_error", "code": "rate_limit_exceeded", "message": "Rate limit exceeded", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://clean-spring.info"} + getAccount: + speakeasy-default-get-account: + responses: + "200": + application/json: {"id": "", "paid_plan_name": "", "text_api_quota": 1657.23, "remaining_quota": 9607.83} + "401": + application/json: {"type": "authentication_error", "code": "unauthorized", "message": "Authorization not provided", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://enchanted-permafrost.info"} + "429": + application/json: {"type": "rate_limit_error", "code": "rate_limit_exceeded", "message": "Rate limit exceeded", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://wasteful-digestive.net"} + listWordlists: + speakeasy-default-list-wordlists: + parameters: + query: + page: 1 + pageSize: 20 + responses: + "200": + application/json: {"data": [{"id": "", "name": "", "description": "unwilling urgently mantua obediently hoarse into provided vet serenade down", "createdAt": "1705747111828", "userId": ""}], "pagination": {"page": 544370, "pageSize": 720052, "total": 588579, "totalPages": 529938, "hasMore": true}} + "400": + application/json: {"type": "invalid_request_error", "code": "invalid_request", "message": "Invalid input data", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://meaty-chapel.name"} + "401": + application/json: {"type": "authentication_error", "code": "unauthorized", "message": "Authorization not provided", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://other-outrun.net"} + "403": + application/json: {"type": "permission_error", "code": "permission_denied", "message": "Insufficient access", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://wise-mythology.org"} + "404": + application/json: {"type": "not_found_error", "code": "resource_not_found", "message": "Not found", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://honorable-vein.com"} + "429": + application/json: {"type": "rate_limit_error", "code": "rate_limit_exceeded", "message": "Rate limit exceeded", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://curly-gray.info"} + "500": + application/json: {"type": "api_error", "code": "internal_error", "message": "Internal server error", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://merry-pile.com/"} + getWordlist: + speakeasy-default-get-wordlist: + parameters: + path: + id: "" + responses: + "200": + application/json: {"id": "", "name": "", "words": [], "createdAt": "1708371957170", "organizationId": "", "userId": "", "strict": false} + "400": + application/json: {"type": "invalid_request_error", "code": "invalid_request", "message": "Invalid input data", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://posh-harp.info"} + "401": + application/json: {"type": "authentication_error", "code": "unauthorized", "message": "Authorization not provided", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://drab-pleasure.biz"} + "403": + application/json: {"type": "permission_error", "code": "permission_denied", "message": "Insufficient access", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://acidic-hygienic.biz"} + "404": + application/json: {"type": "not_found_error", "code": "resource_not_found", "message": "Not found", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://next-blossom.net"} + "429": + application/json: {"type": "rate_limit_error", "code": "rate_limit_exceeded", "message": "Rate limit exceeded", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://livid-fuel.name"} + "500": + application/json: {"type": "api_error", "code": "internal_error", "message": "Internal server error", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://jagged-coordination.com"} + updateWordlist: + speakeasy-default-update-wordlist: + parameters: + path: + id: "" + requestBody: + application/json: {} + responses: + "200": + application/json: {"id": "", "name": "", "words": [""], "createdAt": "1723114860829", "organizationId": "", "userId": "", "strict": false} + "400": + application/json: {"type": "invalid_request_error", "code": "invalid_request", "message": "Invalid input data", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://triangular-republican.info"} + "401": + application/json: {"type": "authentication_error", "code": "unauthorized", "message": "Authorization not provided", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://lanky-editor.info"} + "404": + application/json: {"type": "not_found_error", "code": "resource_not_found", "message": "Not found", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://surprised-gripper.net/"} + "429": + application/json: {"type": "rate_limit_error", "code": "rate_limit_exceeded", "message": "Rate limit exceeded", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://crooked-milestone.biz"} + getWordlistEmbeddingStatus: + speakeasy-default-get-wordlist-embedding-status: + parameters: + path: + id: "" + responses: + "200": + application/json: {"progress": 1381.39, "totalWords": 7094.28, "remainingWords": 9583.15} + "400": + application/json: {"type": "invalid_request_error", "code": "invalid_request", "message": "Invalid input data", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://quixotic-requirement.name"} + "401": + application/json: {"type": "authentication_error", "code": "unauthorized", "message": "Authorization not provided", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://nimble-thread.org"} + "403": + application/json: {"type": "permission_error", "code": "permission_denied", "message": "Insufficient access", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://responsible-awareness.com/"} + "404": + application/json: {"type": "not_found_error", "code": "resource_not_found", "message": "Not found", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://worst-hutch.info/"} + "429": + application/json: {"type": "rate_limit_error", "code": "rate_limit_exceeded", "message": "Rate limit exceeded", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://agreeable-independence.name/"} + "500": + application/json: {"type": "api_error", "code": "internal_error", "message": "Internal server error", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://impolite-sediment.name"} + addWordlistWords: + speakeasy-default-add-wordlist-words: + parameters: + path: + id: "" + requestBody: + application/json: {"words": []} + responses: + "200": + application/json: {"addedCount": 7700.73, "totalCount": 8887.39, "addedWords": []} + "400": + application/json: {"type": "invalid_request_error", "code": "invalid_request", "message": "Invalid input data", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://noxious-fledgling.info/"} + "401": + application/json: {"type": "authentication_error", "code": "unauthorized", "message": "Authorization not provided", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://tempting-diversity.biz/"} + "404": + application/json: {"type": "not_found_error", "code": "resource_not_found", "message": "Not found", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://dismal-castanet.org/"} + "429": + application/json: {"type": "rate_limit_error", "code": "rate_limit_exceeded", "message": "Rate limit exceeded", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://serene-skean.com"} + removeWordlistWords: + speakeasy-default-remove-wordlist-words: + parameters: + path: + id: "" + query: + words: ["", "", ""] + responses: + "200": + application/json: {"removedCount": 6472.46, "totalCount": 1784.41, "removedWords": [""]} + "400": + application/json: {"type": "invalid_request_error", "code": "invalid_request", "message": "Invalid input data", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://coarse-flight.com/"} + "401": + application/json: {"type": "authentication_error", "code": "unauthorized", "message": "Authorization not provided", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://unfortunate-toothbrush.com/"} + "404": + application/json: {"type": "not_found_error", "code": "resource_not_found", "message": "Not found", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://key-expense.com"} + "429": + application/json: {"type": "rate_limit_error", "code": "rate_limit_exceeded", "message": "Rate limit exceeded", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://sophisticated-slime.name"} + submitContent: + speakeasy-default-submit-content: + requestBody: + application/json: {"content": {"type": "image"}} + responses: + "200": + application/json: {"content": {"id": "", "masked": true, "unicode_cleaned": true, "modified": {"key": "", "key1": ""}}, "author": {"id": "", "block": {}, "status": "blocked", "trust_level": {"level": 8664.71, "manual": false}}, "evaluation": {"flagged": false, "flag_probability": 8008.81, "severity_score": 348.65}, "recommendation": {"action": "allow", "reason_codes": ["rule_match"]}, "casebook": {"verdict": "reject", "similarity": 2676.55, "agreement": 7706.56, "confidence": 9365.91, "case_count": 6691.67, "topic": {"id": "", "label": ""}}, "policies": [], "insights": [], "meta": {"status": "partial_success", "timestamp": 5209.71, "channel_key": "", "usage": 2898.59}} + "400": + application/json: {"type": "invalid_request_error", "code": "invalid_request", "message": "Invalid input data", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://sparse-collaboration.name"} + "401": + application/json: {"type": "authentication_error", "code": "unauthorized", "message": "Authorization not provided", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://second-hand-devastation.name/"} + "403": + application/json: {"type": "permission_error", "code": "permission_denied", "message": "Insufficient access", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://white-atrium.info"} + "429": + application/json: {"type": "rate_limit_error", "code": "rate_limit_exceeded", "message": "Rate limit exceeded", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://worthless-solvency.info/"} + "500": + application/json: {"type": "api_error", "code": "internal_error", "message": "Internal server error", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://enchanted-amnesty.name/"} + listProjects: + speakeasy-default-list-projects: + parameters: + query: + page: 1 + pageSize: 20 + responses: + "200": + application/json: {"data": [{"id": "", "name": "", "description": "scarily however out solidly reproach", "domain": "wasteful-lounge.com", "context": "", "globalFlaggingMode": "ACTIVE", "enableRequestLogging": false, "casebookEnabled": false, "createdAt": "1719550777772", "updatedAt": "1735687514389"}], "pagination": {"page": 468054, "pageSize": 647138, "total": 740816, "totalPages": 925291, "hasMore": false}} + "401": + application/json: {"type": "authentication_error", "code": "unauthorized", "message": "Authorization not provided", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://deadly-barracks.info/"} + "403": + application/json: {"type": "permission_error", "code": "permission_denied", "message": "Insufficient access", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://accurate-surface.com"} + "429": + application/json: {"type": "rate_limit_error", "code": "rate_limit_exceeded", "message": "Rate limit exceeded", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://zany-archaeology.com"} + createProject: + speakeasy-default-create-project: + requestBody: + application/json: {"name": "", "usedByMinors": false} + responses: + "200": + application/json: {"id": "", "name": "", "description": "accidentally per justly inconsequential amidst", "domain": "impeccable-lashes.net", "context": "", "globalFlaggingMode": "ACTIVE", "enableRequestLogging": false, "casebookEnabled": false, "createdAt": "1722120233197", "updatedAt": "1735673297432", "secretKey": ""} + "400": + application/json: {"type": "invalid_request_error", "code": "invalid_request", "message": "Invalid input data", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://elastic-typeface.name"} + "401": + application/json: {"type": "authentication_error", "code": "unauthorized", "message": "Authorization not provided", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://fake-suspension.info/"} + "403": + application/json: {"type": "permission_error", "code": "permission_denied", "message": "Insufficient access", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://lazy-marketplace.org/"} + "429": + application/json: {"type": "rate_limit_error", "code": "rate_limit_exceeded", "message": "Rate limit exceeded", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://difficult-mentor.name"} + getProject: + speakeasy-default-get-project: + parameters: + path: + id: "" + responses: + "200": + application/json: {"id": "", "name": "", "description": "for loyally prance dutiful decriminalize noted", "domain": "well-worn-e-mail.net", "context": "", "globalFlaggingMode": "ACTIVE", "enableRequestLogging": false, "casebookEnabled": true, "createdAt": "1733283153583", "updatedAt": "1735660743971"} + "401": + application/json: {"type": "authentication_error", "code": "unauthorized", "message": "Authorization not provided", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://drab-stitcher.biz"} + "403": + application/json: {"type": "permission_error", "code": "permission_denied", "message": "Insufficient access", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://unsightly-cricket.net/"} + "404": + application/json: {"type": "not_found_error", "code": "resource_not_found", "message": "Not found", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://linear-ocelot.com/"} + "429": + application/json: {"type": "rate_limit_error", "code": "rate_limit_exceeded", "message": "Rate limit exceeded", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://sour-avalanche.org"} + updateProject: + speakeasy-default-update-project: + parameters: + path: + id: "" + requestBody: + application/json: {} + responses: + "200": + application/json: {"id": "", "name": "", "description": null, "domain": "wiggly-gown.info", "context": "", "globalFlaggingMode": "DRY_RUN", "enableRequestLogging": false, "casebookEnabled": false, "createdAt": "1723019639943", "updatedAt": "1735642941794"} + "400": + application/json: {"type": "invalid_request_error", "code": "invalid_request", "message": "Invalid input data", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://enchanting-behest.name"} + "401": + application/json: {"type": "authentication_error", "code": "unauthorized", "message": "Authorization not provided", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://scary-strategy.com"} + "403": + application/json: {"type": "permission_error", "code": "permission_denied", "message": "Insufficient access", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://intelligent-adrenalin.org"} + "404": + application/json: {"type": "not_found_error", "code": "resource_not_found", "message": "Not found", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://informal-loyalty.biz/"} + "429": + application/json: {"type": "rate_limit_error", "code": "rate_limit_exceeded", "message": "Rate limit exceeded", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://paltry-marketplace.com/"} + deleteProject: + speakeasy-default-delete-project: + parameters: + path: + id: "" + responses: + "200": + application/json: {"deleted": true, "id": ""} + "401": + application/json: {"type": "authentication_error", "code": "unauthorized", "message": "Authorization not provided", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://brown-lawmaker.com/"} + "403": + application/json: {"type": "permission_error", "code": "permission_denied", "message": "Insufficient access", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://specific-swing.net/"} + "404": + application/json: {"type": "not_found_error", "code": "resource_not_found", "message": "Not found", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://genuine-shoulder.name/"} + "429": + application/json: {"type": "rate_limit_error", "code": "rate_limit_exceeded", "message": "Rate limit exceeded", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://rewarding-quit.biz/"} + duplicateProject: + speakeasy-default-duplicate-project: + parameters: + path: + id: "" + requestBody: + application/json: {} + responses: + "200": + application/json: {"id": "", "name": "", "description": "messy volunteer quash cluttered", "domain": "unkempt-bowling.name", "context": "", "globalFlaggingMode": "DRY_RUN", "enableRequestLogging": true, "casebookEnabled": false, "createdAt": "1720065871635", "updatedAt": "1735618179596", "secretKey": ""} + "400": + application/json: {"type": "invalid_request_error", "code": "invalid_request", "message": "Invalid input data", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://wicked-brochure.net"} + "401": + application/json: {"type": "authentication_error", "code": "unauthorized", "message": "Authorization not provided", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://rowdy-humor.net"} + "403": + application/json: {"type": "permission_error", "code": "permission_denied", "message": "Insufficient access", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://winged-developing.org/"} + "404": + application/json: {"type": "not_found_error", "code": "resource_not_found", "message": "Not found", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://lazy-fund.org/"} + "429": + application/json: {"type": "rate_limit_error", "code": "rate_limit_exceeded", "message": "Rate limit exceeded", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://sentimental-thread.info"} + listChannels: + speakeasy-default-list-channels: + parameters: + path: + projectId: "" + query: + page: 1 + pageSize: 20 + responses: + "200": + application/json: {"data": [{"id": "", "projectId": "", "key": "", "name": "", "description": "within greedily why primary ceramics that pricey trash", "isDefault": false, "contentType": "post", "flaggingMode": "ACTIVE", "contextEnabled": true, "enableImageModeration": false, "enableVideoModeration": false, "enableAudioModeration": true, "enableVoiceModeration": true, "includeTranscriptInResponse": true, "transcriptionQuality": "SPEED", "unicodeSpoofDetectionEnabled": true, "frameCaptureInterval": 9833.48, "maxFramesPerVideo": 441460, "spreadFrames": false, "createdAt": "1725717609091", "updatedAt": "1735644620528"}], "pagination": {"page": 16950, "pageSize": 792684, "total": 944522, "totalPages": 636345, "hasMore": false}} + "401": + application/json: {"type": "authentication_error", "code": "unauthorized", "message": "Authorization not provided", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://authentic-dress.name/"} + "403": + application/json: {"type": "permission_error", "code": "permission_denied", "message": "Insufficient access", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://understated-produce.net"} + "404": + application/json: {"type": "not_found_error", "code": "resource_not_found", "message": "Not found", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://cruel-vein.info"} + "429": + application/json: {"type": "rate_limit_error", "code": "rate_limit_exceeded", "message": "Rate limit exceeded", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://primary-completion.biz/"} + createChannel: + speakeasy-default-create-channel: + parameters: + path: + projectId: "" + requestBody: + application/json: {"name": ""} + responses: + "200": + application/json: {"id": "", "projectId": "", "key": "", "name": "", "description": "regular ouch unlike slow fondly finally meanwhile though toaster", "isDefault": false, "contentType": "voice", "flaggingMode": "ACTIVE", "contextEnabled": false, "enableImageModeration": false, "enableVideoModeration": true, "enableAudioModeration": false, "enableVoiceModeration": true, "includeTranscriptInResponse": true, "transcriptionQuality": "BALANCED", "unicodeSpoofDetectionEnabled": true, "frameCaptureInterval": 9068.96, "maxFramesPerVideo": 217785, "spreadFrames": true, "createdAt": "1709542405374", "updatedAt": "1735665242908"} + "400": + application/json: {"type": "invalid_request_error", "code": "invalid_request", "message": "Invalid input data", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://experienced-jazz.name/"} + "401": + application/json: {"type": "authentication_error", "code": "unauthorized", "message": "Authorization not provided", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://witty-goodwill.net"} + "403": + application/json: {"type": "permission_error", "code": "permission_denied", "message": "Insufficient access", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://deep-lifestyle.name"} + "404": + application/json: {"type": "not_found_error", "code": "resource_not_found", "message": "Not found", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://ill-airbus.biz"} + "429": + application/json: {"type": "rate_limit_error", "code": "rate_limit_exceeded", "message": "Rate limit exceeded", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://bad-mathematics.biz/"} + getChannel: + speakeasy-default-get-channel: + parameters: + path: + id: "" + responses: + "200": + application/json: {"id": "", "projectId": "", "key": "", "name": "", "description": null, "isDefault": true, "contentType": "event", "flaggingMode": "DRY_RUN", "contextEnabled": false, "enableImageModeration": false, "enableVideoModeration": false, "enableAudioModeration": false, "enableVoiceModeration": true, "includeTranscriptInResponse": true, "transcriptionQuality": "SPEED", "unicodeSpoofDetectionEnabled": false, "frameCaptureInterval": 9732.58, "maxFramesPerVideo": 449675, "spreadFrames": false, "createdAt": "1709021755362", "updatedAt": "1735658089359"} + "401": + application/json: {"type": "authentication_error", "code": "unauthorized", "message": "Authorization not provided", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://orderly-lace.com"} + "403": + application/json: {"type": "permission_error", "code": "permission_denied", "message": "Insufficient access", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://crushing-avalanche.biz/"} + "404": + application/json: {"type": "not_found_error", "code": "resource_not_found", "message": "Not found", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://silky-redesign.name/"} + "429": + application/json: {"type": "rate_limit_error", "code": "rate_limit_exceeded", "message": "Rate limit exceeded", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://super-crocodile.org/"} + updateChannel: + speakeasy-default-update-channel: + parameters: + path: + id: "" + requestBody: + application/json: {} + responses: + "200": + application/json: {"id": "", "projectId": "", "key": "", "name": "", "description": "utterly taxicab rebuild amid common searchingly", "isDefault": false, "contentType": "comment", "flaggingMode": "ACTIVE", "contextEnabled": false, "enableImageModeration": true, "enableVideoModeration": false, "enableAudioModeration": true, "enableVoiceModeration": false, "includeTranscriptInResponse": true, "transcriptionQuality": "SPEED", "unicodeSpoofDetectionEnabled": false, "frameCaptureInterval": 242.32, "maxFramesPerVideo": 79933, "spreadFrames": false, "createdAt": "1714165181265", "updatedAt": "1735635444170"} + "400": + application/json: {"type": "invalid_request_error", "code": "invalid_request", "message": "Invalid input data", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://jam-packed-midwife.net"} + "401": + application/json: {"type": "authentication_error", "code": "unauthorized", "message": "Authorization not provided", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://enchanted-executor.name/"} + "403": + application/json: {"type": "permission_error", "code": "permission_denied", "message": "Insufficient access", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://tinted-seagull.biz"} + "404": + application/json: {"type": "not_found_error", "code": "resource_not_found", "message": "Not found", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://bouncy-sanity.org"} + "429": + application/json: {"type": "rate_limit_error", "code": "rate_limit_exceeded", "message": "Rate limit exceeded", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://glaring-procurement.name/"} + deleteChannel: + speakeasy-default-delete-channel: + parameters: + path: + id: "" + responses: + "200": + application/json: {"deleted": true, "id": ""} + "400": + application/json: {"type": "invalid_request_error", "code": "invalid_request", "message": "Invalid input data", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://wise-accountability.info/"} + "401": + application/json: {"type": "authentication_error", "code": "unauthorized", "message": "Authorization not provided", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://brilliant-makeover.name"} + "403": + application/json: {"type": "permission_error", "code": "permission_denied", "message": "Insufficient access", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://specific-vibration.info"} + "404": + application/json: {"type": "not_found_error", "code": "resource_not_found", "message": "Not found", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://wasteful-suv.com/"} + "429": + application/json: {"type": "rate_limit_error", "code": "rate_limit_exceeded", "message": "Rate limit exceeded", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://impeccable-injunction.net"} + duplicateChannel: + speakeasy-default-duplicate-channel: + parameters: + path: + id: "" + requestBody: + application/json: {} + responses: + "200": + application/json: {"id": "", "projectId": "", "key": "", "name": "", "description": null, "isDefault": true, "contentType": "event", "flaggingMode": "DRY_RUN", "contextEnabled": false, "enableImageModeration": true, "enableVideoModeration": true, "enableAudioModeration": true, "enableVoiceModeration": false, "includeTranscriptInResponse": true, "transcriptionQuality": "BALANCED", "unicodeSpoofDetectionEnabled": false, "frameCaptureInterval": 3446.41, "maxFramesPerVideo": 287196, "spreadFrames": false, "createdAt": "1727448237026", "updatedAt": "1735634690271"} + "400": + application/json: {"type": "invalid_request_error", "code": "invalid_request", "message": "Invalid input data", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://educated-unblinking.name"} + "401": + application/json: {"type": "authentication_error", "code": "unauthorized", "message": "Authorization not provided", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://uniform-statue.biz/"} + "403": + application/json: {"type": "permission_error", "code": "permission_denied", "message": "Insufficient access", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://dependent-nudge.biz/"} + "404": + application/json: {"type": "not_found_error", "code": "resource_not_found", "message": "Not found", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://insecure-premium.com/"} + "429": + application/json: {"type": "rate_limit_error", "code": "rate_limit_exceeded", "message": "Rate limit exceeded", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://upset-hydrant.info/"} +examplesVersion: 1.0.2 diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml new file mode 100644 index 00000000..201aea84 --- /dev/null +++ b/.speakeasy/gen.yaml @@ -0,0 +1,66 @@ +configVersion: 2.0.0 +generation: + sdkClassName: ModerationApi + maintainOpenAPIOrder: true + usageSnippets: + optionalPropertyRendering: withExample + sdkInitStyle: constructor + useClassNamesForArrayFields: true + fixes: + nameResolutionDec2023: true + nameResolutionFeb2025: true + parameterOrderingFeb2024: true + requestResponseComponentNamesFeb2024: true + securityFeb2025: true + sharedErrorComponentsApr2025: true + sharedNestedComponentsJan2026: true + nameOverrideFeb2026: true + openSingleValueEnumsOct2026: true + auth: + oAuth2ClientCredentialsEnabled: false + oAuth2PasswordEnabled: false + hoistGlobalSecurity: true + inferSSEOverload: true + sdkHooksConfigAccess: true + schemas: + allOfMergeStrategy: shallowMerge + requestBodyFieldName: body + versioningStrategy: automatic + persistentEdits: {} + tests: + generateTests: false + generateNewTests: true + skipResponseBodyAssertions: false +ruby: + version: 3.0.0 + additionalDependencies: + development: {} + runtime: {} + author: Moderation API + baseErrorName: ModerationAPIError + clientServerStatusCodesAsErrors: true + constFieldsAlwaysOptional: false + defaultErrorName: APIError + description: The official Ruby library for the Moderation API + enableFormatting: true + flattenGlobalSecurity: true + forwardCompatibleEnumsByDefault: true + forwardCompatibleUnionsByDefault: tagged-only + imports: + option: openapi + paths: + callbacks: models/callbacks + errors: models/errors + operations: models/operations + shared: models/components + webhooks: models/webhooks + inferUnionDiscriminators: true + inputModelSuffix: input + license: Apache-2.0 + maxMethodParams: 4 + module: ModerationApi + multipartArrayFormat: standard + outputModelSuffix: output + packageName: moderation_api + typingStrategy: sorbet + unionStrategy: populated-fields diff --git a/.stats.yml b/.stats.yml deleted file mode 100644 index ac64174f..00000000 --- a/.stats.yml +++ /dev/null @@ -1,4 +0,0 @@ -configured_endpoints: 34 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/moderation-api/moderation-api-a4c5163e3271601b36a74223b756d304ce8246f832f8c531d53cdd30f9ee4c68.yml -openapi_spec_hash: fd9fe8a54c1c46032bd5fccb995f04b8 -config_hash: 6e090a71f4d354167d93b4534a0e7f05 diff --git a/.yardopts b/.yardopts deleted file mode 100644 index 84c12f2a..00000000 --- a/.yardopts +++ /dev/null @@ -1,6 +0,0 @@ ---type-name-tag generic:Generic ---default-return void ---markup markdown ---markup-provider redcarpet ---exclude /rbi ---exclude /sig diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a2a40351..d585717f 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,119 +1,26 @@ -## Setting up the environment +# Contributing to This Repository -This repository contains a `.ruby-version` file, which should work with either [rbenv](https://github.com/rbenv/rbenv) or [asdf](https://github.com/asdf-vm/asdf) with the [ruby plugin](https://github.com/asdf-vm/asdf-ruby). +Thank you for your interest in contributing to this repository. Please note that this repository contains generated code. As such, we do not accept direct changes or pull requests. Instead, we encourage you to follow the guidelines below to report issues and suggest improvements. -Please follow the instructions for your preferred version manager to install the Ruby version specified in the `.ruby-version` file. +## How to Report Issues -To set up the repository, run: +If you encounter any bugs or have suggestions for improvements, please open an issue on GitHub. When reporting an issue, please provide as much detail as possible to help us reproduce the problem. This includes: -```bash -$ ./scripts/bootstrap -``` +- A clear and descriptive title +- Steps to reproduce the issue +- Expected and actual behavior +- Any relevant logs, screenshots, or error messages +- Information about your environment (e.g., operating system, software versions) + - For example can be collected using the `npx envinfo` command from your terminal if you have Node.js installed -This will install all the required dependencies. +## Issue Triage and Upstream Fixes -## Modifying/Adding code +We will review and triage issues as quickly as possible. Our goal is to address bugs and incorporate improvements in the upstream source code. Fixes will be included in the next generation of the generated code. -Most of the SDK is generated code. Modifications to code will be persisted between generations, but may result in merge conflicts between manual patches and changes from the generator. The generator will never modify the contents of `lib/moderation_api/helpers/` and `examples/` directory. +## Contact -## Adding and running examples +If you have any questions or need further assistance, please feel free to reach out by opening an issue. -All files in the `examples/` directory are not modified by the generator and can be freely edited or added to. +Thank you for your understanding and cooperation! -```ruby -#!/usr/bin/env ruby -# frozen_string_literal: true - -require_relative "../lib/moderation_api" - -# ... -``` - -```bash -$ chmod +x './examples/.rb' - -# run the example against your api -$ ruby './examples/.rb' -``` - -## Using the repository from source - -If you’d like to use the repository from source, you can either install from git or reference a cloned repository: - -To install via git in your `Gemfile`: - -```ruby -gem "moderation_api", git: "https://github.com/moderation-api/sdk-ruby" -``` - -Alternatively, reference local copy of the repo: - -```bash -$ git clone -- 'https://github.com/moderation-api/sdk-ruby' '' -``` - -```ruby -gem "moderation_api", path: "" -``` - -## Running commands - -Running `rake` by itself will show all runnable commands. - -```bash -$ bundle exec rake -``` - -## Running tests - -```bash -$ bundle exec rake test -``` - -## Linting and formatting - -This repository uses [rubocop](https://github.com/rubocop/rubocop) for linting and formatting of `*.rb` files; And [syntax_tree](https://github.com/ruby-syntax-tree/syntax_tree) is used for formatting of both `*.rbi` and `*.rbs` files. - -There are two separate type checkers supported by this library: [sorbet](https://github.com/sorbet/sorbet) and [steep](https://github.com/soutaro/steep) are used for verifying `*.rbi` and `*.rbs` files respectively. - -To lint and typecheck: - -```bash -$ bundle exec rake lint -``` - -To format and fix all lint issues automatically: - -```bash -$ bundle exec rake format -``` - -## Editor Support - -### Ruby LSP - -[Ruby LSP](https://github.com/Shopify/ruby-lsp) has quite good support for go to definition, but not auto-completion. - -This can be installed along side Solargraph. - -### Solargraph - -[Solargraph](https://solargraph.org) has quite good support for auto-completion, but not go to definition. - -This can be installed along side Ruby LSP. - -### Sorbet - -[Sorbet](https://sorbet.org) should mostly work out of the box when editing this library directly. However, there are a some caveats due to the colocation of `*.rb` and `*.rbi` files in the same project. These issues should not otherwise manifest when this library is used as a dependency. - -1. For go to definition usages, sorbet might get confused and may not always navigate to the correct location. - -2. For each generic type in `*.rbi` files, a spurious "Duplicate type member" error is present. - -## Documentation Preview - -To preview the documentation, run: - -```bash -$ bundle exec rake docs:preview [PORT=8808] -``` +The Maintainers diff --git a/Gemfile b/Gemfile index 1be178cb..b0ea4055 100644 --- a/Gemfile +++ b/Gemfile @@ -1,32 +1,6 @@ # frozen_string_literal: true -source "https://rubygems.org" +source 'https://rubygems.org' +# Specify your gem's dependencies in openapi.gemspec gemspec - -group :development do - gem "rake" - gem "rbs" - gem "rubocop" - gem "sorbet" - gem "steep" - gem "syntax_tree" - gem "syntax_tree-rbs", github: "ruby-syntax-tree/syntax_tree-rbs", branch: "main" - gem "tapioca" -end - -group :development, :test do - gem "async" - gem "minitest" - gem "minitest-focus" - gem "minitest-hooks" - gem "minitest-proveit" - gem "minitest-rg" - gem "webmock" -end - -group :development, :docs do - gem "redcarpet" - gem "webrick" - gem "yard" -end diff --git a/Gemfile.lock b/Gemfile.lock index b438c48a..9739d6a2 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,117 +1,92 @@ -GIT - remote: https://github.com/ruby-syntax-tree/syntax_tree-rbs.git - revision: f94bc3060682ffbd126e4d5086ffedc89073d626 - branch: main - specs: - syntax_tree-rbs (1.0.0) - prettier_print - rbs - syntax_tree (>= 2.0.1) - PATH remote: . specs: - moderation_api (2.41.0) - cgi - connection_pool + moderation_api (3.0.0) + faraday + faraday-multipart + faraday-retry + rack + rake + sorbet GEM remote: https://rubygems.org/ specs: - activesupport (8.1.1) - base64 - bigdecimal - concurrent-ruby (~> 1.0, >= 1.3.1) - connection_pool (>= 2.2.5) - drb - i18n (>= 1.6, < 2) - json - logger (>= 1.4.2) - minitest (>= 5.1) - securerandom (>= 0.3) - tzinfo (~> 2.0, >= 2.0.5) - uri (>= 0.13.1) - addressable (2.8.7) - public_suffix (>= 2.0.2, < 7.0) - ast (2.4.3) - async (2.34.0) - console (~> 1.29) - fiber-annotation - io-event (~> 1.11) - metrics (~> 0.12) - traces (~> 0.18) + addressable (2.8.8) + public_suffix (>= 2.0.2, < 8.0) + ansi (1.5.0) + ast (2.4.2) base64 (0.3.0) benchmark (0.5.0) - bigdecimal (3.3.1) - cgi (0.5.1) - concurrent-ruby (1.3.5) - connection_pool (2.5.4) - console (1.34.2) - fiber-annotation - fiber-local (~> 1.1) - json - crack (1.0.1) - bigdecimal - rexml - csv (3.3.5) - drb (2.2.3) + builder (3.3.0) + date (3.5.1) + erb (6.0.1) erubi (1.13.1) - ffi (1.17.2-aarch64-linux-gnu) - ffi (1.17.2-aarch64-linux-musl) - ffi (1.17.2-arm64-darwin) - ffi (1.17.2-x86_64-darwin) - ffi (1.17.2-x86_64-linux-gnu) - ffi (1.17.2-x86_64-linux-musl) - fiber-annotation (0.2.0) - fiber-local (1.1.0) - fiber-storage - fiber-storage (1.0.1) - fileutils (1.8.0) - hashdiff (1.2.1) - i18n (1.14.7) - concurrent-ruby (~> 1.0) - io-event (1.11.2) - json (2.15.2) - language_server-protocol (3.17.0.5) + faraday (2.14.3) + faraday-net_http (>= 2.0, < 3.5) + json + logger + faraday-multipart (1.2.0) + multipart-post (~> 2.0) + faraday-net_http (3.4.0) + net-http (>= 0.5.0) + faraday-retry (2.4.0) + faraday (~> 2.0) + io-console (0.8.2) + irb (1.16.0) + pp (>= 0.6.0) + rdoc (>= 4.0.0) + reline (>= 0.4.2) + janeway-jsonpath (0.6.0) + json (2.8.2) + language_server-protocol (3.17.0.4) lint_roller (1.1.0) - listen (3.9.0) - rb-fsevent (~> 0.10, >= 0.10.3) - rb-inotify (~> 0.9, >= 0.9.10) - logger (1.7.0) - metrics (0.15.0) - minitest (5.26.0) - minitest-focus (1.4.0) - minitest (>= 4, < 6) - minitest-hooks (1.5.2) - minitest (> 5.3) - minitest-proveit (1.0.0) - minitest (> 5, < 7) - minitest-rg (5.3.0) - minitest (~> 5.0) - mutex_m (0.3.0) + logger (1.6.6) + minitest (6.0.1) + prism (~> 1.5) + minitest-focus (1.4.1) + minitest (> 5.0) + minitest-reporters (1.7.1) + ansi + builder + minitest (>= 5.0) + ruby-progressbar + multipart-post (2.4.1) + net-http (0.6.0) + uri netrc (0.11.0) - parallel (1.27.0) - parser (3.3.10.0) + parallel (1.26.3) + parser (3.3.7.1) ast (~> 2.4.1) racc - prettier_print (1.2.1) - prism (1.6.0) - public_suffix (6.0.2) + pp (0.6.3) + prettyprint + prettyprint (0.2.0) + prism (1.7.0) + psych (5.3.1) + date + stringio + public_suffix (7.0.0) racc (1.8.1) + rack (3.1.11) rainbow (3.1.1) - rake (13.3.1) - rb-fsevent (0.11.2) - rb-inotify (0.11.1) - ffi (~> 1.0) - rbi (0.3.7) + rake (13.2.1) + rbi (0.3.8) prism (~> 1.0) rbs (>= 3.4.4) - rbs (3.9.5) + rbs (4.0.0.dev.4) logger - redcarpet (3.6.1) - regexp_parser (2.11.3) + prism (>= 1.3.0) + rdoc (7.0.3) + erb + psych (>= 4.0.0) + tsort + regexp_parser (2.10.0) + reline (0.6.3) + io-console (~> 0.5) + require-hooks (0.2.2) rexml (3.4.4) - rubocop (1.81.7) + rubocop (1.73.2) json (~> 2.3) language_server-protocol (~> 3.17.0.2) lint_roller (~> 1.1.0) @@ -119,110 +94,69 @@ GEM parser (>= 3.3.0.2) rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 2.9.3, < 3.0) - rubocop-ast (>= 1.47.1, < 2.0) + rubocop-ast (>= 1.38.0, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 2.4.0, < 4.0) - rubocop-ast (1.47.1) - parser (>= 3.3.7.2) - prism (~> 1.4) + rubocop-ast (1.38.1) + parser (>= 3.3.1.0) + rubocop-minitest (0.37.1) + lint_roller (~> 1.1) + rubocop (>= 1.72.1, < 2.0) + rubocop-ast (>= 1.38.0, < 2.0) ruby-progressbar (1.13.0) - securerandom (0.4.1) - sorbet (0.6.12690) - sorbet-static (= 0.6.12690) - sorbet-runtime (0.6.12690) - sorbet-static (0.6.12690-aarch64-linux) - sorbet-static (0.6.12690-universal-darwin) - sorbet-static (0.6.12690-x86_64-linux) - sorbet-static-and-runtime (0.6.12690) - sorbet (= 0.6.12690) - sorbet-runtime (= 0.6.12690) - spoom (1.6.3) + sorbet (0.6.12872) + sorbet-static (= 0.6.12872) + sorbet-runtime (0.6.12872) + sorbet-static (0.6.12872-aarch64-linux) + sorbet-static (0.6.12872-universal-darwin) + sorbet-static (0.6.12872-x86_64-linux) + sorbet-static-and-runtime (0.6.12872) + sorbet (= 0.6.12872) + sorbet-runtime (= 0.6.12872) + spoom (1.7.11) erubi (>= 1.10.0) prism (>= 0.28.0) rbi (>= 0.3.3) + rbs (>= 4.0.0.dev.4) rexml (>= 3.2.6) sorbet-static-and-runtime (>= 0.5.10187) thor (>= 0.19.2) - steep (1.10.0) - activesupport (>= 5.1) - concurrent-ruby (>= 1.1.10) - csv (>= 3.0.9) - fileutils (>= 1.1.0) - json (>= 2.1.0) - language_server-protocol (>= 3.17.0.4, < 4.0) - listen (~> 3.0) - logger (>= 1.3.0) - mutex_m (>= 0.3.0) - parser (>= 3.1) - rainbow (>= 2.2.2, < 4.0) - rbs (~> 3.9) - securerandom (>= 0.1) - strscan (>= 1.0.0) - terminal-table (>= 2, < 5) - uri (>= 0.12.0) - strscan (3.1.5) - syntax_tree (6.3.0) - prettier_print (>= 1.2.0) - tapioca (0.16.11) + stringio (3.2.0) + tapioca (0.17.10) benchmark bundler (>= 2.2.25) netrc (>= 0.11.0) parallel (>= 1.21.0) - rbi (~> 0.2) + rbi (>= 0.3.7) + require-hooks (>= 0.2.2) sorbet-static-and-runtime (>= 0.5.11087) - spoom (>= 1.2.0) + spoom (>= 1.7.9) thor (>= 1.2.0) yard-sorbet - terminal-table (4.0.0) - unicode-display_width (>= 1.1.1, < 4) thor (1.4.0) - traces (0.18.2) - tzinfo (2.0.6) - concurrent-ruby (~> 1.0) + tsort (0.2.0) unicode-display_width (3.2.0) unicode-emoji (~> 4.1) - unicode-emoji (4.1.0) - uri (1.1.0) - webmock (3.26.1) - addressable (>= 2.8.0) - crack (>= 0.3.2) - hashdiff (>= 0.4.0, < 2.0.0) - webrick (1.9.1) - yard (0.9.37) + unicode-emoji (4.2.0) + uri (1.1.1) + yard (0.9.42) yard-sorbet (0.9.0) sorbet-runtime yard PLATFORMS aarch64-linux - aarch64-linux-gnu - aarch64-linux-musl - arm64-darwin - universal-darwin - x86_64-darwin - x86_64-linux-gnu - x86_64-linux-musl + arm64-darwin-23 + arm64-darwin-24 + arm64-darwin-25 + x86_64-linux DEPENDENCIES - async minitest - minitest-focus - minitest-hooks - minitest-proveit - minitest-rg moderation_api! - rake - rbs - redcarpet - rubocop - sorbet - steep - syntax_tree - syntax_tree-rbs! + rubocop (~> 1.60.2) + sorbet-runtime tapioca - webmock - webrick - yard BUNDLED WITH - 2.4.1 + 2.5.23 diff --git a/README.md b/README.md index d36e69d3..5febe652 100644 --- a/README.md +++ b/README.md @@ -1,237 +1,470 @@ -# Moderation API Ruby library + +# Moderation API Ruby SDK -The Moderation API Ruby library provides convenient access to the Moderation API REST API from any Ruby 3.2.0+ application. It ships with comprehensive types & docstrings in Yard, RBS, and RBI – [see below](https://github.com/moderation-api/sdk-ruby#Sorbet) for usage with Sorbet. The standard library's `net/http` is used as the HTTP transport, with connection pooling via the `connection_pool` gem. +[![Gem](https://img.shields.io/gem/v/moderation_api.svg)](https://rubygems.org/gems/moderation_api) -## Documentation +The official Ruby library for [Moderation API](https://moderationapi.com). Use it to moderate text, images, video and audio, manage authors, review queues, actions and wordlists, and verify webhooks. It includes [Sorbet](https://sorbet.org) type signatures. -Documentation for releases of this gem can be found [on RubyDoc](https://gemdocs.org/gems/moderation_api). +- Get an API key in the [dashboard](https://dash.moderationapi.com). +- Read the [documentation](https://docs.moderationapi.com) and the [API reference](https://docs.moderationapi.com/api-reference/introduction). + -The REST API documentation can be found on [docs.moderationapi.com](https://docs.moderationapi.com). + +## Summary -## Installation +Moderation API: Moderate text, images, video and audio in real time, manage authors, review queues and actions, and receive webhooks. -To use this gem, install via Bundler by adding the following to your application's `Gemfile`: +More information about the API can be found at https://docs.moderationapi.com + - + +## Table of Contents + +* [Moderation API Ruby SDK](#moderation-api-ruby-sdk) + * [SDK Installation](#sdk-installation) + * [SDK Example Usage](#sdk-example-usage) + * [Moderating content](#moderating-content) + * [Verifying webhooks](#verifying-webhooks) + * [Authentication](#authentication) + * [Available Resources and Operations](#available-resources-and-operations) + * [Error Handling](#error-handling) + * [Server Selection](#server-selection) + * [Timeouts](#timeouts) + * [Requirements](#requirements) + * [Support](#support) +* [Development](#development) + * [Maturity](#maturity) + * [Contributions](#contributions) -```ruby -gem "moderation_api", "~> 2.41.0" + + + +## SDK Installation + +The SDK can be installed using [RubyGems](https://rubygems.org/): + +```bash +gem install moderation_api ``` + - + +## SDK Example Usage -## Usage +### Example ```ruby -require "bundler/setup" require "moderation_api" -moderation_api = ModerationAPI::Client.new( - secret_key: ENV["MODAPI_SECRET_KEY"] # This is the default and can be omitted +Models = ::ModerationApi::Models +s = ::ModerationApi::ModerationApi.new( + secret_key: "" +) + +req = Models::Operations::SubmitContentRequest.new( + content: Models::Operations::TextRequest.new( + type: "text", + text: "Hey, check out my profile for a deal!" + ), + content_id: "message-48213", + author_id: "user-1092", + conversation_id: "room-general", + metadata: { + "platform" => "ios" + } ) +res = s.content.submit(request: req) -response = moderation_api.content.submit(content: {text: "text", type: "text"}) +unless res.object.nil? + # handle response +end -puts(response.recommendation) ``` + + +## Moderating content -### Handling errors +Use `content.submit` to moderate text, images, video, audio, or objects with several fields. All parameters except `content` are optional. -When the library is unable to connect to the API, or if the API returns a non-success status code (i.e., 4xx or 5xx response), a subclass of `ModerationAPI::Errors::APIError` will be thrown: +Pass your API key as `secret_key`. The examples read it from the `MODAPI_SECRET_KEY` environment variable. ```ruby -begin - content = moderation_api.content.submit(content: {text: "text", type: "text"}) -rescue ModerationAPI::Errors::APIConnectionError => e - puts("The server could not be reached") - puts(e.cause) # an underlying Exception, likely raised within `net/http` -rescue ModerationAPI::Errors::RateLimitError => e - puts("A 429 status code was received; we should back off a bit.") -rescue ModerationAPI::Errors::APIStatusError => e - puts("Another non-200-range status code was received") - puts(e.status) +require "moderation_api" + +Operations = ModerationApi::Models::Operations +client = ModerationApi::ModerationApi.new(secret_key: ENV.fetch("MODAPI_SECRET_KEY")) + +# Text +client.content.submit(request: Operations::SubmitContentRequest.new( + content: Operations::TextRequest.new(text: "Your text here"), + content_id: "message-123", # your ID for the content + author_id: "user-123", # your ID for the user who wrote it + conversation_id: "room-123", # groups related content + metadata: { platform: "ios" } +)) + +# Image, video and audio: send a URL +client.content.submit(request: Operations::SubmitContentRequest.new( + content: Operations::ImageRequest.new(url: "https://example.com/image.jpg") +)) +client.content.submit(request: Operations::SubmitContentRequest.new( + content: Operations::VideoRequest.new(url: "https://example.com/video.mp4") +)) +client.content.submit(request: Operations::SubmitContentRequest.new( + content: Operations::AudioRequest.new(url: "https://example.com/audio.mp3") +)) + +# An object with several fields, moderated together +client.content.submit(request: Operations::SubmitContentRequest.new( + content: Operations::Object.new(data: { + title: Operations::DataText.new(text: "Post title"), + body: Operations::DataText.new(text: "Post content"), + thumbnail: Operations::DataImage.new(url: "https://example.com/thumb.jpg") + }) +)) +``` + +### Using the result + +`evaluation.flagged` tells you if any policy flagged the content. `recommendation.action` is the action the API recommends after it applies your thresholds and rules: `allow`, `review` or `reject`. + +```ruby +response = client.content.submit(request: Operations::SubmitContentRequest.new( + content: Operations::TextRequest.new(text: "Some content") +)) +result = response.object + +puts "A policy flagged the content" if result.evaluation.flagged + +case result.recommendation.action.serialize +when "reject" + # Block the content +when "review" + # Publish or hold it, and send it to a review queue +when "allow" + # Publish the content +end + +result.policies.each do |policy| + puts "#{policy.id}: flagged=#{policy.flagged}" end ``` -Error codes are as follows: +## Verifying webhooks -| Cause | Error Type | -| ---------------- | -------------------------- | -| HTTP 400 | `BadRequestError` | -| HTTP 401 | `AuthenticationError` | -| HTTP 403 | `PermissionDeniedError` | -| HTTP 404 | `NotFoundError` | -| HTTP 409 | `ConflictError` | -| HTTP 422 | `UnprocessableEntityError` | -| HTTP 429 | `RateLimitError` | -| HTTP >= 500 | `InternalServerError` | -| Other HTTP error | `APIStatusError` | -| Timeout | `APITimeoutError` | -| Network error | `APIConnectionError` | +Moderation API signs every webhook delivery with your project's webhook signing secret. The signature is in the `modapi-signature` header. -### Retries +### Webhook signing secret -Certain errors will be automatically retried 2 times by default, with a short exponential backoff. +Find the secret on the [API keys page in the dashboard](https://dash.moderationapi.com/project/latest/configure/api-keys), or get it with `client.webhook_secret.retrieve`. Store it in the `MODAPI_WEBHOOK_SECRET` environment variable. It is not your API key. Get it once, for example in a setup script, and do not call `retrieve` for each delivery, so verification does not depend on a call to the API. Keep it as secret as your API key: anyone with it can sign webhooks. -Connection errors (for example, due to a network connectivity problem), 408 Request Timeout, 409 Conflict, 429 Rate Limit, >=500 Internal errors, and timeouts will all be retried by default. +### Verify a delivery -You can use the `max_retries` option to configure or disable this: +`ModerationApi::WebhookSignature.construct_event` checks the signature against the raw body and returns the event as a Hash. It reads the secret from `MODAPI_WEBHOOK_SECRET`; to set it in code, pass it as the third argument. It raises `ModerationApi::WebhookSignature::VerificationError` if the signature does not match. ```ruby -# Configure the default for all requests: -moderation_api = ModerationAPI::Client.new( - max_retries: 0 # default is 2 -) +require "moderation_api/webhook_signature" -# Or, configure per-request: -moderation_api.content.submit(content: {text: "text", type: "text"}, request_options: {max_retries: 5}) +# For example, in a Rails controller +def moderation_webhook + event = ModerationApi::WebhookSignature.construct_event( + request.raw_post, # the raw body, not parsed JSON + request.headers["modapi-signature"] + ) + Rails.logger.info(event["type"]) + head :ok +rescue ModerationApi::WebhookSignature::VerificationError + head :bad_request +end ``` + + + + +## Authentication -### Timeouts +### Per-Client Security Schemes -By default, requests will time out after 60 seconds. You can use the timeout option to configure or disable this: +This SDK supports the following security scheme globally: +| Name | Type | Scheme | +| ------------ | ---- | ----------- | +| `secret_key` | http | HTTP Bearer | + +To authenticate with the API the `secret_key` parameter must be set when initializing the SDK client instance. For example: ```ruby -# Configure the default for all requests: -moderation_api = ModerationAPI::Client.new( - timeout: nil # default is 60 +require "moderation_api" + +Models = ::ModerationApi::Models +s = ::ModerationApi::ModerationApi.new( + secret_key: "" ) -# Or, configure per-request: -moderation_api.content.submit(content: {text: "text", type: "text"}, request_options: {timeout: 5}) +req = Models::Operations::ListAuthorsRequest.new +res = s.authors.list(request: req) + +unless res.object.nil? + # handle response +end + ``` + + +### Project and organization keys -On timeout, `ModerationAPI::Errors::APITimeoutError` is raised. +Moderation API has two kinds of API keys: -Note that requests that time out are retried by default. +- A **project key** works with one project: content, authors, review queues, actions, wordlists, webhooks and the account. Most integrations need only this key. +- An **organization key** works with the [management API](https://docs.moderationapi.com/api-reference/management-api): projects and channels. The management API is available on Enterprise plans. -## Advanced concepts +Each key works only with its own endpoints. With the wrong key the API returns `403` with the code `project_key_required` or `organization_key_required`. If you use both, create one client for each key: -### BaseModel +```ruby +require "moderation_api" -All parameter and response objects inherit from `ModerationAPI::Internal::Type::BaseModel`, which provides several conveniences, including: +# Project key +client = ModerationApi::ModerationApi.new(secret_key: ENV.fetch("MODAPI_SECRET_KEY")) -1. All fields, including unknown ones, are accessible with `obj[:prop]` syntax, and can be destructured with `obj => {prop: prop}` or pattern-matching syntax. +# Organization key +management = ModerationApi::ModerationApi.new(secret_key: ENV.fetch("MODAPI_ORGANIZATION_KEY")) -2. Structural equivalence for equality; if two API calls return the same values, comparing the responses with == will return true. +management.projects.list.each do |page| + page.object.data.each { |project| puts "#{project.id} #{project.name}" } +end +``` -3. Both instances and the classes themselves can be pretty-printed. +Create the organization client only where you manage projects and channels, for example in a setup script, and keep the organization key out of the code that moderates content. + -4. Helpers such as `#to_h`, `#deep_to_h`, `#to_json`, and `#to_yaml`. -### Making custom or undocumented requests + +## Available Resources and Operations -#### Undocumented properties +
+Available methods -You can send undocumented parameters to any endpoint, and read undocumented response properties, like so: +### [Account](docs/sdks/account/README.md) -Note: the `extra_` parameters of the same name overrides the documented parameters. +* [retrieve](docs/sdks/account/README.md#retrieve) - Get account details -```ruby -response = - moderation_api.content.submit( - content: {text: "text", type: "text"}, - request_options: { - extra_query: {my_query_parameter: value}, - extra_body: {my_body_parameter: value}, - extra_headers: {"my-header": value} - } - ) +### [Actions](docs/sdks/actions/README.md) -puts(response[:my_undocumented_property]) -``` +* [list](docs/sdks/actions/README.md#list) - List moderation actions +* [create](docs/sdks/actions/README.md#create) - Create an action +* [retrieve](docs/sdks/actions/README.md#retrieve) - Get an action +* [update](docs/sdks/actions/README.md#update) - Update an action +* [delete](docs/sdks/actions/README.md#delete) - Delete an action +* [execute](docs/sdks/actions/README.md#execute) - Execute moderation action -#### Undocumented request params +### [Authors](docs/sdks/authors/README.md) -If you want to explicitly send an extra param, you can do so with the `extra_query`, `extra_body`, and `extra_headers` under the `request_options:` parameter when making a request, as seen in the examples above. +* [list](docs/sdks/authors/README.md#list) - List authors +* [create](docs/sdks/authors/README.md#create) - Create a new author +* [retrieve](docs/sdks/authors/README.md#retrieve) - Get author details +* [update](docs/sdks/authors/README.md#update) - Update author details +* [delete](docs/sdks/authors/README.md#delete) - Delete an author -#### Undocumented endpoints +### [Channels](docs/sdks/channels/README.md) -To make requests to undocumented endpoints while retaining the benefit of auth, retries, and so on, you can make requests using `client.request`, like so: +* [list](docs/sdks/channels/README.md#list) - List channels +* [create](docs/sdks/channels/README.md#create) - Create a channel +* [retrieve](docs/sdks/channels/README.md#retrieve) - Get a channel +* [update](docs/sdks/channels/README.md#update) - Update a channel +* [delete](docs/sdks/channels/README.md#delete) - Delete a channel +* [duplicate](docs/sdks/channels/README.md#duplicate) - Duplicate a channel -```ruby -response = client.request( - method: :post, - path: '/undocumented/endpoint', - query: {"dog": "woof"}, - headers: {"useful-header": "interesting-value"}, - body: {"hello": "world"} -) -``` +### [Content](docs/sdks/content/README.md) -### Concurrency & connection pooling +* [submit](docs/sdks/content/README.md#submit) -The `ModerationAPI::Client` instances are threadsafe, but are only are fork-safe when there are no in-flight HTTP requests. +### [Projects](docs/sdks/projects/README.md) -Each instance of `ModerationAPI::Client` has its own HTTP connection pool with a default size of 99. As such, we recommend instantiating the client once per application in most settings. +* [list](docs/sdks/projects/README.md#list) - List projects +* [create](docs/sdks/projects/README.md#create) - Create a project +* [retrieve](docs/sdks/projects/README.md#retrieve) - Get a project +* [update](docs/sdks/projects/README.md#update) - Update a project +* [delete](docs/sdks/projects/README.md#delete) - Delete a project +* [duplicate](docs/sdks/projects/README.md#duplicate) - Duplicate a project -When all available connections from the pool are checked out, requests wait for a new connection to become available, with queue time counting towards the request timeout. +### [Queue](docs/sdks/queue/README.md) -Unless otherwise specified, other classes in the SDK do not have locks protecting their underlying data structure. +* [retrieve](docs/sdks/queue/README.md#retrieve) - Get a queue +* [get_stats](docs/sdks/queue/README.md#get_stats) - Get queue statistics -## Sorbet +#### [Queue.Items](docs/sdks/items/README.md) -This library provides comprehensive [RBI](https://sorbet.org/docs/rbi) definitions, and has no dependency on sorbet-runtime. +* [list](docs/sdks/items/README.md#list) - Get queue items +* [resolve](docs/sdks/items/README.md#resolve) - Resolve a queue item +* [unresolve](docs/sdks/items/README.md#unresolve) - Unresolve a queue item -You can provide typesafe request parameters like so: +### [Webhooks](docs/sdks/webhooks/README.md) -```ruby -moderation_api.content.submit( - content: ModerationAPI::ContentSubmitParams::Content::Text.new(text: "text") -) -``` +* [list](docs/sdks/webhooks/README.md#list) - List webhooks +* [create](docs/sdks/webhooks/README.md#create) - Create a webhook +* [retrieve](docs/sdks/webhooks/README.md#retrieve) - Get a webhook +* [update](docs/sdks/webhooks/README.md#update) - Update a webhook +* [delete](docs/sdks/webhooks/README.md#delete) - Delete a webhook + +### [WebhookSecret](docs/sdks/webhooksecret/README.md) + +* [retrieve](docs/sdks/webhooksecret/README.md#retrieve) - Get the webhook signing secret + +### [Wordlist](docs/sdks/wordlist/README.md) + +* [list](docs/sdks/wordlist/README.md#list) - List wordlists +* [retrieve](docs/sdks/wordlist/README.md#retrieve) - Get wordlist +* [update](docs/sdks/wordlist/README.md#update) - Update wordlist +* [get_embedding_status](docs/sdks/wordlist/README.md#get_embedding_status) - Get embedding status + +#### [Wordlist.Words](docs/sdks/words/README.md) + +* [add](docs/sdks/words/README.md#add) - Add words to wordlist +* [remove](docs/sdks/words/README.md#remove) - Remove words from wordlist -Or, equivalently: +
+ + + +## Error Handling + +Handling errors in this SDK should largely match your expectations. All operations return a response object or raise an error. + +By default an API error will raise a `Errors::APIError`, which has the following properties: + +| Property | Type | Description | +|----------------|-----------------------------------------|-----------------------| +| `message` | *string* | The error message | +| `status_code` | *int* | The HTTP status code | +| `raw_response` | *Faraday::Response* | The raw HTTP response | +| `body` | *string* | The response content | + +When custom error responses are specified for an operation, the SDK may also throw their associated exception. You can refer to respective *Errors* tables in SDK docs for more details on possible exception types for each operation. For example, the `list` method throws the following exceptions: + +| Error Type | Status Code | Content Type | +| ------------------------------------- | ----------- | ---------------- | +| Models::Errors::BadRequestError | 400 | application/json | +| Models::Errors::AuthenticationError | 401 | application/json | +| Models::Errors::PermissionDeniedError | 403 | application/json | +| Models::Errors::NotFoundError | 404 | application/json | +| Models::Errors::RateLimitError | 429 | application/json | +| Models::Errors::InternalServerError | 500 | application/json | +| Errors::APIError | 4XX, 5XX | \*/\* | + +### Example ```ruby -# Hashes work, but are not typesafe: -moderation_api.content.submit(content: {text: "text", type: "text"}) +require "moderation_api" -# You can also splat a full Params class: -params = ModerationAPI::ContentSubmitParams.new( - content: ModerationAPI::ContentSubmitParams::Content::Text.new(text: "text") +Models = ::ModerationApi::Models +s = ::ModerationApi::ModerationApi.new( + secret_key: "" ) -moderation_api.content.submit(**params) + +begin + req = Models::Operations::ListAuthorsRequest.new + res = s.authors.list(request: req) + + unless res.object.nil? + # handle response + end + +rescue Models::Errors::BadRequestError => e + # handle e.container data + raise e +rescue Models::Errors::AuthenticationError => e + # handle e.container data + raise e +rescue Models::Errors::PermissionDeniedError => e + # handle e.container data + raise e +rescue Models::Errors::NotFoundError => e + # handle e.container data + raise e +rescue Models::Errors::RateLimitError => e + # handle e.container data + raise e +rescue Models::Errors::InternalServerError => e + # handle e.container data + raise e +rescue Errors::APIError => e + # handle default exception + raise e +end + ``` + -### Enums + +## Server Selection -Since this library does not depend on `sorbet-runtime`, it cannot provide [`T::Enum`](https://sorbet.org/docs/tenum) instances. Instead, we provide "tagged symbols" instead, which is always a primitive at runtime: +### Override Server URL Per-Client +The default server can be overridden globally by passing a URL to the `server_url (String)` optional parameter when initializing the SDK client instance. For example: ```ruby -# :trustLevel -puts(ModerationAPI::AuthorListParams::SortBy::TRUST_LEVEL) +require "moderation_api" + +Models = ::ModerationApi::Models +s = ::ModerationApi::ModerationApi.new( + server_url: "https://moderationapi.com/api/v1", + secret_key: "" +) + +req = Models::Operations::ListAuthorsRequest.new +res = s.authors.list(request: req) + +unless res.object.nil? + # handle response +end -# Revealed type: `T.all(ModerationAPI::AuthorListParams::SortBy, Symbol)` -T.reveal_type(ModerationAPI::AuthorListParams::SortBy::TRUST_LEVEL) ``` + -Enum parameters have a "relaxed" type, so you can either pass in enum constants or their literal value: + + + +## Timeouts + +Set a timeout in milliseconds for all requests on the client, or for one request: ```ruby -# Using the enum constants preserves the tagged type information: -moderation_api.authors.list( - sort_by: ModerationAPI::AuthorListParams::SortBy::TRUST_LEVEL, - # … +client = ModerationApi::ModerationApi.new( + secret_key: ENV.fetch("MODAPI_SECRET_KEY"), + timeout_ms: 10_000 ) -# Literal values are also permissible: -moderation_api.authors.list( - sort_by: :trustLevel, - # … +client.content.submit( + request: Operations::SubmitContentRequest.new(content: Operations::TextRequest.new(text: "Hello")), + timeout_ms: 5_000 ) ``` -## Versioning +## Requirements -This package follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions. As the library is in initial development and has a major version of `0`, APIs may change at any time. +Ruby 3.2 or later. -This package considers improvements to the (non-runtime) `*.rbi` and `*.rbs` type definitions to be non-breaking changes. -## Requirements +## Support + +- [API reference](https://docs.moderationapi.com/api-reference/introduction) +- [Errors and error codes](https://docs.moderationapi.com/api-reference/errors) +- [Rate limits](https://docs.moderationapi.com/api-reference/rate-limits) +- [Guides](https://docs.moderationapi.com/get-started/introduction) +- Email [support@moderationapi.com](mailto:support@moderationapi.com) + +Found a bug? Open an issue in this repository. This package is generated from the [Moderation API OpenAPI spec](https://api.moderationapi.com/v1/openapi.json), so pull requests to the generated code can't be merged as they are, but we use them to fix the generator. + + +# Development + +## Maturity + +This SDK is in beta, and there may be breaking changes between versions without a major version update. Therefore, we recommend pinning usage +to a specific package version. This way, you can install the same version each time without breaking changes unless you are intentionally +looking for the latest version. -Ruby 3.2.0 or higher. +## Contributions -## Contributing +While we value open-source contributions to this SDK, this library is generated programmatically. Any manual changes added to internal files will be overwritten on the next generation. +We look forward to hearing your feedback. Feel free to open a PR or an issue with a proof of concept and we'll do our best to include it in a future release. -See [the contributing documentation](https://github.com/moderation-api/sdk-ruby/tree/main/CONTRIBUTING.md). +### SDK Created by [Speakeasy](https://www.speakeasy.com/?utm_source=moderation-api&utm_campaign=ruby) diff --git a/Rakefile b/Rakefile index 7ca5d925..5feb18be 100644 --- a/Rakefile +++ b/Rakefile @@ -1,177 +1,42 @@ +# typed: true # frozen_string_literal: true -require "etc" -require "pathname" -require "securerandom" -require "shellwords" +require 'bundler/gem_tasks' +require 'minitest/test_task' +require 'rubocop/rake_task' -require "minitest/test_task" -require "rake/clean" -require "rubocop/rake_task" - -tapioca = "sorbet/tapioca" -examples = "examples" -ignore_file = ".ignore" - -FILES_ENV = "FORMAT_FILE" - -CLEAN.push(*%w[.idea/ .ruby-lsp/ .yardoc/ doc/], *FileList["*.gem"], ignore_file) - -CLOBBER.push(*%w[sorbet/rbi/annotations/ sorbet/rbi/gems/], tapioca) - -multitask(:default) do - sh(*%w[rake --tasks]) +RuboCop::RakeTask.new do |task| + task.options = ['--parallel'] end -desc("Preview docs; use `PORT=` to change the port") -multitask(:"docs:preview") do - sh(*%w[yard server --reload --quiet --bind [::] --port], ENV.fetch("PORT", "8808")) +Minitest::TestTask.create do |t| + # workaround to avoid throwing warnings from Janeway library circular require... + t.warning = false end -desc("Run test suites; use `TEST=path/to/test.rb` to run a specific test file") -multitask(:test) do - rb = - FileList[ENV.fetch("TEST", "./test/**/*_test.rb")] - .map { "require_relative(#{_1.dump});" } - .join +namespace :sorbet do + desc "Remove legacy Sorbet artifacts like extra.rbi" + task :clean do + extra = File.join(__dir__, "extra.rbi") - ruby(*%w[-w -e], rb, verbose: false) { fail unless _1 } -end - -# Cap parallelism at the CPU count. `--max-procs=0` spawns one process per -# 300-file batch with no upper bound; on large SDKs (thousands of files) that -# oversubscribes CPUs and stacks up rubocop processes, exhausting memory and -# slowing CI to the point of timing out. -xargs = %W[xargs --no-run-if-empty --null --max-procs=#{Etc.nprocessors} --max-args=300 --] -ruby_opt = {"RUBYOPT" => [ENV["RUBYOPT"], "--encoding=UTF-8"].compact.join(" ")} - -filtered = ->(ext, dirs) do - if ENV.key?(FILES_ENV) - %w[sed -E -n -e] << "/\\.#{ext}$/p" << "--" << ENV.fetch(FILES_ENV) - else - (%w[find] + dirs + %w[-type f -and -name]) << "*.#{ext}" << "-print0" + if File.exist?(extra) + puts "Removing legacy file: extra.rbi" + File.delete(extra) + else + puts "extra.rbi not present — nothing to clean" + end end end -desc("Lint `*.rb(i)`") -multitask(:"lint:rubocop") do - find = %w[find ./lib ./test ./rbi ./examples -type f -and ( -name *.rb -or -name *.rbi ) -print0] - - rubocop = %w[rubocop] - rubocop += %w[--format github] if ENV.key?("CI") - - # some lines cannot be shortened - rubocop += %w[--except Lint/RedundantCopDisableDirective,Layout/LineLength] - - lint = xargs + rubocop - sh("#{find.shelljoin} | #{lint.shelljoin}") -end - -norm_lines = %w[tr -- \n \0].shelljoin - -desc("Format `*.rb`") -multitask(:"format:rb") do - # while `syntax_tree` is much faster than `rubocop`, `rubocop` is the only formatter with full syntax support - files = filtered["rb", %w[./lib ./test ./examples]] - fmt = xargs + %w[rubocop --fail-level F --autocorrect --format simple --] - sh("#{files.shelljoin} | #{norm_lines} | #{fmt.shelljoin}") -end - -desc("Format `*.rbi`") -multitask(:"format:rbi") do - files = filtered["rbi", %w[./rbi]] - fmt = xargs + %w[stree write --] - sh(ruby_opt, "#{files.shelljoin} | #{norm_lines} | #{fmt.shelljoin}") -end - -desc("Format `*.rbs`") -multitask(:"format:rbs") do - files = filtered["rbs", %w[./sig]] - inplace = /darwin|bsd/ =~ RUBY_PLATFORM ? ["-i", ""] : %w[-i] - uuid = SecureRandom.uuid - - # `syntax_tree` has trouble with `rbs`'s class & module aliases - - sed_bin = /darwin/ =~ RUBY_PLATFORM ? "/usr/bin/sed" : "sed" - sed = xargs + [sed_bin, "-E", *inplace, "-e"] - # annotate unprocessable aliases with a unique comment - pre = sed + ["s/(class|module) ([^ ]+) = (.+$)/# \\1 #{uuid}\\n\\2: \\3/", "--"] - fmt = xargs + %w[stree write --plugin=rbs --] - # remove the unique comment and unprocessable aliases to type aliases - subst = <<~SED - s/# (class|module) #{uuid}/\\1/ - t l1 - b - - : l1 - N - s/\\n *([^:]+): (.+)$/ \\1 = \\2/ - SED - # for each line: - # 1. try transform the unique comment into `class | module`, if successful, branch to label `l1`. - # 2. at label `l1`, join previously annotated line with `class | module` information. - pst = sed + [subst, "--"] +task :default => :test - success = false - # transform class aliases to type aliases, which syntax tree has no trouble with - sh("#{files.shelljoin} | #{norm_lines} | #{pre.shelljoin}") - # run syntax tree to format `*.rbs` files - sh(ruby_opt, "#{files.shelljoin} | #{norm_lines} | #{fmt.shelljoin}") do - success = _1 - end - # transform type aliases back to class aliases - sh("#{files.shelljoin} | #{norm_lines} | #{pst.shelljoin}") - - # always run post-processing to remove comment marker - fail unless success -end - -desc("Format everything") -multitask(format: [:"format:rb", :"format:rbi", :"format:rbs"]) - -desc("Typecheck `*.rbs`") -multitask(:"typecheck:steep") do - sh(*%w[steep check]) -end - -directory(examples) - -desc("Typecheck `*.rbi`") -multitask("typecheck:sorbet": examples) do - sh(*%w[srb typecheck --dir], examples) -end - -directory(tapioca) do - sh(*%w[tapioca init]) -end - -desc("Typecheck everything") -multitask(typecheck: [:"typecheck:steep", :"typecheck:sorbet"]) - -desc("Lint and typecheck") -multitask(lint: [:"lint:rubocop", :typecheck]) - -desc("Build yard docs") -multitask(:"build:docs") do - sh(*%w[yard]) -end - -desc("Build ruby gem") -multitask(:"build:gem") do - # optimizing for grepping through the gem bundle: many tools honour `.ignore` files, including VSCode - # - # both `rbi` and `sig` directories are navigable by their respective tool chains and therefore can be ignored by tools such as `rg` - Pathname(ignore_file).write(<<~GLOB) - rbi/* - sig/* - GLOB - - sh(*%w[gem build -- moderation_api.gemspec]) - rm_rf(ignore_file) -end - -desc("Release ruby gem") -multitask(release: [:"build:gem"]) do - sh(*%w[gem push], *FileList["*.gem"]) -end +# Developers can run all tests with: +# +# $ rake test +# +# Developers can run individual test files with: +# +# $ rake test test/parameter_test +# +# and run individual tests by adding `focus` to the line before the test definition. \ No newline at end of file diff --git a/SECURITY.md b/SECURITY.md deleted file mode 100644 index 29cf6381..00000000 --- a/SECURITY.md +++ /dev/null @@ -1,27 +0,0 @@ -# Security Policy - -## Reporting Security Issues - -This SDK is generated by [Stainless Software Inc](http://stainless.com). Stainless takes security seriously, and encourages you to report any security vulnerability promptly so that appropriate action can be taken. - -To report a security issue, please contact the Stainless team at security@stainless.com. - -## Responsible Disclosure - -We appreciate the efforts of security researchers and individuals who help us maintain the security of -SDKs we generate. If you believe you have found a security vulnerability, please adhere to responsible -disclosure practices by allowing us a reasonable amount of time to investigate and address the issue -before making any information public. - -## Reporting Non-SDK Related Security Issues - -If you encounter security issues that are not directly related to SDKs but pertain to the services -or products provided by Moderation API, please follow the respective company's security reporting guidelines. - -### Moderation API Terms and Policies - -Please contact support@moderationapi.com for any questions or concerns regarding the security of our services. - ---- - -Thank you for helping us keep the SDKs and systems they interact with secure. diff --git a/Steepfile b/Steepfile deleted file mode 100644 index 528b48c3..00000000 --- a/Steepfile +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -require "yaml" - -target(:lib) do - configure_code_diagnostics(Steep::Diagnostic::Ruby.strict) - - signature("sig") - - YAML.safe_load_file("./manifest.yaml", symbolize_names: true) => {dependencies:} - # currently these libraries lack the `*.rbs` annotations required by `steep` - stdlibs = dependencies - %w[English etc net/http rbconfig set stringio] - - stdlibs.each { library(_1) } -end diff --git a/USAGE.md b/USAGE.md new file mode 100644 index 00000000..b95f03ca --- /dev/null +++ b/USAGE.md @@ -0,0 +1,29 @@ + +```ruby +require "moderation_api" + +Models = ::ModerationApi::Models +s = ::ModerationApi::ModerationApi.new( + secret_key: "" +) + +req = Models::Operations::SubmitContentRequest.new( + content: Models::Operations::TextRequest.new( + type: "text", + text: "Hey, check out my profile for a deal!" + ), + content_id: "message-48213", + author_id: "user-1092", + conversation_id: "room-general", + metadata: { + "platform" => "ios" + } +) +res = s.content.submit(request: req) + +unless res.object.nil? + # handle response +end + +``` + \ No newline at end of file diff --git a/bin/check-release-environment b/bin/check-release-environment deleted file mode 100644 index c05436e8..00000000 --- a/bin/check-release-environment +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env bash - -errors=() - -if [ -z "${GEM_HOST_API_KEY}" ]; then - errors+=("The GEM_HOST_API_KEY secret has not been set. Please set it in either this repository's secrets or your organization secrets") -fi - -lenErrors=${#errors[@]} - -if [[ lenErrors -gt 0 ]]; then - echo -e "Found the following errors in the release environment:\n" - - for error in "${errors[@]}"; do - echo -e "- $error\n" - done - - exit 1 -fi - -echo "The environment is ready to push releases!" diff --git a/bin/publish-gem b/bin/publish-gem deleted file mode 100644 index 8444af20..00000000 --- a/bin/publish-gem +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/env bash - -set -Eeuo pipefail - -cd -- "$(dirname -- "$0")/.." - -bundle -find . -maxdepth 1 -type f -name "*.gem" -delete -rake release \ No newline at end of file diff --git a/docs/models/components/authenticationerrorcode.md b/docs/models/components/authenticationerrorcode.md new file mode 100644 index 00000000..da5e2d76 --- /dev/null +++ b/docs/models/components/authenticationerrorcode.md @@ -0,0 +1,29 @@ +# AuthenticationErrorCode + +Exactly what went wrong. Stable; safe to branch on. New codes may be added. + +- `unauthorized`: Authentication failed. +- `missing_api_key`: No API key in the `Authorization` header. +- `malformed_api_key`: The `Authorization` header does not contain a valid key format. +- `invalid_api_key`: The API key does not exist or was revoked. + +## Example Usage + +```ruby +require "moderation_api" + +value = AuthenticationErrorCode::UNAUTHORIZED + +# Open enum: use .deserialize() to create instances from custom string values +custom = AuthenticationErrorCode.deserialize("custom_value") +``` + + +## Values + +| Name | Value | +| ------------------- | ------------------- | +| `UNAUTHORIZED` | unauthorized | +| `MISSING_API_KEY` | missing_api_key | +| `MALFORMED_API_KEY` | malformed_api_key | +| `INVALID_API_KEY` | invalid_api_key | \ No newline at end of file diff --git a/docs/models/components/badrequesterrorcode.md b/docs/models/components/badrequesterrorcode.md new file mode 100644 index 00000000..0125f391 --- /dev/null +++ b/docs/models/components/badrequesterrorcode.md @@ -0,0 +1,25 @@ +# BadRequestErrorCode + +Exactly what went wrong. Stable; safe to branch on. New codes may be added. + +- `invalid_request`: A parameter is invalid. `message` says which one. +- `validation_failed`: The request body does not match the schema. `issues` lists each problem with its `path`. + +## Example Usage + +```ruby +require "moderation_api" + +value = BadRequestErrorCode::INVALID_REQUEST + +# Open enum: use .deserialize() to create instances from custom string values +custom = BadRequestErrorCode.deserialize("custom_value") +``` + + +## Values + +| Name | Value | +| ------------------- | ------------------- | +| `INVALID_REQUEST` | invalid_request | +| `VALIDATION_FAILED` | validation_failed | \ No newline at end of file diff --git a/docs/models/components/block.md b/docs/models/components/block.md new file mode 100644 index 00000000..bb1b5966 --- /dev/null +++ b/docs/models/components/block.md @@ -0,0 +1,9 @@ +# Block + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | +| `until_` | *T.nilable(::Float)* | :heavy_minus_sign: | The timestamp until which they are blocked if the author is suspended. | +| `reason` | *T.nilable(::String)* | :heavy_minus_sign: | The moderators reason why the author was blocked or suspended. | \ No newline at end of file diff --git a/docs/models/components/channel.md b/docs/models/components/channel.md new file mode 100644 index 00000000..2c72d6e7 --- /dev/null +++ b/docs/models/components/channel.md @@ -0,0 +1,28 @@ +# Channel + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | +| `id` | *::String* | :heavy_check_mark: | The ID of the channel. | +| `project_id` | *::String* | :heavy_check_mark: | The ID of the project the channel is in. | +| `key` | *::String* | :heavy_check_mark: | The key you pass as `channel` when you moderate content. Unique in the project. | +| `name` | *::String* | :heavy_check_mark: | The channel's name. | +| `description` | *T.nilable(::String)* | :heavy_check_mark: | The channel's description. | +| `is_default` | *T::Boolean* | :heavy_check_mark: | Whether requests that name no channel use this one. Each project has one default channel. | +| `content_type` | [T.nilable(Models::Components::ContentType)](../../models/shared/contenttype.md) | :heavy_check_mark: | N/A | +| `flagging_mode` | [Models::Components::FlaggingMode](../../models/shared/flaggingmode.md) | :heavy_check_mark: | `ACTIVE` flags content. `DRY_RUN` evaluates content without flagging it. | +| `context_enabled` | *T::Boolean* | :heavy_check_mark: | Whether earlier messages in the conversation are read when moderating a message. | +| `enable_image_moderation` | *T::Boolean* | :heavy_check_mark: | Whether images are moderated. | +| `enable_video_moderation` | *T::Boolean* | :heavy_check_mark: | Whether videos are moderated. | +| `enable_audio_moderation` | *T::Boolean* | :heavy_check_mark: | Whether audio is moderated. | +| `enable_voice_moderation` | *T::Boolean* | :heavy_check_mark: | Whether real-time voice streams are moderated. | +| `include_transcript_in_response` | *T::Boolean* | :heavy_check_mark: | Whether audio and video transcripts are returned in responses. | +| `transcription_quality` | [Models::Components::TranscriptionQuality](../../models/shared/transcriptionquality.md) | :heavy_check_mark: | Trade-off between transcription speed and accuracy. | +| `unicode_spoof_detection_enabled` | *T::Boolean* | :heavy_check_mark: | Whether look-alike Unicode characters are normalized before moderation. | +| `frame_capture_interval` | *::Float* | :heavy_check_mark: | Seconds between frames captured from a video. | +| `max_frames_per_video` | *::Integer* | :heavy_check_mark: | The most frames moderated per video. | +| `spread_frames` | *T::Boolean* | :heavy_check_mark: | Whether frames are spread evenly across the whole video. | +| `created_at` | *::String* | :heavy_check_mark: | When the channel was created. | +| `updated_at` | *::String* | :heavy_check_mark: | When the channel was last changed. | \ No newline at end of file diff --git a/docs/models/components/conflicterrorcode.md b/docs/models/components/conflicterrorcode.md new file mode 100644 index 00000000..ab31d5a8 --- /dev/null +++ b/docs/models/components/conflicterrorcode.md @@ -0,0 +1,23 @@ +# ConflictErrorCode + +Exactly what went wrong. Stable; safe to branch on. New codes may be added. + +- `resource_conflict`: The request conflicts with an existing resource. + +## Example Usage + +```ruby +require "moderation_api" + +value = ConflictErrorCode::RESOURCE_CONFLICT + +# Open enum: use .deserialize() to create instances from custom string values +custom = ConflictErrorCode.deserialize("custom_value") +``` + + +## Values + +| Name | Value | +| ------------------- | ------------------- | +| `RESOURCE_CONFLICT` | resource_conflict | \ No newline at end of file diff --git a/docs/models/components/contenttype.md b/docs/models/components/contenttype.md new file mode 100644 index 00000000..346f3927 --- /dev/null +++ b/docs/models/components/contenttype.md @@ -0,0 +1,29 @@ +# ContentType + +The kind of content the channel moderates. + +## Example Usage + +```ruby +require "moderation_api" + +value = ContentType::PROFILE + +# Open enum: use .deserialize() to create instances from custom string values +custom = ContentType.deserialize("custom_value") +``` + + +## Values + +| Name | Value | +| --------- | --------- | +| `PROFILE` | profile | +| `MESSAGE` | message | +| `POST` | post | +| `COMMENT` | comment | +| `EVENT` | event | +| `PRODUCT` | product | +| `REVIEW` | review | +| `VOICE` | voice | +| `OTHER` | other | \ No newline at end of file diff --git a/docs/models/components/errorissue.md b/docs/models/components/errorissue.md new file mode 100644 index 00000000..65ebdd4c --- /dev/null +++ b/docs/models/components/errorissue.md @@ -0,0 +1,10 @@ +# ErrorIssue + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | +| `message` | *::String* | :heavy_check_mark: | What is wrong. | +| `path` | T::Array<[T.any(::String, ::Float)](../../models/shared/path.md)> | :heavy_minus_sign: | Location of the invalid field in the request body. | +| `code` | *T.nilable(::String)* | :heavy_minus_sign: | Validation rule that failed. | \ No newline at end of file diff --git a/docs/models/components/flaggingmode.md b/docs/models/components/flaggingmode.md new file mode 100644 index 00000000..d6eac8ee --- /dev/null +++ b/docs/models/components/flaggingmode.md @@ -0,0 +1,22 @@ +# FlaggingMode + +`ACTIVE` flags content. `DRY_RUN` evaluates content without flagging it. + +## Example Usage + +```ruby +require "moderation_api" + +value = FlaggingMode::DRY_RUN + +# Open enum: use .deserialize() to create instances from custom string values +custom = FlaggingMode.deserialize("custom_value") +``` + + +## Values + +| Name | Value | +| --------- | --------- | +| `DRY_RUN` | DRY_RUN | +| `ACTIVE` | ACTIVE | \ No newline at end of file diff --git a/docs/models/components/internalservererrorcode.md b/docs/models/components/internalservererrorcode.md new file mode 100644 index 00000000..c5003808 --- /dev/null +++ b/docs/models/components/internalservererrorcode.md @@ -0,0 +1,23 @@ +# InternalServerErrorCode + +Exactly what went wrong. Stable; safe to branch on. New codes may be added. + +- `internal_error`: Something went wrong on our side. Retry with backoff. + +## Example Usage + +```ruby +require "moderation_api" + +value = InternalServerErrorCode::INTERNAL_ERROR + +# Open enum: use .deserialize() to create instances from custom string values +custom = InternalServerErrorCode.deserialize("custom_value") +``` + + +## Values + +| Name | Value | +| ---------------- | ---------------- | +| `INTERNAL_ERROR` | internal_error | \ No newline at end of file diff --git a/docs/models/components/metadata.md b/docs/models/components/metadata.md new file mode 100644 index 00000000..7dd805a0 --- /dev/null +++ b/docs/models/components/metadata.md @@ -0,0 +1,14 @@ +# Metadata + +Additional metadata provided by your system. We recommend including any relevant information that may assist in the moderation process. + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------- | --------------------------------------------- | --------------------------------------------- | --------------------------------------------- | +| `email_verified` | *T.nilable(T::Boolean)* | :heavy_minus_sign: | Whether the author's email is verified | +| `phone_verified` | *T.nilable(T::Boolean)* | :heavy_minus_sign: | Whether the author's phone number is verified | +| `identity_verified` | *T.nilable(T::Boolean)* | :heavy_minus_sign: | Whether the author's identity is verified | +| `is_paying_customer` | *T.nilable(T::Boolean)* | :heavy_minus_sign: | Whether the author is a paying customer | +| `additional_properties` | T::Hash[Symbol, *::Object*] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/metrics.md b/docs/models/components/metrics.md new file mode 100644 index 00000000..d96d9b96 --- /dev/null +++ b/docs/models/components/metrics.md @@ -0,0 +1,10 @@ +# Metrics + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | +| `total_content` | *::Float* | :heavy_check_mark: | Total pieces of content | +| `flagged_content` | *::Float* | :heavy_check_mark: | Number of flagged content pieces | +| `average_sentiment` | *T.nilable(::Float)* | :heavy_minus_sign: | Average sentiment score of content (-1 to 1). Requires a sentiment model in your project. | \ No newline at end of file diff --git a/docs/models/components/notfounderrorcode.md b/docs/models/components/notfounderrorcode.md new file mode 100644 index 00000000..e5c6026d --- /dev/null +++ b/docs/models/components/notfounderrorcode.md @@ -0,0 +1,37 @@ +# NotFoundErrorCode + +Exactly what went wrong. Stable; safe to branch on. New codes may be added. + +- `resource_not_found`: The resource does not exist. +- `action_not_found`: The action does not exist. +- `author_not_found`: The author does not exist. +- `queue_not_found`: The review queue does not exist. +- `wordlist_not_found`: The wordlist does not exist. +- `webhook_not_found`: The webhook does not exist. +- `project_not_found`: The project does not exist. +- `channel_not_found`: The channel does not exist. + +## Example Usage + +```ruby +require "moderation_api" + +value = NotFoundErrorCode::RESOURCE_NOT_FOUND + +# Open enum: use .deserialize() to create instances from custom string values +custom = NotFoundErrorCode.deserialize("custom_value") +``` + + +## Values + +| Name | Value | +| -------------------- | -------------------- | +| `RESOURCE_NOT_FOUND` | resource_not_found | +| `ACTION_NOT_FOUND` | action_not_found | +| `AUTHOR_NOT_FOUND` | author_not_found | +| `QUEUE_NOT_FOUND` | queue_not_found | +| `WORDLIST_NOT_FOUND` | wordlist_not_found | +| `WEBHOOK_NOT_FOUND` | webhook_not_found | +| `PROJECT_NOT_FOUND` | project_not_found | +| `CHANNEL_NOT_FOUND` | channel_not_found | \ No newline at end of file diff --git a/docs/models/components/pagination.md b/docs/models/components/pagination.md new file mode 100644 index 00000000..c7b3edd2 --- /dev/null +++ b/docs/models/components/pagination.md @@ -0,0 +1,14 @@ +# Pagination + +Where this page is in the full list. + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------- | -------------------------------- | -------------------------------- | -------------------------------- | +| `page` | *::Integer* | :heavy_check_mark: | The current page, starting at 1. | +| `page_size` | *::Integer* | :heavy_check_mark: | Number of items per page. | +| `total` | *::Integer* | :heavy_check_mark: | Total number of items. | +| `total_pages` | *::Integer* | :heavy_check_mark: | Total number of pages. | +| `has_more` | *T::Boolean* | :heavy_check_mark: | Whether there is a next page. | \ No newline at end of file diff --git a/docs/models/components/path.md b/docs/models/components/path.md new file mode 100644 index 00000000..6ba7be88 --- /dev/null +++ b/docs/models/components/path.md @@ -0,0 +1,2 @@ +# Path + diff --git a/docs/models/components/permissiondeniederrorcode.md b/docs/models/components/permissiondeniederrorcode.md new file mode 100644 index 00000000..a57cc36c --- /dev/null +++ b/docs/models/components/permissiondeniederrorcode.md @@ -0,0 +1,39 @@ +# PermissionDeniedErrorCode + +Exactly what went wrong. Stable; safe to branch on. New codes may be added. + +- `permission_denied`: The API key cannot perform this request. +- `account_disabled`: The organization account is disabled. +- `quota_exceeded`: The organization has used all API requests on its plan. +- `plan_feature_unavailable`: The current plan does not include this feature. +- `plan_limit_exceeded`: The request goes over a limit of the current plan. +- `project_key_required`: This endpoint needs a project API key, but an organization key was used. +- `organization_key_required`: This endpoint needs an organization API key, but a project key was used. +- `missing_key_permission`: The organization key does not have the permission this endpoint needs. +- `project_not_reachable`: The organization key is limited to other projects. + +## Example Usage + +```ruby +require "moderation_api" + +value = PermissionDeniedErrorCode::PERMISSION_DENIED + +# Open enum: use .deserialize() to create instances from custom string values +custom = PermissionDeniedErrorCode.deserialize("custom_value") +``` + + +## Values + +| Name | Value | +| --------------------------- | --------------------------- | +| `PERMISSION_DENIED` | permission_denied | +| `ACCOUNT_DISABLED` | account_disabled | +| `QUOTA_EXCEEDED` | quota_exceeded | +| `PLAN_FEATURE_UNAVAILABLE` | plan_feature_unavailable | +| `PLAN_LIMIT_EXCEEDED` | plan_limit_exceeded | +| `PROJECT_KEY_REQUIRED` | project_key_required | +| `ORGANIZATION_KEY_REQUIRED` | organization_key_required | +| `MISSING_KEY_PERMISSION` | missing_key_permission | +| `PROJECT_NOT_REACHABLE` | project_not_reachable | \ No newline at end of file diff --git a/docs/models/components/project.md b/docs/models/components/project.md new file mode 100644 index 00000000..f20e7764 --- /dev/null +++ b/docs/models/components/project.md @@ -0,0 +1,17 @@ +# Project + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | +| `id` | *::String* | :heavy_check_mark: | The ID of the project. | +| `name` | *::String* | :heavy_check_mark: | The project's name. | +| `description` | *T.nilable(::String)* | :heavy_check_mark: | The project's description. | +| `domain` | *T.nilable(::String)* | :heavy_check_mark: | The website or app the project moderates content for. | +| `context` | *T.nilable(::String)* | :heavy_check_mark: | What the platform is and who uses it. AI moderation reads it to judge content in context. | +| `global_flagging_mode` | [Models::Components::ProjectGlobalFlaggingMode](../../models/shared/projectglobalflaggingmode.md) | :heavy_check_mark: | `ACTIVE` flags content. `DRY_RUN` evaluates content without flagging it, for testing a setup. | +| `enable_request_logging` | *T::Boolean* | :heavy_check_mark: | Whether moderated content is stored and shown in the dashboard. | +| `casebook_enabled` | *T::Boolean* | :heavy_check_mark: | Whether decisions made in the review queue are recorded in the project's casebook. | +| `created_at` | *::String* | :heavy_check_mark: | When the project was created. | +| `updated_at` | *::String* | :heavy_check_mark: | When the project was last changed. | \ No newline at end of file diff --git a/docs/models/components/projectglobalflaggingmode.md b/docs/models/components/projectglobalflaggingmode.md new file mode 100644 index 00000000..fc914f52 --- /dev/null +++ b/docs/models/components/projectglobalflaggingmode.md @@ -0,0 +1,22 @@ +# ProjectGlobalFlaggingMode + +`ACTIVE` flags content. `DRY_RUN` evaluates content without flagging it, for testing a setup. + +## Example Usage + +```ruby +require "moderation_api" + +value = ProjectGlobalFlaggingMode::DRY_RUN + +# Open enum: use .deserialize() to create instances from custom string values +custom = ProjectGlobalFlaggingMode.deserialize("custom_value") +``` + + +## Values + +| Name | Value | +| --------- | --------- | +| `DRY_RUN` | DRY_RUN | +| `ACTIVE` | ACTIVE | \ No newline at end of file diff --git a/docs/models/components/projectwithkey.md b/docs/models/components/projectwithkey.md new file mode 100644 index 00000000..5a9c19a5 --- /dev/null +++ b/docs/models/components/projectwithkey.md @@ -0,0 +1,18 @@ +# ProjectWithKey + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | +| `id` | *::String* | :heavy_check_mark: | The ID of the project. | +| `name` | *::String* | :heavy_check_mark: | The project's name. | +| `description` | *T.nilable(::String)* | :heavy_check_mark: | The project's description. | +| `domain` | *T.nilable(::String)* | :heavy_check_mark: | The website or app the project moderates content for. | +| `context` | *T.nilable(::String)* | :heavy_check_mark: | What the platform is and who uses it. AI moderation reads it to judge content in context. | +| `global_flagging_mode` | [Models::Components::ProjectWithKeyGlobalFlaggingMode](../../models/shared/projectwithkeyglobalflaggingmode.md) | :heavy_check_mark: | `ACTIVE` flags content. `DRY_RUN` evaluates content without flagging it, for testing a setup. | +| `enable_request_logging` | *T::Boolean* | :heavy_check_mark: | Whether moderated content is stored and shown in the dashboard. | +| `casebook_enabled` | *T::Boolean* | :heavy_check_mark: | Whether decisions made in the review queue are recorded in the project's casebook. | +| `created_at` | *::String* | :heavy_check_mark: | When the project was created. | +| `updated_at` | *::String* | :heavy_check_mark: | When the project was last changed. | +| `secret_key` | *::String* | :heavy_check_mark: | A secret API key for the new project. Use it to moderate content in this project. It is also shown in the project's settings. | \ No newline at end of file diff --git a/docs/models/components/projectwithkeyglobalflaggingmode.md b/docs/models/components/projectwithkeyglobalflaggingmode.md new file mode 100644 index 00000000..dd30e5f6 --- /dev/null +++ b/docs/models/components/projectwithkeyglobalflaggingmode.md @@ -0,0 +1,22 @@ +# ProjectWithKeyGlobalFlaggingMode + +`ACTIVE` flags content. `DRY_RUN` evaluates content without flagging it, for testing a setup. + +## Example Usage + +```ruby +require "moderation_api" + +value = ProjectWithKeyGlobalFlaggingMode::DRY_RUN + +# Open enum: use .deserialize() to create instances from custom string values +custom = ProjectWithKeyGlobalFlaggingMode.deserialize("custom_value") +``` + + +## Values + +| Name | Value | +| --------- | --------- | +| `DRY_RUN` | DRY_RUN | +| `ACTIVE` | ACTIVE | \ No newline at end of file diff --git a/docs/models/components/publicauthor.md b/docs/models/components/publicauthor.md new file mode 100644 index 00000000..2f21d8a4 --- /dev/null +++ b/docs/models/components/publicauthor.md @@ -0,0 +1,23 @@ +# PublicAuthor + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *::String* | :heavy_check_mark: | Author ID in Moderation API | +| `external_id` | *T.nilable(::String)* | :heavy_minus_sign: | The author's ID from your system | +| `profile_picture` | *T.nilable(::String)* | :heavy_minus_sign: | URL of the author's profile picture | +| `external_link` | *T.nilable(::String)* | :heavy_minus_sign: | URL of the author's external profile | +| `name` | *T.nilable(::String)* | :heavy_minus_sign: | Author name or identifier | +| `email` | *T.nilable(::String)* | :heavy_minus_sign: | Author email address | +| `company` | *T.nilable(::String)* | :heavy_minus_sign: | The author's company or organization | +| `first_seen` | *::Float* | :heavy_check_mark: | Timestamp when author first appeared | +| `last_seen` | *::Float* | :heavy_check_mark: | Timestamp of last activity | +| `last_incident` | *T.nilable(::Float)* | :heavy_minus_sign: | Timestamp of last incident | +| `status` | [Models::Components::Status](../../models/shared/status.md) | :heavy_check_mark: | Current author status | +| `trust_level` | [Models::Components::TrustLevel](../../models/shared/trustlevel.md) | :heavy_check_mark: | N/A | +| `block` | [T.nilable(Models::Components::Block)](../../models/shared/block.md) | :heavy_check_mark: | Block or suspension details, if applicable. Null if the author is enabled. | +| `risk_evaluation` | [T.nilable(Models::Components::RiskEvaluation)](../../models/shared/riskevaluation.md) | :heavy_check_mark: | Risk assessment details, if available. | +| `metrics` | [Models::Components::Metrics](../../models/shared/metrics.md) | :heavy_check_mark: | N/A | +| `metadata` | [Models::Components::Metadata](../../models/shared/metadata.md) | :heavy_check_mark: | Additional metadata provided by your system. We recommend including any relevant information that may assist in the moderation process. | \ No newline at end of file diff --git a/docs/models/components/ratelimiterrorcode.md b/docs/models/components/ratelimiterrorcode.md new file mode 100644 index 00000000..db591b63 --- /dev/null +++ b/docs/models/components/ratelimiterrorcode.md @@ -0,0 +1,23 @@ +# RateLimitErrorCode + +Exactly what went wrong. Stable; safe to branch on. New codes may be added. + +- `rate_limit_exceeded`: Too many requests. Wait for the `Retry-After` seconds. + +## Example Usage + +```ruby +require "moderation_api" + +value = RateLimitErrorCode::RATE_LIMIT_EXCEEDED + +# Open enum: use .deserialize() to create instances from custom string values +custom = RateLimitErrorCode.deserialize("custom_value") +``` + + +## Values + +| Name | Value | +| --------------------- | --------------------- | +| `RATE_LIMIT_EXCEEDED` | rate_limit_exceeded | \ No newline at end of file diff --git a/docs/models/components/riskevaluation.md b/docs/models/components/riskevaluation.md new file mode 100644 index 00000000..7d376f52 --- /dev/null +++ b/docs/models/components/riskevaluation.md @@ -0,0 +1,8 @@ +# RiskEvaluation + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | +| `risk_level` | *T.nilable(::Float)* | :heavy_minus_sign: | Calculated risk level based on more than 10 behavioral signals. | \ No newline at end of file diff --git a/docs/models/components/security.md b/docs/models/components/security.md new file mode 100644 index 00000000..138be01f --- /dev/null +++ b/docs/models/components/security.md @@ -0,0 +1,8 @@ +# Security + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `secret_key` | *::String* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/status.md b/docs/models/components/status.md new file mode 100644 index 00000000..8ae5c07a --- /dev/null +++ b/docs/models/components/status.md @@ -0,0 +1,23 @@ +# Status + +Current author status + +## Example Usage + +```ruby +require "moderation_api" + +value = Status::ENABLED + +# Open enum: use .deserialize() to create instances from custom string values +custom = Status.deserialize("custom_value") +``` + + +## Values + +| Name | Value | +| ----------- | ----------- | +| `ENABLED` | enabled | +| `SUSPENDED` | suspended | +| `BLOCKED` | blocked | \ No newline at end of file diff --git a/docs/models/components/transcriptionquality.md b/docs/models/components/transcriptionquality.md new file mode 100644 index 00000000..b7d2e00b --- /dev/null +++ b/docs/models/components/transcriptionquality.md @@ -0,0 +1,23 @@ +# TranscriptionQuality + +Trade-off between transcription speed and accuracy. + +## Example Usage + +```ruby +require "moderation_api" + +value = TranscriptionQuality::SPEED + +# Open enum: use .deserialize() to create instances from custom string values +custom = TranscriptionQuality.deserialize("custom_value") +``` + + +## Values + +| Name | Value | +| ---------- | ---------- | +| `SPEED` | SPEED | +| `BALANCED` | BALANCED | +| `ACCURACY` | ACCURACY | \ No newline at end of file diff --git a/docs/models/components/trustlevel.md b/docs/models/components/trustlevel.md new file mode 100644 index 00000000..f748af6b --- /dev/null +++ b/docs/models/components/trustlevel.md @@ -0,0 +1,9 @@ +# TrustLevel + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | +| `level` | *::Float* | :heavy_check_mark: | Author trust level (-1, 0, 1, 2, 3, or 4) | +| `manual` | *T::Boolean* | :heavy_check_mark: | True if the trust level was set manually by a moderator | \ No newline at end of file diff --git a/docs/models/errors/authenticationerror.md b/docs/models/errors/authenticationerror.md new file mode 100644 index 00000000..2283ba26 --- /dev/null +++ b/docs/models/errors/authenticationerror.md @@ -0,0 +1,16 @@ +# AuthenticationError + +The API key is missing, invalid or revoked. + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `type` | *::String* | :heavy_check_mark: | Broad error category. Stable; safe to switch on. | | +| `code` | [Models::Components::AuthenticationErrorCode](../../models/shared/authenticationerrorcode.md) | :heavy_check_mark: | Exactly what went wrong. Stable; safe to branch on. New codes may be added.

- `unauthorized`: Authentication failed.
- `missing_api_key`: No API key in the `Authorization` header.
- `malformed_api_key`: The `Authorization` header does not contain a valid key format.
- `invalid_api_key`: The API key does not exist or was revoked. | unauthorized | +| `message` | *::String* | :heavy_check_mark: | Human-readable explanation. | Authorization not provided | +| `issues` | T::Array<[Models::Components::ErrorIssue](../../models/shared/errorissue.md)> | :heavy_minus_sign: | Validation problems, when the request body is invalid. | | +| `request_id` | *::String* | :heavy_check_mark: | Identifies this request. Include it when you contact support. | h8fkz6kkzoa446ffve37atys | +| `doc_url` | *::String* | :heavy_check_mark: | Documentation for this `code`. | | +| `raw_response` | [Faraday::Response](https://www.rubydoc.info/gems/faraday/Faraday/Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file diff --git a/docs/models/errors/badrequesterror.md b/docs/models/errors/badrequesterror.md new file mode 100644 index 00000000..d25ced46 --- /dev/null +++ b/docs/models/errors/badrequesterror.md @@ -0,0 +1,16 @@ +# BadRequestError + +The request is malformed or a parameter is invalid. + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `type` | *::String* | :heavy_check_mark: | Broad error category. Stable; safe to switch on. | | +| `code` | [Models::Components::BadRequestErrorCode](../../models/shared/badrequesterrorcode.md) | :heavy_check_mark: | Exactly what went wrong. Stable; safe to branch on. New codes may be added.

- `invalid_request`: A parameter is invalid. `message` says which one.
- `validation_failed`: The request body does not match the schema. `issues` lists each problem with its `path`. | invalid_request | +| `message` | *::String* | :heavy_check_mark: | Human-readable explanation. | Invalid input data | +| `issues` | T::Array<[Models::Components::ErrorIssue](../../models/shared/errorissue.md)> | :heavy_minus_sign: | Validation problems, when the request body is invalid. | | +| `request_id` | *::String* | :heavy_check_mark: | Identifies this request. Include it when you contact support. | h8fkz6kkzoa446ffve37atys | +| `doc_url` | *::String* | :heavy_check_mark: | Documentation for this `code`. | | +| `raw_response` | [Faraday::Response](https://www.rubydoc.info/gems/faraday/Faraday/Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file diff --git a/docs/models/errors/conflicterror.md b/docs/models/errors/conflicterror.md new file mode 100644 index 00000000..d628a02d --- /dev/null +++ b/docs/models/errors/conflicterror.md @@ -0,0 +1,16 @@ +# ConflictError + +The request conflicts with the current state of a resource. + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | +| `type` | *::String* | :heavy_check_mark: | Broad error category. Stable; safe to switch on. | | +| `code` | [Models::Components::ConflictErrorCode](../../models/shared/conflicterrorcode.md) | :heavy_check_mark: | Exactly what went wrong. Stable; safe to branch on. New codes may be added.

- `resource_conflict`: The request conflicts with an existing resource. | resource_conflict | +| `message` | *::String* | :heavy_check_mark: | Human-readable explanation. | Action with this key already exists | +| `issues` | T::Array<[Models::Components::ErrorIssue](../../models/shared/errorissue.md)> | :heavy_minus_sign: | Validation problems, when the request body is invalid. | | +| `request_id` | *::String* | :heavy_check_mark: | Identifies this request. Include it when you contact support. | h8fkz6kkzoa446ffve37atys | +| `doc_url` | *::String* | :heavy_check_mark: | Documentation for this `code`. | | +| `raw_response` | [Faraday::Response](https://www.rubydoc.info/gems/faraday/Faraday/Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file diff --git a/docs/models/errors/internalservererror.md b/docs/models/errors/internalservererror.md new file mode 100644 index 00000000..ee7b6b2a --- /dev/null +++ b/docs/models/errors/internalservererror.md @@ -0,0 +1,16 @@ +# InternalServerError + +Something went wrong on our side. Retry with backoff. + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `type` | *::String* | :heavy_check_mark: | Broad error category. Stable; safe to switch on. | | +| `code` | [Models::Components::InternalServerErrorCode](../../models/shared/internalservererrorcode.md) | :heavy_check_mark: | Exactly what went wrong. Stable; safe to branch on. New codes may be added.

- `internal_error`: Something went wrong on our side. Retry with backoff. | internal_error | +| `message` | *::String* | :heavy_check_mark: | Human-readable explanation. | Internal server error | +| `issues` | T::Array<[Models::Components::ErrorIssue](../../models/shared/errorissue.md)> | :heavy_minus_sign: | Validation problems, when the request body is invalid. | | +| `request_id` | *::String* | :heavy_check_mark: | Identifies this request. Include it when you contact support. | h8fkz6kkzoa446ffve37atys | +| `doc_url` | *::String* | :heavy_check_mark: | Documentation for this `code`. | | +| `raw_response` | [Faraday::Response](https://www.rubydoc.info/gems/faraday/Faraday/Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file diff --git a/docs/models/errors/notfounderror.md b/docs/models/errors/notfounderror.md new file mode 100644 index 00000000..dc9b53fc --- /dev/null +++ b/docs/models/errors/notfounderror.md @@ -0,0 +1,16 @@ +# NotFoundError + +The resource does not exist or the key cannot see it. + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `type` | *::String* | :heavy_check_mark: | Broad error category. Stable; safe to switch on. | | +| `code` | [Models::Components::NotFoundErrorCode](../../models/shared/notfounderrorcode.md) | :heavy_check_mark: | Exactly what went wrong. Stable; safe to branch on. New codes may be added.

- `resource_not_found`: The resource does not exist.
- `action_not_found`: The action does not exist.
- `author_not_found`: The author does not exist.
- `queue_not_found`: The review queue does not exist.
- `wordlist_not_found`: The wordlist does not exist.
- `webhook_not_found`: The webhook does not exist.
- `project_not_found`: The project does not exist.
- `channel_not_found`: The channel does not exist. | resource_not_found | +| `message` | *::String* | :heavy_check_mark: | Human-readable explanation. | Not found | +| `issues` | T::Array<[Models::Components::ErrorIssue](../../models/shared/errorissue.md)> | :heavy_minus_sign: | Validation problems, when the request body is invalid. | | +| `request_id` | *::String* | :heavy_check_mark: | Identifies this request. Include it when you contact support. | h8fkz6kkzoa446ffve37atys | +| `doc_url` | *::String* | :heavy_check_mark: | Documentation for this `code`. | | +| `raw_response` | [Faraday::Response](https://www.rubydoc.info/gems/faraday/Faraday/Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file diff --git a/docs/models/errors/permissiondeniederror.md b/docs/models/errors/permissiondeniederror.md new file mode 100644 index 00000000..46d5c38d --- /dev/null +++ b/docs/models/errors/permissiondeniederror.md @@ -0,0 +1,16 @@ +# PermissionDeniedError + +The API key cannot do this, or the plan limit for this resource is reached. + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `type` | *::String* | :heavy_check_mark: | Broad error category. Stable; safe to switch on. | | +| `code` | [Models::Components::PermissionDeniedErrorCode](../../models/shared/permissiondeniederrorcode.md) | :heavy_check_mark: | Exactly what went wrong. Stable; safe to branch on. New codes may be added.

- `permission_denied`: The API key cannot perform this request.
- `account_disabled`: The organization account is disabled.
- `quota_exceeded`: The organization has used all API requests on its plan.
- `plan_feature_unavailable`: The current plan does not include this feature.
- `plan_limit_exceeded`: The request goes over a limit of the current plan.
- `project_key_required`: This endpoint needs a project API key, but an organization key was used.
- `organization_key_required`: This endpoint needs an organization API key, but a project key was used.
- `missing_key_permission`: The organization key does not have the permission this endpoint needs.
- `project_not_reachable`: The organization key is limited to other projects. | permission_denied | +| `message` | *::String* | :heavy_check_mark: | Human-readable explanation. | Insufficient access | +| `issues` | T::Array<[Models::Components::ErrorIssue](../../models/shared/errorissue.md)> | :heavy_minus_sign: | Validation problems, when the request body is invalid. | | +| `request_id` | *::String* | :heavy_check_mark: | Identifies this request. Include it when you contact support. | h8fkz6kkzoa446ffve37atys | +| `doc_url` | *::String* | :heavy_check_mark: | Documentation for this `code`. | | +| `raw_response` | [Faraday::Response](https://www.rubydoc.info/gems/faraday/Faraday/Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file diff --git a/docs/models/errors/ratelimiterror.md b/docs/models/errors/ratelimiterror.md new file mode 100644 index 00000000..caf3d5a2 --- /dev/null +++ b/docs/models/errors/ratelimiterror.md @@ -0,0 +1,16 @@ +# RateLimitError + +Too many requests. Retry after the number of seconds in the `Retry-After` header. + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `type` | *::String* | :heavy_check_mark: | Broad error category. Stable; safe to switch on. | | +| `code` | [Models::Components::RateLimitErrorCode](../../models/shared/ratelimiterrorcode.md) | :heavy_check_mark: | Exactly what went wrong. Stable; safe to branch on. New codes may be added.

- `rate_limit_exceeded`: Too many requests. Wait for the `Retry-After` seconds. | rate_limit_exceeded | +| `message` | *::String* | :heavy_check_mark: | Human-readable explanation. | Rate limit exceeded | +| `issues` | T::Array<[Models::Components::ErrorIssue](../../models/shared/errorissue.md)> | :heavy_minus_sign: | Validation problems, when the request body is invalid. | | +| `request_id` | *::String* | :heavy_check_mark: | Identifies this request. Include it when you contact support. | h8fkz6kkzoa446ffve37atys | +| `doc_url` | *::String* | :heavy_check_mark: | Documentation for this `code`. | | +| `raw_response` | [Faraday::Response](https://www.rubydoc.info/gems/faraday/Faraday/Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | | \ No newline at end of file diff --git a/docs/models/operations/actionrequest.md b/docs/models/operations/actionrequest.md new file mode 100644 index 00000000..6d9fc6a8 --- /dev/null +++ b/docs/models/operations/actionrequest.md @@ -0,0 +1,20 @@ +# ActionRequest + +Your recommendation for the content: allow, review, or reject. + +## Example Usage + +```ruby +require "moderation_api" + +value = ActionRequest::REVIEW +``` + + +## Values + +| Name | Value | +| -------- | -------- | +| `REVIEW` | review | +| `ALLOW` | allow | +| `REJECT` | reject | \ No newline at end of file diff --git a/docs/models/operations/actionstat.md b/docs/models/operations/actionstat.md new file mode 100644 index 00000000..0a9b2906 --- /dev/null +++ b/docs/models/operations/actionstat.md @@ -0,0 +1,11 @@ +# ActionStat + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ | +| `action_id` | *::String* | :heavy_check_mark: | ID of the moderation action | +| `action_name` | *::String* | :heavy_check_mark: | Name of the moderation action | +| `count` | *::Float* | :heavy_check_mark: | Number of times this action was taken | +| `percentage_of_total` | *::Float* | :heavy_check_mark: | Percentage this action represents of all actions | \ No newline at end of file diff --git a/docs/models/operations/addwordlistwordsrequest.md b/docs/models/operations/addwordlistwordsrequest.md new file mode 100644 index 00000000..d9971ba3 --- /dev/null +++ b/docs/models/operations/addwordlistwordsrequest.md @@ -0,0 +1,9 @@ +# AddWordlistWordsRequest + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | +| `id` | *::String* | :heavy_check_mark: | ID of the wordlist to add words to | +| `body` | [Models::Operations::AddWordlistWordsRequestBody](../../models/operations/addwordlistwordsrequestbody.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/addwordlistwordsrequestbody.md b/docs/models/operations/addwordlistwordsrequestbody.md new file mode 100644 index 00000000..4adbabf3 --- /dev/null +++ b/docs/models/operations/addwordlistwordsrequestbody.md @@ -0,0 +1,8 @@ +# AddWordlistWordsRequestBody + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | +| `words` | T::Array<*::String*> | :heavy_check_mark: | Array of words to add to the wordlist. Duplicate words will be ignored. | \ No newline at end of file diff --git a/docs/models/operations/addwordlistwordsresponse.md b/docs/models/operations/addwordlistwordsresponse.md new file mode 100644 index 00000000..16c53ff7 --- /dev/null +++ b/docs/models/operations/addwordlistwordsresponse.md @@ -0,0 +1,11 @@ +# AddWordlistWordsResponse + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | +| `content_type` | *::String* | :heavy_check_mark: | HTTP response content type for this operation | +| `status_code` | *::Integer* | :heavy_check_mark: | HTTP response status code for this operation | +| `raw_response` | [Faraday::Response](https://www.rubydoc.info/gems/faraday/Faraday/Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `object` | [T.nilable(Models::Operations::AddWordlistWordsResponseBody)](../../models/operations/addwordlistwordsresponsebody.md) | :heavy_minus_sign: | Words successfully added to wordlist | \ No newline at end of file diff --git a/docs/models/operations/addwordlistwordsresponsebody.md b/docs/models/operations/addwordlistwordsresponsebody.md new file mode 100644 index 00000000..02bb92ae --- /dev/null +++ b/docs/models/operations/addwordlistwordsresponsebody.md @@ -0,0 +1,12 @@ +# AddWordlistWordsResponseBody + +Words successfully added to wordlist + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------- | --------------------------------- | --------------------------------- | --------------------------------- | +| `added_count` | *::Float* | :heavy_check_mark: | Number of words added | +| `total_count` | *::Float* | :heavy_check_mark: | Total number of words in wordlist | +| `added_words` | T::Array<*::String*> | :heavy_check_mark: | List of words that were added | \ No newline at end of file diff --git a/docs/models/operations/adult.md b/docs/models/operations/adult.md new file mode 100644 index 00000000..e5756850 --- /dev/null +++ b/docs/models/operations/adult.md @@ -0,0 +1,10 @@ +# Adult + + +## Fields + +| Field | Type | Required | Description | +| -------------------- | -------------------- | -------------------- | -------------------- | +| `flag` | *T::Boolean* | :heavy_check_mark: | N/A | +| `threshold` | *T.nilable(::Float)* | :heavy_minus_sign: | N/A | +| `id` | *::String* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/alcohol.md b/docs/models/operations/alcohol.md new file mode 100644 index 00000000..d7b87bd3 --- /dev/null +++ b/docs/models/operations/alcohol.md @@ -0,0 +1,10 @@ +# Alcohol + + +## Fields + +| Field | Type | Required | Description | +| -------------------- | -------------------- | -------------------- | -------------------- | +| `flag` | *T::Boolean* | :heavy_check_mark: | N/A | +| `threshold` | *T.nilable(::Float)* | :heavy_minus_sign: | N/A | +| `id` | *::String* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/audiorequest.md b/docs/models/operations/audiorequest.md new file mode 100644 index 00000000..866b659d --- /dev/null +++ b/docs/models/operations/audiorequest.md @@ -0,0 +1,11 @@ +# AudioRequest + +Audio + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------- | ---------------------------- | ---------------------------- | ---------------------------- | +| `type` | *::String* | :heavy_check_mark: | N/A | +| `url` | *::String* | :heavy_check_mark: | The URL of the audio content | \ No newline at end of file diff --git a/docs/models/operations/audioresponse.md b/docs/models/operations/audioresponse.md new file mode 100644 index 00000000..4cddfc30 --- /dev/null +++ b/docs/models/operations/audioresponse.md @@ -0,0 +1,11 @@ +# AudioResponse + +Audio + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------- | ---------------------------- | ---------------------------- | ---------------------------- | +| `type` | *::String* | :heavy_check_mark: | N/A | +| `url` | *::String* | :heavy_check_mark: | The URL of the audio content | \ No newline at end of file diff --git a/docs/models/operations/author.md b/docs/models/operations/author.md new file mode 100644 index 00000000..13ad3695 --- /dev/null +++ b/docs/models/operations/author.md @@ -0,0 +1,12 @@ +# Author + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | +| `id` | *::String* | :heavy_check_mark: | Author ID in Moderation API | +| `external_id` | *T.nilable(::String)* | :heavy_minus_sign: | The author's ID from your system | +| `block` | [T.nilable(Models::Operations::Block)](../../models/operations/block.md) | :heavy_check_mark: | Block or suspension details, if applicable. Null if the author is enabled. | +| `status` | [Models::Operations::AuthorStatus](../../models/operations/authorstatus.md) | :heavy_check_mark: | Current author status | +| `trust_level` | [Models::Operations::TrustLevel](../../models/operations/trustlevel.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/authorstatus.md b/docs/models/operations/authorstatus.md new file mode 100644 index 00000000..c0c7df25 --- /dev/null +++ b/docs/models/operations/authorstatus.md @@ -0,0 +1,23 @@ +# AuthorStatus + +Current author status + +## Example Usage + +```ruby +require "moderation_api" + +value = AuthorStatus::ENABLED + +# Open enum: use .deserialize() to create instances from custom string values +custom = AuthorStatus.deserialize("custom_value") +``` + + +## Values + +| Name | Value | +| ----------- | ----------- | +| `ENABLED` | enabled | +| `SUSPENDED` | suspended | +| `BLOCKED` | blocked | \ No newline at end of file diff --git a/docs/models/operations/behavior.md b/docs/models/operations/behavior.md new file mode 100644 index 00000000..d0c2626e --- /dev/null +++ b/docs/models/operations/behavior.md @@ -0,0 +1,19 @@ +# Behavior + +How your recommendation combines with ours. Defaults to 'escalate', which only applies it when stricter than ours; 'override' replaces ours outright. + +## Example Usage + +```ruby +require "moderation_api" + +value = Behavior::OVERRIDE +``` + + +## Values + +| Name | Value | +| ---------- | ---------- | +| `OVERRIDE` | override | +| `ESCALATE` | escalate | \ No newline at end of file diff --git a/docs/models/operations/block.md b/docs/models/operations/block.md new file mode 100644 index 00000000..bb1b5966 --- /dev/null +++ b/docs/models/operations/block.md @@ -0,0 +1,9 @@ +# Block + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | +| `until_` | *T.nilable(::Float)* | :heavy_minus_sign: | The timestamp until which they are blocked if the author is suspended. | +| `reason` | *T.nilable(::String)* | :heavy_minus_sign: | The moderators reason why the author was blocked or suspended. | \ No newline at end of file diff --git a/docs/models/operations/brandimpersonation.md b/docs/models/operations/brandimpersonation.md new file mode 100644 index 00000000..8402be78 --- /dev/null +++ b/docs/models/operations/brandimpersonation.md @@ -0,0 +1,9 @@ +# BrandImpersonation + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | +| `brand` | *::String* | :heavy_check_mark: | N/A | +| `method` | [Models::Operations::Method](../../models/operations/method.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/cannabis.md b/docs/models/operations/cannabis.md new file mode 100644 index 00000000..bc304251 --- /dev/null +++ b/docs/models/operations/cannabis.md @@ -0,0 +1,10 @@ +# Cannabis + + +## Fields + +| Field | Type | Required | Description | +| -------------------- | -------------------- | -------------------- | -------------------- | +| `flag` | *T::Boolean* | :heavy_check_mark: | N/A | +| `threshold` | *T.nilable(::Float)* | :heavy_minus_sign: | N/A | +| `id` | *::String* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/casebook.md b/docs/models/operations/casebook.md new file mode 100644 index 00000000..a93e5b0e --- /dev/null +++ b/docs/models/operations/casebook.md @@ -0,0 +1,13 @@ +# Casebook + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `verdict` | [Models::Operations::Verdict](../../models/operations/verdict.md) | :heavy_check_mark: | The ruling your past decisions point to for this content. | +| `similarity` | *::Float* | :heavy_check_mark: | How close the nearest matching case is, from 0 to 1. 1 means the content is identical to something you have already decided. | +| `agreement` | *::Float* | :heavy_check_mark: | How unanimous the matching cases are, from 0 to 1: the share of them that decided this way, ignoring how many there are. Always at least 0.8 when a ruling is returned — below that the casebook reports a disagreement instead of picking a side — so it tells you how clean the consensus was, and is not a threshold to re-apply yourself. | +| `confidence` | *::Float* | :heavy_check_mark: | How strongly the casebook holds this ruling, from 0 to 1: the agreement scaled by how much evidence backs it, so a handful of close, recent cases outweighs one distant one. Older cases count for less, halving in weight roughly every 180 days. This is the number to use in rules when you want a strength condition. | +| `case_count` | *::Float* | :heavy_check_mark: | How many of your past cases backed this ruling. | +| `topic` | [T.nilable(Models::Operations::Topic)](../../models/operations/topic.md) | :heavy_check_mark: | The topic the closest matching case is filed under, or null when it has not been grouped into one yet. | \ No newline at end of file diff --git a/docs/models/operations/casebookagreement.md b/docs/models/operations/casebookagreement.md new file mode 100644 index 00000000..896ac0fb --- /dev/null +++ b/docs/models/operations/casebookagreement.md @@ -0,0 +1,21 @@ +# CasebookAgreement + +## Example Usage + +```ruby +require "moderation_api" + +value = CasebookAgreement::ALL + +# Open enum: use .deserialize() to create instances from custom string values +custom = CasebookAgreement.deserialize("custom_value") +``` + + +## Values + +| Name | Value | +| ----------- | ----------- | +| `ALL` | ALL | +| `OVERRULED` | OVERRULED | +| `AGREED` | AGREED | \ No newline at end of file diff --git a/docs/models/operations/casebookanswer.md b/docs/models/operations/casebookanswer.md new file mode 100644 index 00000000..48446961 --- /dev/null +++ b/docs/models/operations/casebookanswer.md @@ -0,0 +1,22 @@ +# CasebookAnswer + +## Example Usage + +```ruby +require "moderation_api" + +value = CasebookAnswer::ALL + +# Open enum: use .deserialize() to create instances from custom string values +custom = CasebookAnswer.deserialize("custom_value") +``` + + +## Values + +| Name | Value | +| ----------- | ----------- | +| `ALL` | ALL | +| `ALLOWED` | ALLOWED | +| `REJECTED` | REJECTED | +| `NO_ANSWER` | NO_ANSWER | \ No newline at end of file diff --git a/docs/models/operations/channelcircumvention.md b/docs/models/operations/channelcircumvention.md new file mode 100644 index 00000000..47f045d7 --- /dev/null +++ b/docs/models/operations/channelcircumvention.md @@ -0,0 +1,10 @@ +# ChannelCircumvention + + +## Fields + +| Field | Type | Required | Description | +| -------------------- | -------------------- | -------------------- | -------------------- | +| `flag` | *T::Boolean* | :heavy_check_mark: | N/A | +| `threshold` | *T.nilable(::Float)* | :heavy_minus_sign: | N/A | +| `id` | *::String* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/checkstatus.md b/docs/models/operations/checkstatus.md new file mode 100644 index 00000000..a19a8a63 --- /dev/null +++ b/docs/models/operations/checkstatus.md @@ -0,0 +1,21 @@ +# CheckStatus + +## Example Usage + +```ruby +require "moderation_api" + +value = CheckStatus::ALL + +# Open enum: use .deserialize() to create instances from custom string values +custom = CheckStatus.deserialize("custom_value") +``` + + +## Values + +| Name | Value | +| ----------- | ----------- | +| `ALL` | all | +| `CHECKED` | checked | +| `UNCHECKED` | unchecked | \ No newline at end of file diff --git a/docs/models/operations/classifieroutput.md b/docs/models/operations/classifieroutput.md new file mode 100644 index 00000000..e3c6bb93 --- /dev/null +++ b/docs/models/operations/classifieroutput.md @@ -0,0 +1,16 @@ +# ClassifierOutput + +Classifier policy. + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | +| `id` | *::String* | :heavy_check_mark: | The unique identifier for the classifier output. | +| `type` | *::String* | :heavy_check_mark: | N/A | +| `probability` | *::Float* | :heavy_check_mark: | N/A | +| `flagged` | *T::Boolean* | :heavy_check_mark: | N/A | +| `flagged_fields` | T::Array<*::String*> | :heavy_minus_sign: | The keys of the flagged fields if submitting an object. | +| `labels` | T::Array<[Models::Operations::SubmitContentLabel](../../models/operations/submitcontentlabel.md)> | :heavy_minus_sign: | N/A | +| `data` | T::Hash[Symbol, *::Object*] | :heavy_minus_sign: | Optional structured data produced by the policy. For face detection: { count, faces: [{ confidence, gender, age }] }. | \ No newline at end of file diff --git a/docs/models/operations/clientaction.md b/docs/models/operations/clientaction.md new file mode 100644 index 00000000..15fd82cb --- /dev/null +++ b/docs/models/operations/clientaction.md @@ -0,0 +1,13 @@ +# ClientAction + +A recommendation from your own client-side flagging (e.g. a banned-IP list or a third-party tool). Feeds the rules engine and can escalate or override the recommended action. Does not change whether our analysis flagged the content. + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | +| `action` | [Models::Operations::ActionRequest](../../models/operations/actionrequest.md) | :heavy_check_mark: | Your recommendation for the content: allow, review, or reject. | +| `behavior` | [T.nilable(Models::Operations::Behavior)](../../models/operations/behavior.md) | :heavy_minus_sign: | How your recommendation combines with ours. Defaults to 'escalate', which only applies it when stricter than ours; 'override' replaces ours outright. | +| `source` | *T.nilable(::String)* | :heavy_minus_sign: | Where your recommendation came from, e.g. "banned-ip". | +| `reason` | *T.nilable(::String)* | :heavy_minus_sign: | A human-readable explanation for your recommendation. | \ No newline at end of file diff --git a/docs/models/operations/codeabuse.md b/docs/models/operations/codeabuse.md new file mode 100644 index 00000000..ca9ffbdf --- /dev/null +++ b/docs/models/operations/codeabuse.md @@ -0,0 +1,10 @@ +# CodeAbuse + + +## Fields + +| Field | Type | Required | Description | +| -------------------- | -------------------- | -------------------- | -------------------- | +| `flag` | *T::Boolean* | :heavy_check_mark: | N/A | +| `threshold` | *T.nilable(::Float)* | :heavy_minus_sign: | N/A | +| `id` | *::String* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/comparator.md b/docs/models/operations/comparator.md new file mode 100644 index 00000000..3711f4ee --- /dev/null +++ b/docs/models/operations/comparator.md @@ -0,0 +1,19 @@ +# Comparator + +Flag images that contain "at least" or "fewer than" the configured number of faces. Defaults to at_least. + +## Example Usage + +```ruby +require "moderation_api" + +value = Comparator::AT_LEAST +``` + + +## Values + +| Name | Value | +| ------------ | ------------ | +| `AT_LEAST` | at_least | +| `FEWER_THAN` | fewer_than | \ No newline at end of file diff --git a/docs/models/operations/compassioninsight.md b/docs/models/operations/compassioninsight.md new file mode 100644 index 00000000..905855fa --- /dev/null +++ b/docs/models/operations/compassioninsight.md @@ -0,0 +1,13 @@ +# CompassionInsight + +Compassion insight. Identifies with or shows concern, empathy, or support for the feelings/emotions of others. + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------- | ------------------------------------- | ------------------------------------- | ------------------------------------- | +| `id` | *::String* | :heavy_check_mark: | N/A | +| `type` | *::String* | :heavy_check_mark: | N/A | +| `probability` | *::Float* | :heavy_check_mark: | N/A | +| `value` | *T.nilable(T::Boolean)* | :heavy_check_mark: | Whether the content shows compassion. | \ No newline at end of file diff --git a/docs/models/operations/contentleafrequest.md b/docs/models/operations/contentleafrequest.md new file mode 100644 index 00000000..2caf1bf5 --- /dev/null +++ b/docs/models/operations/contentleafrequest.md @@ -0,0 +1,2 @@ +# ContentLeafRequest + diff --git a/docs/models/operations/contentleafresponse.md b/docs/models/operations/contentleafresponse.md new file mode 100644 index 00000000..f84a03fc --- /dev/null +++ b/docs/models/operations/contentleafresponse.md @@ -0,0 +1,2 @@ +# ContentLeafResponse + diff --git a/docs/models/operations/contentrequest.md b/docs/models/operations/contentrequest.md new file mode 100644 index 00000000..776bbac1 --- /dev/null +++ b/docs/models/operations/contentrequest.md @@ -0,0 +1,4 @@ +# ContentRequest + +The content sent for moderation + diff --git a/docs/models/operations/contentresponse.md b/docs/models/operations/contentresponse.md new file mode 100644 index 00000000..a0efa435 --- /dev/null +++ b/docs/models/operations/contentresponse.md @@ -0,0 +1,14 @@ +# ContentResponse + +Potentially modified content. + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *::String* | :heavy_check_mark: | The unique identifier for the content. Either the contentId provided by you or an autogenerated ID. | +| `masked` | *T::Boolean* | :heavy_check_mark: | Whether any values have been masked. | +| `unicode_cleaned` | *T::Boolean* | :heavy_check_mark: | Whether Unicode spoofing normalization rewrote the content — confusables folded to their Latin lookalikes, invisible characters and combining-mark abuse stripped. | +| `modified` | [T.nilable(T.any(::String, T::Hash[Symbol, ::Object], T::Hash[Symbol, T.any(Models::Operations::TextResponse, Models::Operations::ImageResponse, Models::Operations::VideoResponse, Models::Operations::AudioResponse)]))](../../models/operations/modified.md) | :heavy_check_mark: | The modified content, if any. | +| `transcript` | *T.nilable(::String)* | :heavy_minus_sign: | The transcribed text from audio content. Only present when audio moderation is used and transcript inclusion is enabled on the channel. | \ No newline at end of file diff --git a/docs/models/operations/createactionpositionrequest.md b/docs/models/operations/createactionpositionrequest.md new file mode 100644 index 00000000..27fe8562 --- /dev/null +++ b/docs/models/operations/createactionpositionrequest.md @@ -0,0 +1,20 @@ +# CreateActionPositionRequest + +Show the action in all queues, selected queues or no queues (to use via API only). + +## Example Usage + +```ruby +require "moderation_api" + +value = CreateActionPositionRequest::ALL_QUEUES +``` + + +## Values + +| Name | Value | +| ------------- | ------------- | +| `ALL_QUEUES` | ALL_QUEUES | +| `SOME_QUEUES` | SOME_QUEUES | +| `HIDDEN` | HIDDEN | \ No newline at end of file diff --git a/docs/models/operations/createactionpositionresponse.md b/docs/models/operations/createactionpositionresponse.md new file mode 100644 index 00000000..1e3a55cf --- /dev/null +++ b/docs/models/operations/createactionpositionresponse.md @@ -0,0 +1,23 @@ +# CreateActionPositionResponse + +Show the action in all queues, selected queues or no queues (to use via API only). + +## Example Usage + +```ruby +require "moderation_api" + +value = CreateActionPositionResponse::ALL_QUEUES + +# Open enum: use .deserialize() to create instances from custom string values +custom = CreateActionPositionResponse.deserialize("custom_value") +``` + + +## Values + +| Name | Value | +| ------------- | ------------- | +| `ALL_QUEUES` | ALL_QUEUES | +| `SOME_QUEUES` | SOME_QUEUES | +| `HIDDEN` | HIDDEN | \ No newline at end of file diff --git a/docs/models/operations/createactionpossiblevaluerequest.md b/docs/models/operations/createactionpossiblevaluerequest.md new file mode 100644 index 00000000..1d26325f --- /dev/null +++ b/docs/models/operations/createactionpossiblevaluerequest.md @@ -0,0 +1,8 @@ +# CreateActionPossibleValueRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------------ | ------------------------ | ------------------------ | ------------------------ | +| `value` | *::String* | :heavy_check_mark: | The value of the action. | \ No newline at end of file diff --git a/docs/models/operations/createactionpossiblevalueresponse.md b/docs/models/operations/createactionpossiblevalueresponse.md new file mode 100644 index 00000000..ce9a8ab4 --- /dev/null +++ b/docs/models/operations/createactionpossiblevalueresponse.md @@ -0,0 +1,8 @@ +# CreateActionPossibleValueResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------ | ------------------------ | ------------------------ | ------------------------ | +| `value` | *::String* | :heavy_check_mark: | The value of the action. | \ No newline at end of file diff --git a/docs/models/operations/createactionqueuebehaviourrequest.md b/docs/models/operations/createactionqueuebehaviourrequest.md new file mode 100644 index 00000000..43b08384 --- /dev/null +++ b/docs/models/operations/createactionqueuebehaviourrequest.md @@ -0,0 +1,20 @@ +# CreateActionQueueBehaviourRequest + +Whether the action resolves and removes the item, unresolves and re-add it to the queue, or does not change the resolve status. + +## Example Usage + +```ruby +require "moderation_api" + +value = CreateActionQueueBehaviourRequest::REMOVE +``` + + +## Values + +| Name | Value | +| ----------- | ----------- | +| `REMOVE` | REMOVE | +| `ADD` | ADD | +| `NO_CHANGE` | NO_CHANGE | \ No newline at end of file diff --git a/docs/models/operations/createactionqueuebehaviourresponse.md b/docs/models/operations/createactionqueuebehaviourresponse.md new file mode 100644 index 00000000..dd266bbe --- /dev/null +++ b/docs/models/operations/createactionqueuebehaviourresponse.md @@ -0,0 +1,23 @@ +# CreateActionQueueBehaviourResponse + +Whether the action resolves and removes the item, unresolves and re-add it to the queue, or does not change the resolve status. + +## Example Usage + +```ruby +require "moderation_api" + +value = CreateActionQueueBehaviourResponse::REMOVE + +# Open enum: use .deserialize() to create instances from custom string values +custom = CreateActionQueueBehaviourResponse.deserialize("custom_value") +``` + + +## Values + +| Name | Value | +| ----------- | ----------- | +| `REMOVE` | REMOVE | +| `ADD` | ADD | +| `NO_CHANGE` | NO_CHANGE | \ No newline at end of file diff --git a/docs/models/operations/createactionrequest.md b/docs/models/operations/createactionrequest.md new file mode 100644 index 00000000..818bcc84 --- /dev/null +++ b/docs/models/operations/createactionrequest.md @@ -0,0 +1,18 @@ +# CreateActionRequest + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | +| `key` | *T.nilable(::String)* | :heavy_minus_sign: | User defined key of the action. | +| `name` | *::String* | :heavy_check_mark: | The name of the action. | +| `description` | *T.nilable(::String)* | :heavy_minus_sign: | The description of the action. | +| `type` | [T.nilable(Models::Operations::CreateActionTypeRequest)](../../models/operations/createactiontyperequest.md) | :heavy_minus_sign: | The type of the action. | +| `built_in` | *T.nilable(T::Boolean)* | :heavy_minus_sign: | Whether the action is a built-in action or a custom one. | +| `queue_behaviour` | [T.nilable(Models::Operations::CreateActionQueueBehaviourRequest)](../../models/operations/createactionqueuebehaviourrequest.md) | :heavy_minus_sign: | Whether the action resolves and removes the item, unresolves and re-add it to the queue, or does not change the resolve status. | +| `filter_in_queue_ids` | T::Array<*::String*> | :heavy_minus_sign: | The IDs of the queues the action is available in. | +| `position` | [T.nilable(Models::Operations::CreateActionPositionRequest)](../../models/operations/createactionpositionrequest.md) | :heavy_minus_sign: | Show the action in all queues, selected queues or no queues (to use via API only). | +| `possible_values` | T::Array<[Models::Operations::CreateActionPossibleValueRequest](../../models/operations/createactionpossiblevaluerequest.md)> | :heavy_minus_sign: | The possible values of the action. The user will be prompted to select one of these values when executing the action. | +| `value_required` | *T.nilable(T::Boolean)* | :heavy_minus_sign: | Whether the action requires a value to be executed. | +| `free_text` | *T.nilable(T::Boolean)* | :heavy_minus_sign: | Whether the action allows any text to be entered as a value or if it must be one of the possible values. | \ No newline at end of file diff --git a/docs/models/operations/createactionresponse.md b/docs/models/operations/createactionresponse.md new file mode 100644 index 00000000..66c2f510 --- /dev/null +++ b/docs/models/operations/createactionresponse.md @@ -0,0 +1,11 @@ +# CreateActionResponse + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | +| `content_type` | *::String* | :heavy_check_mark: | HTTP response content type for this operation | +| `status_code` | *::Integer* | :heavy_check_mark: | HTTP response status code for this operation | +| `raw_response` | [Faraday::Response](https://www.rubydoc.info/gems/faraday/Faraday/Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `object` | [T.nilable(Models::Operations::CreateActionResponseBody)](../../models/operations/createactionresponsebody.md) | :heavy_minus_sign: | Action created successfully | \ No newline at end of file diff --git a/docs/models/operations/createactionresponsebody.md b/docs/models/operations/createactionresponsebody.md new file mode 100644 index 00000000..fa2e2c76 --- /dev/null +++ b/docs/models/operations/createactionresponsebody.md @@ -0,0 +1,22 @@ +# CreateActionResponseBody + +Action created successfully + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *::String* | :heavy_check_mark: | The ID of the action. | +| `key` | *T.nilable(::String)* | :heavy_minus_sign: | User defined key of the action. | +| `created_at` | *::String* | :heavy_check_mark: | The date the action was created. | +| `name` | *::String* | :heavy_check_mark: | The name of the action. | +| `description` | *T.nilable(::String)* | :heavy_minus_sign: | The description of the action. | +| `type` | [T.nilable(Models::Operations::CreateActionTypeResponse)](../../models/operations/createactiontyperesponse.md) | :heavy_minus_sign: | The type of the action. | +| `built_in` | *T.nilable(T::Boolean)* | :heavy_minus_sign: | Whether the action is a built-in action or a custom one. | +| `queue_behaviour` | [T.nilable(Models::Operations::CreateActionQueueBehaviourResponse)](../../models/operations/createactionqueuebehaviourresponse.md) | :heavy_minus_sign: | Whether the action resolves and removes the item, unresolves and re-add it to the queue, or does not change the resolve status. | +| `filter_in_queue_ids` | T::Array<*::String*> | :heavy_check_mark: | The IDs of the queues the action is available in. | +| `position` | [T.nilable(Models::Operations::CreateActionPositionResponse)](../../models/operations/createactionpositionresponse.md) | :heavy_minus_sign: | Show the action in all queues, selected queues or no queues (to use via API only). | +| `possible_values` | T::Array<[Models::Operations::CreateActionPossibleValueResponse](../../models/operations/createactionpossiblevalueresponse.md)> | :heavy_check_mark: | The possible values of the action. The user will be prompted to select one of these values when executing the action. | +| `value_required` | *T.nilable(T::Boolean)* | :heavy_minus_sign: | Whether the action requires a value to be executed. | +| `free_text` | *T.nilable(T::Boolean)* | :heavy_minus_sign: | Whether the action allows any text to be entered as a value or if it must be one of the possible values. | \ No newline at end of file diff --git a/docs/models/operations/createactiontyperequest.md b/docs/models/operations/createactiontyperequest.md new file mode 100644 index 00000000..8d5f3dc3 --- /dev/null +++ b/docs/models/operations/createactiontyperequest.md @@ -0,0 +1,25 @@ +# CreateActionTypeRequest + +## Example Usage + +```ruby +require "moderation_api" + +value = CreateActionTypeRequest::AUTHOR_BLOCK +``` + + +## Values + +| Name | Value | +| ------------------- | ------------------- | +| `AUTHOR_BLOCK` | AUTHOR_BLOCK | +| `AUTHOR_BLOCK_TEMP` | AUTHOR_BLOCK_TEMP | +| `AUTHOR_UNBLOCK` | AUTHOR_UNBLOCK | +| `AUTHOR_DELETE` | AUTHOR_DELETE | +| `AUTHOR_REPORT` | AUTHOR_REPORT | +| `AUTHOR_WARN` | AUTHOR_WARN | +| `AUTHOR_CUSTOM` | AUTHOR_CUSTOM | +| `ITEM_REJECT` | ITEM_REJECT | +| `ITEM_ALLOW` | ITEM_ALLOW | +| `ITEM_CUSTOM` | ITEM_CUSTOM | \ No newline at end of file diff --git a/docs/models/operations/createactiontyperesponse.md b/docs/models/operations/createactiontyperesponse.md new file mode 100644 index 00000000..678fe402 --- /dev/null +++ b/docs/models/operations/createactiontyperesponse.md @@ -0,0 +1,28 @@ +# CreateActionTypeResponse + +## Example Usage + +```ruby +require "moderation_api" + +value = CreateActionTypeResponse::AUTHOR_BLOCK + +# Open enum: use .deserialize() to create instances from custom string values +custom = CreateActionTypeResponse.deserialize("custom_value") +``` + + +## Values + +| Name | Value | +| ------------------- | ------------------- | +| `AUTHOR_BLOCK` | AUTHOR_BLOCK | +| `AUTHOR_BLOCK_TEMP` | AUTHOR_BLOCK_TEMP | +| `AUTHOR_UNBLOCK` | AUTHOR_UNBLOCK | +| `AUTHOR_DELETE` | AUTHOR_DELETE | +| `AUTHOR_REPORT` | AUTHOR_REPORT | +| `AUTHOR_WARN` | AUTHOR_WARN | +| `AUTHOR_CUSTOM` | AUTHOR_CUSTOM | +| `ITEM_REJECT` | ITEM_REJECT | +| `ITEM_ALLOW` | ITEM_ALLOW | +| `ITEM_CUSTOM` | ITEM_CUSTOM | \ No newline at end of file diff --git a/docs/models/operations/createauthormetadata.md b/docs/models/operations/createauthormetadata.md new file mode 100644 index 00000000..7597ce53 --- /dev/null +++ b/docs/models/operations/createauthormetadata.md @@ -0,0 +1,14 @@ +# CreateAuthorMetadata + +Additional metadata provided by your system. We recommend including any relevant information that may assist in the moderation process. + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------- | --------------------------------------------- | --------------------------------------------- | --------------------------------------------- | +| `email_verified` | *T.nilable(T::Boolean)* | :heavy_minus_sign: | Whether the author's email is verified | +| `phone_verified` | *T.nilable(T::Boolean)* | :heavy_minus_sign: | Whether the author's phone number is verified | +| `identity_verified` | *T.nilable(T::Boolean)* | :heavy_minus_sign: | Whether the author's identity is verified | +| `is_paying_customer` | *T.nilable(T::Boolean)* | :heavy_minus_sign: | Whether the author is a paying customer | +| `additional_properties` | T::Hash[Symbol, *::Object*] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/createauthorrequest.md b/docs/models/operations/createauthorrequest.md new file mode 100644 index 00000000..40e65131 --- /dev/null +++ b/docs/models/operations/createauthorrequest.md @@ -0,0 +1,17 @@ +# CreateAuthorRequest + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | +| `profile_picture` | *T.nilable(::String)* | :heavy_minus_sign: | URL of the author's profile picture | +| `external_link` | *T.nilable(::String)* | :heavy_minus_sign: | URL of the author's external profile | +| `name` | *T.nilable(::String)* | :heavy_minus_sign: | Author name or identifier | +| `email` | *T.nilable(::String)* | :heavy_minus_sign: | Author email address | +| `company` | *T.nilable(::String)* | :heavy_minus_sign: | The author's company or organization | +| `metadata` | [T.nilable(Models::Operations::CreateAuthorMetadata)](../../models/operations/createauthormetadata.md) | :heavy_minus_sign: | Additional metadata provided by your system. We recommend including any relevant information that may assist in the moderation process. | +| `first_seen` | *T.nilable(::Float)* | :heavy_minus_sign: | Timestamp when author first appeared | +| `last_seen` | *T.nilable(::Float)* | :heavy_minus_sign: | Timestamp of last activity | +| `manual_trust_level` | *T.nilable(::Float)* | :heavy_minus_sign: | N/A | +| `external_id` | *::String* | :heavy_check_mark: | External ID of the user, typically the ID of the author in your database. | \ No newline at end of file diff --git a/docs/models/operations/createauthorresponse.md b/docs/models/operations/createauthorresponse.md new file mode 100644 index 00000000..613a24b3 --- /dev/null +++ b/docs/models/operations/createauthorresponse.md @@ -0,0 +1,11 @@ +# CreateAuthorResponse + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| `content_type` | *::String* | :heavy_check_mark: | HTTP response content type for this operation | +| `status_code` | *::Integer* | :heavy_check_mark: | HTTP response status code for this operation | +| `raw_response` | [Faraday::Response](https://www.rubydoc.info/gems/faraday/Faraday/Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `public_author` | [T.nilable(Models::Components::PublicAuthor)](../../models/shared/publicauthor.md) | :heavy_minus_sign: | Successful response | \ No newline at end of file diff --git a/docs/models/operations/createchannelcontenttype.md b/docs/models/operations/createchannelcontenttype.md new file mode 100644 index 00000000..0fd48fd8 --- /dev/null +++ b/docs/models/operations/createchannelcontenttype.md @@ -0,0 +1,26 @@ +# CreateChannelContentType + +The kind of content the channel moderates. + +## Example Usage + +```ruby +require "moderation_api" + +value = CreateChannelContentType::PROFILE +``` + + +## Values + +| Name | Value | +| --------- | --------- | +| `PROFILE` | profile | +| `MESSAGE` | message | +| `POST` | post | +| `COMMENT` | comment | +| `EVENT` | event | +| `PRODUCT` | product | +| `REVIEW` | review | +| `VOICE` | voice | +| `OTHER` | other | \ No newline at end of file diff --git a/docs/models/operations/createchannelrequest.md b/docs/models/operations/createchannelrequest.md new file mode 100644 index 00000000..3f73d98a --- /dev/null +++ b/docs/models/operations/createchannelrequest.md @@ -0,0 +1,9 @@ +# CreateChannelRequest + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | +| `project_id` | *::String* | :heavy_check_mark: | The ID of the project to add the channel to. | +| `body` | [Models::Operations::CreateChannelRequestBody](../../models/operations/createchannelrequestbody.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/createchannelrequestbody.md b/docs/models/operations/createchannelrequestbody.md new file mode 100644 index 00000000..1401fc4d --- /dev/null +++ b/docs/models/operations/createchannelrequestbody.md @@ -0,0 +1,11 @@ +# CreateChannelRequestBody + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | +| `name` | *::String* | :heavy_check_mark: | The channel's name. | +| `key` | *T.nilable(::String)* | :heavy_minus_sign: | The key you pass as `channel` when you moderate content. Defaults to the name in lowercase with dashes. Must be unique in the project. | +| `description` | *T.nilable(::String)* | :heavy_minus_sign: | The channel's description. | +| `content_type` | [T.nilable(Models::Operations::CreateChannelContentType)](../../models/operations/createchannelcontenttype.md) | :heavy_minus_sign: | The kind of content the channel moderates. | \ No newline at end of file diff --git a/docs/models/operations/createchannelresponse.md b/docs/models/operations/createchannelresponse.md new file mode 100644 index 00000000..6470709c --- /dev/null +++ b/docs/models/operations/createchannelresponse.md @@ -0,0 +1,11 @@ +# CreateChannelResponse + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | +| `content_type` | *::String* | :heavy_check_mark: | HTTP response content type for this operation | +| `status_code` | *::Integer* | :heavy_check_mark: | HTTP response status code for this operation | +| `raw_response` | [Faraday::Response](https://www.rubydoc.info/gems/faraday/Faraday/Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `channel` | [T.nilable(Models::Components::Channel)](../../models/shared/channel.md) | :heavy_minus_sign: | Channel created successfully | \ No newline at end of file diff --git a/docs/models/operations/createprojectrequest.md b/docs/models/operations/createprojectrequest.md new file mode 100644 index 00000000..9f0026ac --- /dev/null +++ b/docs/models/operations/createprojectrequest.md @@ -0,0 +1,12 @@ +# CreateProjectRequest + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | +| `name` | *::String* | :heavy_check_mark: | The project's name. | +| `domain` | *T.nilable(::String)* | :heavy_minus_sign: | The website or app the project moderates content for. Used to write the context when none is given. | +| `context` | *T.nilable(::String)* | :heavy_minus_sign: | What the platform is and who uses it. | +| `brief` | *T.nilable(::String)* | :heavy_minus_sign: | What you moderate, the problems you see and your guidelines. | +| `used_by_minors` | *T.nilable(T::Boolean)* | :heavy_minus_sign: | Whether children use the platform. | \ No newline at end of file diff --git a/docs/models/operations/createprojectresponse.md b/docs/models/operations/createprojectresponse.md new file mode 100644 index 00000000..e20e2720 --- /dev/null +++ b/docs/models/operations/createprojectresponse.md @@ -0,0 +1,11 @@ +# CreateProjectResponse + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | +| `content_type` | *::String* | :heavy_check_mark: | HTTP response content type for this operation | +| `status_code` | *::Integer* | :heavy_check_mark: | HTTP response status code for this operation | +| `raw_response` | [Faraday::Response](https://www.rubydoc.info/gems/faraday/Faraday/Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `project_with_key` | [T.nilable(Models::Components::ProjectWithKey)](../../models/shared/projectwithkey.md) | :heavy_minus_sign: | Project created successfully | \ No newline at end of file diff --git a/docs/models/operations/createwebhookeventtyperequest.md b/docs/models/operations/createwebhookeventtyperequest.md new file mode 100644 index 00000000..ce4e40d6 --- /dev/null +++ b/docs/models/operations/createwebhookeventtyperequest.md @@ -0,0 +1,26 @@ +# CreateWebhookEventTypeRequest + +## Example Usage + +```ruby +require "moderation_api" + +value = CreateWebhookEventTypeRequest::QUEUE_ITEM_NEW +``` + + +## Values + +| Name | Value | +| ---------------------------- | ---------------------------- | +| `QUEUE_ITEM_NEW` | QUEUE_ITEM_NEW | +| `QUEUE_ITEM_COMPLETED` | QUEUE_ITEM_COMPLETED | +| `QUEUE_ITEM_ACTION` | QUEUE_ITEM_ACTION | +| `QUEUE_ITEM_REJECTED` | QUEUE_ITEM_REJECTED | +| `QUEUE_ITEM_ALLOWED` | QUEUE_ITEM_ALLOWED | +| `AUTHOR_BLOCKED` | AUTHOR_BLOCKED | +| `AUTHOR_UNBLOCKED` | AUTHOR_UNBLOCKED | +| `AUTHOR_SUSPENDED` | AUTHOR_SUSPENDED | +| `AUTHOR_UPDATED` | AUTHOR_UPDATED | +| `AUTHOR_TRUST_LEVEL_CHANGED` | AUTHOR_TRUST_LEVEL_CHANGED | +| `AUTHOR_ACTION` | AUTHOR_ACTION | \ No newline at end of file diff --git a/docs/models/operations/createwebhookeventtyperesponse.md b/docs/models/operations/createwebhookeventtyperesponse.md new file mode 100644 index 00000000..9ebca380 --- /dev/null +++ b/docs/models/operations/createwebhookeventtyperesponse.md @@ -0,0 +1,29 @@ +# CreateWebhookEventTypeResponse + +## Example Usage + +```ruby +require "moderation_api" + +value = CreateWebhookEventTypeResponse::QUEUE_ITEM_NEW + +# Open enum: use .deserialize() to create instances from custom string values +custom = CreateWebhookEventTypeResponse.deserialize("custom_value") +``` + + +## Values + +| Name | Value | +| ---------------------------- | ---------------------------- | +| `QUEUE_ITEM_NEW` | QUEUE_ITEM_NEW | +| `QUEUE_ITEM_COMPLETED` | QUEUE_ITEM_COMPLETED | +| `QUEUE_ITEM_ACTION` | QUEUE_ITEM_ACTION | +| `QUEUE_ITEM_REJECTED` | QUEUE_ITEM_REJECTED | +| `QUEUE_ITEM_ALLOWED` | QUEUE_ITEM_ALLOWED | +| `AUTHOR_BLOCKED` | AUTHOR_BLOCKED | +| `AUTHOR_UNBLOCKED` | AUTHOR_UNBLOCKED | +| `AUTHOR_SUSPENDED` | AUTHOR_SUSPENDED | +| `AUTHOR_UPDATED` | AUTHOR_UPDATED | +| `AUTHOR_TRUST_LEVEL_CHANGED` | AUTHOR_TRUST_LEVEL_CHANGED | +| `AUTHOR_ACTION` | AUTHOR_ACTION | \ No newline at end of file diff --git a/docs/models/operations/createwebhookpayloadversion.md b/docs/models/operations/createwebhookpayloadversion.md new file mode 100644 index 00000000..cc1fa4df --- /dev/null +++ b/docs/models/operations/createwebhookpayloadversion.md @@ -0,0 +1,22 @@ +# CreateWebhookPayloadVersion + +Payload envelope version. V2 is the Stripe-style envelope; V1 is the legacy flat shape and is read-only via this API. + +## Example Usage + +```ruby +require "moderation_api" + +value = CreateWebhookPayloadVersion::V1 + +# Open enum: use .deserialize() to create instances from custom string values +custom = CreateWebhookPayloadVersion.deserialize("custom_value") +``` + + +## Values + +| Name | Value | +| ----- | ----- | +| `V1` | V1 | +| `V2` | V2 | \ No newline at end of file diff --git a/docs/models/operations/createwebhookrequest.md b/docs/models/operations/createwebhookrequest.md new file mode 100644 index 00000000..d181df5a --- /dev/null +++ b/docs/models/operations/createwebhookrequest.md @@ -0,0 +1,11 @@ +# CreateWebhookRequest + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | +| `name` | *::String* | :heavy_check_mark: | The webhook's name, used to identify it in the dashboard | +| `description` | *T.nilable(::String)* | :heavy_minus_sign: | The webhook's description | +| `url` | *::String* | :heavy_check_mark: | The webhook's URL. We'll call this URL when an event occurs. | +| `event_types` | T::Array<[Models::Operations::CreateWebhookEventTypeRequest](../../models/operations/createwebhookeventtyperequest.md)> | :heavy_check_mark: | Event types this webhook subscribes to. One webhook URL receives all events you list here. | \ No newline at end of file diff --git a/docs/models/operations/createwebhookresponse.md b/docs/models/operations/createwebhookresponse.md new file mode 100644 index 00000000..05a26a90 --- /dev/null +++ b/docs/models/operations/createwebhookresponse.md @@ -0,0 +1,11 @@ +# CreateWebhookResponse + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | +| `content_type` | *::String* | :heavy_check_mark: | HTTP response content type for this operation | +| `status_code` | *::Integer* | :heavy_check_mark: | HTTP response status code for this operation | +| `raw_response` | [Faraday::Response](https://www.rubydoc.info/gems/faraday/Faraday/Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `object` | [T.nilable(Models::Operations::CreateWebhookResponseBody)](../../models/operations/createwebhookresponsebody.md) | :heavy_minus_sign: | Webhook created successfully | \ No newline at end of file diff --git a/docs/models/operations/createwebhookresponsebody.md b/docs/models/operations/createwebhookresponsebody.md new file mode 100644 index 00000000..242f2cfe --- /dev/null +++ b/docs/models/operations/createwebhookresponsebody.md @@ -0,0 +1,16 @@ +# CreateWebhookResponseBody + +Webhook created successfully + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *::String* | :heavy_check_mark: | The ID of the webhook. | +| `name` | *::String* | :heavy_check_mark: | The webhook's name. | +| `description` | *T.nilable(::String)* | :heavy_minus_sign: | The webhook's description. | +| `url` | *::String* | :heavy_check_mark: | The URL we call when a subscribed event occurs. | +| `event_types` | T::Array<[Models::Operations::CreateWebhookEventTypeResponse](../../models/operations/createwebhookeventtyperesponse.md)> | :heavy_check_mark: | Event types this webhook subscribes to. Empty for legacy v1 webhooks, which subscribe via their single deprecated `type` instead. | +| `payload_version` | [Models::Operations::CreateWebhookPayloadVersion](../../models/operations/createwebhookpayloadversion.md) | :heavy_check_mark: | Payload envelope version. V2 is the Stripe-style envelope; V1 is the legacy flat shape and is read-only via this API. | +| `created_at` | *::String* | :heavy_check_mark: | The date the webhook was created. | \ No newline at end of file diff --git a/docs/models/operations/crypto.md b/docs/models/operations/crypto.md new file mode 100644 index 00000000..53feacb6 --- /dev/null +++ b/docs/models/operations/crypto.md @@ -0,0 +1,10 @@ +# Crypto + + +## Fields + +| Field | Type | Required | Description | +| -------------------- | -------------------- | -------------------- | -------------------- | +| `flag` | *T::Boolean* | :heavy_check_mark: | N/A | +| `threshold` | *T.nilable(::Float)* | :heavy_minus_sign: | N/A | +| `id` | *::String* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/curiosityinsight.md b/docs/models/operations/curiosityinsight.md new file mode 100644 index 00000000..b15605aa --- /dev/null +++ b/docs/models/operations/curiosityinsight.md @@ -0,0 +1,13 @@ +# CuriosityInsight + +Curiosity insight. Attempts to clarify or ask follow-up questions to better understand another person or idea. + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `id` | *::String* | :heavy_check_mark: | N/A | +| `type` | *::String* | :heavy_check_mark: | N/A | +| `probability` | *::Float* | :heavy_check_mark: | N/A | +| `value` | *T.nilable(T::Boolean)* | :heavy_check_mark: | Whether the content shows curiosity. | \ No newline at end of file diff --git a/docs/models/operations/currentproject.md b/docs/models/operations/currentproject.md new file mode 100644 index 00000000..7de3e218 --- /dev/null +++ b/docs/models/operations/currentproject.md @@ -0,0 +1,9 @@ +# CurrentProject + + +## Fields + +| Field | Type | Required | Description | +| --------------------------- | --------------------------- | --------------------------- | --------------------------- | +| `id` | *::String* | :heavy_check_mark: | ID of the current project | +| `name` | *::String* | :heavy_check_mark: | Name of the current project | \ No newline at end of file diff --git a/docs/models/operations/dailyreviewcount.md b/docs/models/operations/dailyreviewcount.md new file mode 100644 index 00000000..0c8d46bd --- /dev/null +++ b/docs/models/operations/dailyreviewcount.md @@ -0,0 +1,9 @@ +# DailyReviewCount + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------ | ------------------------------ | ------------------------------ | ------------------------------ | +| `date` | *::String* | :heavy_check_mark: | Date in YYYY-MM-DD format | +| `count` | *::Float* | :heavy_check_mark: | Number of reviews on this date | \ No newline at end of file diff --git a/docs/models/operations/dataaudio.md b/docs/models/operations/dataaudio.md new file mode 100644 index 00000000..ad7ac4f9 --- /dev/null +++ b/docs/models/operations/dataaudio.md @@ -0,0 +1,11 @@ +# DataAudio + +Audio + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------- | ---------------------------- | ---------------------------- | ---------------------------- | +| `type` | *::String* | :heavy_check_mark: | N/A | +| `url` | *::String* | :heavy_check_mark: | The URL of the audio content | \ No newline at end of file diff --git a/docs/models/operations/dataimage.md b/docs/models/operations/dataimage.md new file mode 100644 index 00000000..887bf2cc --- /dev/null +++ b/docs/models/operations/dataimage.md @@ -0,0 +1,12 @@ +# DataImage + +Image + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | +| `type` | *::String* | :heavy_check_mark: | N/A | +| `url` | *T.nilable(::String)* | :heavy_minus_sign: | A public URL of the image content. Either url or data must be provided. | +| `data` | *T.nilable(::String)* | :heavy_minus_sign: | Base64-encoded image data. Either url or data must be provided. Note: base64 images are not stored and will not appear in the review queue. | \ No newline at end of file diff --git a/docs/models/operations/datatext.md b/docs/models/operations/datatext.md new file mode 100644 index 00000000..7d7e5ad1 --- /dev/null +++ b/docs/models/operations/datatext.md @@ -0,0 +1,11 @@ +# DataText + +Text + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `type` | *::String* | :heavy_check_mark: | N/A | +| `text` | *::String* | :heavy_check_mark: | The content text | \ No newline at end of file diff --git a/docs/models/operations/datavideo.md b/docs/models/operations/datavideo.md new file mode 100644 index 00000000..d58933c9 --- /dev/null +++ b/docs/models/operations/datavideo.md @@ -0,0 +1,11 @@ +# DataVideo + +Video + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------- | --------------------------------- | --------------------------------- | --------------------------------- | +| `type` | *::String* | :heavy_check_mark: | N/A | +| `url` | *::String* | :heavy_check_mark: | A public URL of the video content | \ No newline at end of file diff --git a/docs/models/operations/deleteactionrequest.md b/docs/models/operations/deleteactionrequest.md new file mode 100644 index 00000000..a1776765 --- /dev/null +++ b/docs/models/operations/deleteactionrequest.md @@ -0,0 +1,8 @@ +# DeleteActionRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | +| `id` | *::String* | :heavy_check_mark: | The ID of the action to delete. | \ No newline at end of file diff --git a/docs/models/operations/deleteactionresponse.md b/docs/models/operations/deleteactionresponse.md new file mode 100644 index 00000000..a2e1db5d --- /dev/null +++ b/docs/models/operations/deleteactionresponse.md @@ -0,0 +1,11 @@ +# DeleteActionResponse + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | +| `content_type` | *::String* | :heavy_check_mark: | HTTP response content type for this operation | +| `status_code` | *::Integer* | :heavy_check_mark: | HTTP response status code for this operation | +| `raw_response` | [Faraday::Response](https://www.rubydoc.info/gems/faraday/Faraday/Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `object` | [T.nilable(Models::Operations::DeleteActionResponseBody)](../../models/operations/deleteactionresponsebody.md) | :heavy_minus_sign: | Action deleted successfully | \ No newline at end of file diff --git a/docs/models/operations/deleteactionresponsebody.md b/docs/models/operations/deleteactionresponsebody.md new file mode 100644 index 00000000..c4facf07 --- /dev/null +++ b/docs/models/operations/deleteactionresponsebody.md @@ -0,0 +1,11 @@ +# DeleteActionResponseBody + +Action deleted successfully + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | +| `deleted` | *T::Boolean* | :heavy_check_mark: | Whether the action was deleted. | +| `id` | *::String* | :heavy_check_mark: | The ID of the action. | \ No newline at end of file diff --git a/docs/models/operations/deleteauthorrequest.md b/docs/models/operations/deleteauthorrequest.md new file mode 100644 index 00000000..be733074 --- /dev/null +++ b/docs/models/operations/deleteauthorrequest.md @@ -0,0 +1,8 @@ +# DeleteAuthorRequest + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | +| `id` | *::String* | :heavy_check_mark: | Either external ID or the ID assigned by moderation API. | \ No newline at end of file diff --git a/docs/models/operations/deleteauthorresponse.md b/docs/models/operations/deleteauthorresponse.md new file mode 100644 index 00000000..e20f700a --- /dev/null +++ b/docs/models/operations/deleteauthorresponse.md @@ -0,0 +1,11 @@ +# DeleteAuthorResponse + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | +| `content_type` | *::String* | :heavy_check_mark: | HTTP response content type for this operation | +| `status_code` | *::Integer* | :heavy_check_mark: | HTTP response status code for this operation | +| `raw_response` | [Faraday::Response](https://www.rubydoc.info/gems/faraday/Faraday/Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `object` | [T.nilable(Models::Operations::DeleteAuthorResponseBody)](../../models/operations/deleteauthorresponsebody.md) | :heavy_minus_sign: | Successful response | \ No newline at end of file diff --git a/docs/models/operations/deleteauthorresponsebody.md b/docs/models/operations/deleteauthorresponsebody.md new file mode 100644 index 00000000..b7f281d4 --- /dev/null +++ b/docs/models/operations/deleteauthorresponsebody.md @@ -0,0 +1,10 @@ +# DeleteAuthorResponseBody + +Successful response + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `success` | *T::Boolean* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/deletechannelrequest.md b/docs/models/operations/deletechannelrequest.md new file mode 100644 index 00000000..688382e7 --- /dev/null +++ b/docs/models/operations/deletechannelrequest.md @@ -0,0 +1,8 @@ +# DeleteChannelRequest + + +## Fields + +| Field | Type | Required | Description | +| ---------------------- | ---------------------- | ---------------------- | ---------------------- | +| `id` | *::String* | :heavy_check_mark: | The ID of the channel. | \ No newline at end of file diff --git a/docs/models/operations/deletechannelresponse.md b/docs/models/operations/deletechannelresponse.md new file mode 100644 index 00000000..507a37e9 --- /dev/null +++ b/docs/models/operations/deletechannelresponse.md @@ -0,0 +1,11 @@ +# DeleteChannelResponse + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | +| `content_type` | *::String* | :heavy_check_mark: | HTTP response content type for this operation | +| `status_code` | *::Integer* | :heavy_check_mark: | HTTP response status code for this operation | +| `raw_response` | [Faraday::Response](https://www.rubydoc.info/gems/faraday/Faraday/Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `object` | [T.nilable(Models::Operations::DeleteChannelResponseBody)](../../models/operations/deletechannelresponsebody.md) | :heavy_minus_sign: | Channel deleted successfully | \ No newline at end of file diff --git a/docs/models/operations/deletechannelresponsebody.md b/docs/models/operations/deletechannelresponsebody.md new file mode 100644 index 00000000..b32775a3 --- /dev/null +++ b/docs/models/operations/deletechannelresponsebody.md @@ -0,0 +1,11 @@ +# DeleteChannelResponseBody + +Channel deleted successfully + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------- | -------------------------------- | -------------------------------- | -------------------------------- | +| `deleted` | *T::Boolean* | :heavy_check_mark: | Whether the channel was deleted. | +| `id` | *::String* | :heavy_check_mark: | The ID of the channel. | \ No newline at end of file diff --git a/docs/models/operations/deleteprojectrequest.md b/docs/models/operations/deleteprojectrequest.md new file mode 100644 index 00000000..27940996 --- /dev/null +++ b/docs/models/operations/deleteprojectrequest.md @@ -0,0 +1,8 @@ +# DeleteProjectRequest + + +## Fields + +| Field | Type | Required | Description | +| ---------------------- | ---------------------- | ---------------------- | ---------------------- | +| `id` | *::String* | :heavy_check_mark: | The ID of the project. | \ No newline at end of file diff --git a/docs/models/operations/deleteprojectresponse.md b/docs/models/operations/deleteprojectresponse.md new file mode 100644 index 00000000..e57a21dd --- /dev/null +++ b/docs/models/operations/deleteprojectresponse.md @@ -0,0 +1,11 @@ +# DeleteProjectResponse + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | +| `content_type` | *::String* | :heavy_check_mark: | HTTP response content type for this operation | +| `status_code` | *::Integer* | :heavy_check_mark: | HTTP response status code for this operation | +| `raw_response` | [Faraday::Response](https://www.rubydoc.info/gems/faraday/Faraday/Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `object` | [T.nilable(Models::Operations::DeleteProjectResponseBody)](../../models/operations/deleteprojectresponsebody.md) | :heavy_minus_sign: | Project deleted successfully | \ No newline at end of file diff --git a/docs/models/operations/deleteprojectresponsebody.md b/docs/models/operations/deleteprojectresponsebody.md new file mode 100644 index 00000000..90af3e63 --- /dev/null +++ b/docs/models/operations/deleteprojectresponsebody.md @@ -0,0 +1,11 @@ +# DeleteProjectResponseBody + +Project deleted successfully + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------- | -------------------------------- | -------------------------------- | -------------------------------- | +| `deleted` | *T::Boolean* | :heavy_check_mark: | Whether the project was deleted. | +| `id` | *::String* | :heavy_check_mark: | The ID of the project. | \ No newline at end of file diff --git a/docs/models/operations/deletewebhookrequest.md b/docs/models/operations/deletewebhookrequest.md new file mode 100644 index 00000000..05d52974 --- /dev/null +++ b/docs/models/operations/deletewebhookrequest.md @@ -0,0 +1,8 @@ +# DeleteWebhookRequest + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------- | -------------------------------- | -------------------------------- | -------------------------------- | +| `id` | *::String* | :heavy_check_mark: | The ID of the webhook to delete. | \ No newline at end of file diff --git a/docs/models/operations/deletewebhookresponse.md b/docs/models/operations/deletewebhookresponse.md new file mode 100644 index 00000000..0175b36b --- /dev/null +++ b/docs/models/operations/deletewebhookresponse.md @@ -0,0 +1,11 @@ +# DeleteWebhookResponse + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | +| `content_type` | *::String* | :heavy_check_mark: | HTTP response content type for this operation | +| `status_code` | *::Integer* | :heavy_check_mark: | HTTP response status code for this operation | +| `raw_response` | [Faraday::Response](https://www.rubydoc.info/gems/faraday/Faraday/Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `object` | [T.nilable(Models::Operations::DeleteWebhookResponseBody)](../../models/operations/deletewebhookresponsebody.md) | :heavy_minus_sign: | Webhook deleted successfully | \ No newline at end of file diff --git a/docs/models/operations/deletewebhookresponsebody.md b/docs/models/operations/deletewebhookresponsebody.md new file mode 100644 index 00000000..6281682a --- /dev/null +++ b/docs/models/operations/deletewebhookresponsebody.md @@ -0,0 +1,11 @@ +# DeleteWebhookResponseBody + +Webhook deleted successfully + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------- | -------------------------------- | -------------------------------- | -------------------------------- | +| `deleted` | *T::Boolean* | :heavy_check_mark: | Whether the webhook was deleted. | +| `id` | *::String* | :heavy_check_mark: | The ID of the webhook. | \ No newline at end of file diff --git a/docs/models/operations/drugs.md b/docs/models/operations/drugs.md new file mode 100644 index 00000000..717906a1 --- /dev/null +++ b/docs/models/operations/drugs.md @@ -0,0 +1,10 @@ +# Drugs + + +## Fields + +| Field | Type | Required | Description | +| -------------------- | -------------------- | -------------------- | -------------------- | +| `flag` | *T::Boolean* | :heavy_check_mark: | N/A | +| `threshold` | *T.nilable(::Float)* | :heavy_minus_sign: | N/A | +| `id` | *::String* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/duplicatechannelrequest.md b/docs/models/operations/duplicatechannelrequest.md new file mode 100644 index 00000000..0fead1bd --- /dev/null +++ b/docs/models/operations/duplicatechannelrequest.md @@ -0,0 +1,9 @@ +# DuplicateChannelRequest + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | +| `id` | *::String* | :heavy_check_mark: | The ID of the channel to copy. | +| `body` | [Models::Operations::DuplicateChannelRequestBody](../../models/operations/duplicatechannelrequestbody.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/duplicatechannelrequestbody.md b/docs/models/operations/duplicatechannelrequestbody.md new file mode 100644 index 00000000..52ddc67b --- /dev/null +++ b/docs/models/operations/duplicatechannelrequestbody.md @@ -0,0 +1,9 @@ +# DuplicateChannelRequestBody + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | +| `name` | *T.nilable(::String)* | :heavy_minus_sign: | Name of the copy. Defaults to the original name with "(copy)". | +| `key` | *T.nilable(::String)* | :heavy_minus_sign: | Key of the copy. Defaults to the original key with a timestamp. Must be unique in the project. | \ No newline at end of file diff --git a/docs/models/operations/duplicatechannelresponse.md b/docs/models/operations/duplicatechannelresponse.md new file mode 100644 index 00000000..5f726333 --- /dev/null +++ b/docs/models/operations/duplicatechannelresponse.md @@ -0,0 +1,11 @@ +# DuplicateChannelResponse + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | +| `content_type` | *::String* | :heavy_check_mark: | HTTP response content type for this operation | +| `status_code` | *::Integer* | :heavy_check_mark: | HTTP response status code for this operation | +| `raw_response` | [Faraday::Response](https://www.rubydoc.info/gems/faraday/Faraday/Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `channel` | [T.nilable(Models::Components::Channel)](../../models/shared/channel.md) | :heavy_minus_sign: | Channel duplicated successfully | \ No newline at end of file diff --git a/docs/models/operations/duplicateprojectrequest.md b/docs/models/operations/duplicateprojectrequest.md new file mode 100644 index 00000000..c35ede90 --- /dev/null +++ b/docs/models/operations/duplicateprojectrequest.md @@ -0,0 +1,9 @@ +# DuplicateProjectRequest + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | +| `id` | *::String* | :heavy_check_mark: | The ID of the project to copy. | +| `body` | [Models::Operations::DuplicateProjectRequestBody](../../models/operations/duplicateprojectrequestbody.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/duplicateprojectrequestbody.md b/docs/models/operations/duplicateprojectrequestbody.md new file mode 100644 index 00000000..25fd12b3 --- /dev/null +++ b/docs/models/operations/duplicateprojectrequestbody.md @@ -0,0 +1,8 @@ +# DuplicateProjectRequestBody + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `name` | *T.nilable(::String)* | :heavy_minus_sign: | Name of the copy. Defaults to the original name with "(copy)". | \ No newline at end of file diff --git a/docs/models/operations/duplicateprojectresponse.md b/docs/models/operations/duplicateprojectresponse.md new file mode 100644 index 00000000..2739960d --- /dev/null +++ b/docs/models/operations/duplicateprojectresponse.md @@ -0,0 +1,11 @@ +# DuplicateProjectResponse + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | +| `content_type` | *::String* | :heavy_check_mark: | HTTP response content type for this operation | +| `status_code` | *::Integer* | :heavy_check_mark: | HTTP response status code for this operation | +| `raw_response` | [Faraday::Response](https://www.rubydoc.info/gems/faraday/Faraday/Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `project_with_key` | [T.nilable(Models::Components::ProjectWithKey)](../../models/shared/projectwithkey.md) | :heavy_minus_sign: | Project duplicated successfully | \ No newline at end of file diff --git a/docs/models/operations/entities1.md b/docs/models/operations/entities1.md new file mode 100644 index 00000000..97d58c48 --- /dev/null +++ b/docs/models/operations/entities1.md @@ -0,0 +1,12 @@ +# Entities1 + + +## Fields + +| Field | Type | Required | Description | +| --------------------------- | --------------------------- | --------------------------- | --------------------------- | +| `enable` | *T.nilable(T::Boolean)* | :heavy_minus_sign: | N/A | +| `flag` | *T.nilable(T::Boolean)* | :heavy_minus_sign: | N/A | +| `should_mask` | *T.nilable(T::Boolean)* | :heavy_minus_sign: | N/A | +| `mask` | *T.nilable(::String)* | :heavy_minus_sign: | N/A | +| `additional_properties` | T::Hash[Symbol, *::Object*] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/entities2.md b/docs/models/operations/entities2.md new file mode 100644 index 00000000..dcb13b85 --- /dev/null +++ b/docs/models/operations/entities2.md @@ -0,0 +1,12 @@ +# Entities2 + + +## Fields + +| Field | Type | Required | Description | +| --------------------------- | --------------------------- | --------------------------- | --------------------------- | +| `enable` | *T.nilable(T::Boolean)* | :heavy_minus_sign: | N/A | +| `flag` | *T.nilable(T::Boolean)* | :heavy_minus_sign: | N/A | +| `should_mask` | *T.nilable(T::Boolean)* | :heavy_minus_sign: | N/A | +| `mask` | *T.nilable(::String)* | :heavy_minus_sign: | N/A | +| `additional_properties` | T::Hash[Symbol, *::Object*] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/entitymatcheroutput.md b/docs/models/operations/entitymatcheroutput.md new file mode 100644 index 00000000..6335a23b --- /dev/null +++ b/docs/models/operations/entitymatcheroutput.md @@ -0,0 +1,15 @@ +# EntityMatcherOutput + +Entity matcher policy. + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | +| `id` | *::String* | :heavy_check_mark: | N/A | +| `type` | *::String* | :heavy_check_mark: | N/A | +| `probability` | *::Float* | :heavy_check_mark: | N/A | +| `flagged` | *T::Boolean* | :heavy_check_mark: | N/A | +| `flagged_fields` | T::Array<*::String*> | :heavy_minus_sign: | N/A | +| `matches` | T::Array<[Models::Operations::Match](../../models/operations/match.md)> | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/error.md b/docs/models/operations/error.md new file mode 100644 index 00000000..a5901a99 --- /dev/null +++ b/docs/models/operations/error.md @@ -0,0 +1,9 @@ +# Error + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `id` | *::String* | :heavy_check_mark: | N/A | +| `message` | *::String* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/evaluation.md b/docs/models/operations/evaluation.md new file mode 100644 index 00000000..8b5f7a46 --- /dev/null +++ b/docs/models/operations/evaluation.md @@ -0,0 +1,14 @@ +# Evaluation + +The evaluation of the content after running the channel policies. + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | +| `flagged` | *T::Boolean* | :heavy_check_mark: | Whether the content was flagged by any policy. | +| `flag_probability` | *::Float* | :heavy_check_mark: | The probability that the content should be flagged. | +| `severity_score` | *::Float* | :heavy_check_mark: | The severity score of the content. A higher score indicates more severe content. | +| `unicode_spoofed` | *T.nilable(T::Boolean)* | :heavy_minus_sign: | Whether the content was flagged for Unicode spoofing. | +| `shadow_flagged` | *T.nilable(T::Boolean)* | :heavy_minus_sign: | Whether the content would have been flagged by analyze-only policies (flag: false). | \ No newline at end of file diff --git a/docs/models/operations/executeactionrequest.md b/docs/models/operations/executeactionrequest.md new file mode 100644 index 00000000..e0eb3d4e --- /dev/null +++ b/docs/models/operations/executeactionrequest.md @@ -0,0 +1,15 @@ +# ExecuteActionRequest + +Input parameters + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | +| `action_key` | *::String* | :heavy_check_mark: | ID or key of the action to execute | +| `content_ids` | T::Array<*::String*> | :heavy_minus_sign: | IDs of the content items to apply the action to. Provide this or authorIds. | +| `author_ids` | T::Array<*::String*> | :heavy_minus_sign: | IDs of the authors to apply the action to. Provide this or contentIds. | +| `value` | *T.nilable(::String)* | :heavy_minus_sign: | Optional value to provide with the action | +| `queue_id` | *T.nilable(::String)* | :heavy_minus_sign: | Optional queue ID if the action is queue-specific | +| `duration` | *T.nilable(::Float)* | :heavy_minus_sign: | Optional duration in milliseconds for actions with timeouts | \ No newline at end of file diff --git a/docs/models/operations/executeactionresponse.md b/docs/models/operations/executeactionresponse.md new file mode 100644 index 00000000..8a51a1b0 --- /dev/null +++ b/docs/models/operations/executeactionresponse.md @@ -0,0 +1,11 @@ +# ExecuteActionResponse + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | +| `content_type` | *::String* | :heavy_check_mark: | HTTP response content type for this operation | +| `status_code` | *::Integer* | :heavy_check_mark: | HTTP response status code for this operation | +| `raw_response` | [Faraday::Response](https://www.rubydoc.info/gems/faraday/Faraday/Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `object` | [T.nilable(Models::Operations::ExecuteActionResponseBody)](../../models/operations/executeactionresponsebody.md) | :heavy_minus_sign: | Action executed successfully | \ No newline at end of file diff --git a/docs/models/operations/executeactionresponsebody.md b/docs/models/operations/executeactionresponsebody.md new file mode 100644 index 00000000..f37270ac --- /dev/null +++ b/docs/models/operations/executeactionresponsebody.md @@ -0,0 +1,10 @@ +# ExecuteActionResponseBody + +Execution result + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | +| `success` | *T::Boolean* | :heavy_check_mark: | Whether the action was executed successfully | \ No newline at end of file diff --git a/docs/models/operations/extremism.md b/docs/models/operations/extremism.md new file mode 100644 index 00000000..e8579a1b --- /dev/null +++ b/docs/models/operations/extremism.md @@ -0,0 +1,10 @@ +# Extremism + + +## Fields + +| Field | Type | Required | Description | +| -------------------- | -------------------- | -------------------- | -------------------- | +| `flag` | *T::Boolean* | :heavy_check_mark: | N/A | +| `threshold` | *T.nilable(::Float)* | :heavy_minus_sign: | N/A | +| `id` | *::String* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/facedetection.md b/docs/models/operations/facedetection.md new file mode 100644 index 00000000..fc07dd7d --- /dev/null +++ b/docs/models/operations/facedetection.md @@ -0,0 +1,12 @@ +# FaceDetection + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | +| `flag` | *T::Boolean* | :heavy_check_mark: | N/A | +| `threshold` | *T.nilable(::Float)* | :heavy_minus_sign: | N/A | +| `id` | *::String* | :heavy_check_mark: | N/A | +| `comparator` | [T.nilable(Models::Operations::Comparator)](../../models/operations/comparator.md) | :heavy_minus_sign: | Flag images that contain "at least" or "fewer than" the configured number of faces. Defaults to at_least. | +| `count` | *T.nilable(::Integer)* | :heavy_minus_sign: | Number of faces the comparator applies to. Defaults to 1, so the default rule flags any image containing a face. | \ No newline at end of file diff --git a/docs/models/operations/filter.md b/docs/models/operations/filter.md new file mode 100644 index 00000000..2a4cae08 --- /dev/null +++ b/docs/models/operations/filter.md @@ -0,0 +1,32 @@ +# Filter + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | +| `is_flagged` | [T.nilable(Models::Operations::IsFlagged)](../../models/operations/isflagged.md) | :heavy_minus_sign: | N/A | +| `casebook_answer` | [T.nilable(Models::Operations::CasebookAnswer)](../../models/operations/casebookanswer.md) | :heavy_minus_sign: | N/A | +| `casebook_agreement` | [T.nilable(Models::Operations::CasebookAgreement)](../../models/operations/casebookagreement.md) | :heavy_minus_sign: | N/A | +| `labels` | T::Array<*::String*> | :heavy_minus_sign: | N/A | +| `filter_labels` | T::Array<[Models::Operations::FilterLabel](../../models/operations/filterlabel.md)> | :heavy_minus_sign: | N/A | +| `metadata_filters` | T::Array<[Models::Operations::MetadataFilter](../../models/operations/metadatafilter.md)> | :heavy_minus_sign: | N/A | +| `filtered_channel_ids` | T::Array<*::String*> | :heavy_minus_sign: | N/A | +| `filtered_action_ids` | T::Array<*::String*> | :heavy_minus_sign: | N/A | +| `languages` | T::Array<*::String*> | :heavy_minus_sign: | N/A | +| `content_types` | T::Array<[Models::Operations::GetQueueContentType](../../models/operations/getqueuecontenttype.md)> | :heavy_minus_sign: | N/A | +| `media_types` | T::Array<[Models::Operations::MediaType](../../models/operations/mediatype.md)> | :heavy_minus_sign: | N/A | +| `author_trust_levels` | T::Array<*::Integer*> | :heavy_minus_sign: | N/A | +| `recommendation_actions` | T::Array<[Models::Operations::GetQueueRecommendationAction](../../models/operations/getqueuerecommendationaction.md)> | :heavy_minus_sign: | N/A | +| `min_severity` | *T.nilable(::Integer)* | :heavy_minus_sign: | N/A | +| `max_severity` | *T.nilable(::Integer)* | :heavy_minus_sign: | N/A | +| `after_date` | *T.nilable(::String)* | :heavy_minus_sign: | N/A | +| `before_date` | *T.nilable(::String)* | :heavy_minus_sign: | N/A | +| `within` | *T.nilable(::Float)* | :heavy_minus_sign: | N/A | +| `within_unit` | [T.nilable(Models::Operations::WithinUnit)](../../models/operations/withinunit.md) | :heavy_minus_sign: | N/A | +| `clear_date_window` | *T.nilable(T::Boolean)* | :heavy_minus_sign: | N/A | +| `check_status` | [T.nilable(Models::Operations::CheckStatus)](../../models/operations/checkstatus.md) | :heavy_minus_sign: | N/A | +| `author_id` | *T.nilable(::String)* | :heavy_minus_sign: | N/A | +| `content_id` | *T.nilable(::String)* | :heavy_minus_sign: | N/A | +| `conversation_ids` | T::Array<*::String*> | :heavy_minus_sign: | N/A | +| `search` | T::Array<*::String*> | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/filterlabel.md b/docs/models/operations/filterlabel.md new file mode 100644 index 00000000..73e8e03f --- /dev/null +++ b/docs/models/operations/filterlabel.md @@ -0,0 +1,11 @@ +# FilterLabel + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | +| `label` | *::String* | :heavy_check_mark: | N/A | +| `type` | [Models::Operations::GetQueueType](../../models/operations/getqueuetype.md) | :heavy_check_mark: | N/A | +| `min_threshold` | *T.nilable(::Float)* | :heavy_minus_sign: | N/A | +| `max_threshold` | *T.nilable(::Float)* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/flaggedcontenttrend.md b/docs/models/operations/flaggedcontenttrend.md new file mode 100644 index 00000000..52f24f3a --- /dev/null +++ b/docs/models/operations/flaggedcontenttrend.md @@ -0,0 +1,9 @@ +# FlaggedContentTrend + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | +| `label` | *::String* | :heavy_check_mark: | Content flag/label | +| `trend` | *::Float* | :heavy_check_mark: | Trend indicator (-1 to 1) showing if this type of flagged content is increasing or decreasing | \ No newline at end of file diff --git a/docs/models/operations/flaggingmode.md b/docs/models/operations/flaggingmode.md new file mode 100644 index 00000000..e14ede7f --- /dev/null +++ b/docs/models/operations/flaggingmode.md @@ -0,0 +1,19 @@ +# FlaggingMode + +`ACTIVE` flags content. `DRY_RUN` evaluates content without flagging it. + +## Example Usage + +```ruby +require "moderation_api" + +value = FlaggingMode::DRY_RUN +``` + + +## Values + +| Name | Value | +| --------- | --------- | +| `DRY_RUN` | DRY_RUN | +| `ACTIVE` | ACTIVE | \ No newline at end of file diff --git a/docs/models/operations/gambling.md b/docs/models/operations/gambling.md new file mode 100644 index 00000000..d901d8b8 --- /dev/null +++ b/docs/models/operations/gambling.md @@ -0,0 +1,10 @@ +# Gambling + + +## Fields + +| Field | Type | Required | Description | +| -------------------- | -------------------- | -------------------- | -------------------- | +| `flag` | *T::Boolean* | :heavy_check_mark: | N/A | +| `threshold` | *T.nilable(::Float)* | :heavy_minus_sign: | N/A | +| `id` | *::String* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getaccountresponse.md b/docs/models/operations/getaccountresponse.md new file mode 100644 index 00000000..880cb32b --- /dev/null +++ b/docs/models/operations/getaccountresponse.md @@ -0,0 +1,11 @@ +# GetAccountResponse + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | +| `content_type` | *::String* | :heavy_check_mark: | HTTP response content type for this operation | +| `status_code` | *::Integer* | :heavy_check_mark: | HTTP response status code for this operation | +| `raw_response` | [Faraday::Response](https://www.rubydoc.info/gems/faraday/Faraday/Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `object` | [T.nilable(Models::Operations::GetAccountResponseBody)](../../models/operations/getaccountresponsebody.md) | :heavy_minus_sign: | Account details retrieved successfully | \ No newline at end of file diff --git a/docs/models/operations/getaccountresponsebody.md b/docs/models/operations/getaccountresponsebody.md new file mode 100644 index 00000000..368a1e20 --- /dev/null +++ b/docs/models/operations/getaccountresponsebody.md @@ -0,0 +1,14 @@ +# GetAccountResponseBody + +Account details retrieved successfully + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | +| `id` | *::String* | :heavy_check_mark: | ID of the account | +| `paid_plan_name` | *::String* | :heavy_check_mark: | Name of the paid plan | +| `text_api_quota` | *::Float* | :heavy_check_mark: | Text API quota | +| `remaining_quota` | *::Float* | :heavy_check_mark: | Remaining quota | +| `current_project` | [T.nilable(Models::Operations::CurrentProject)](../../models/operations/currentproject.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getactionposition.md b/docs/models/operations/getactionposition.md new file mode 100644 index 00000000..e7f84cc8 --- /dev/null +++ b/docs/models/operations/getactionposition.md @@ -0,0 +1,23 @@ +# GetActionPosition + +Show the action in all queues, selected queues or no queues (to use via API only). + +## Example Usage + +```ruby +require "moderation_api" + +value = GetActionPosition::ALL_QUEUES + +# Open enum: use .deserialize() to create instances from custom string values +custom = GetActionPosition.deserialize("custom_value") +``` + + +## Values + +| Name | Value | +| ------------- | ------------- | +| `ALL_QUEUES` | ALL_QUEUES | +| `SOME_QUEUES` | SOME_QUEUES | +| `HIDDEN` | HIDDEN | \ No newline at end of file diff --git a/docs/models/operations/getactionpossiblevalue.md b/docs/models/operations/getactionpossiblevalue.md new file mode 100644 index 00000000..12abc5fd --- /dev/null +++ b/docs/models/operations/getactionpossiblevalue.md @@ -0,0 +1,8 @@ +# GetActionPossibleValue + + +## Fields + +| Field | Type | Required | Description | +| ------------------------ | ------------------------ | ------------------------ | ------------------------ | +| `value` | *::String* | :heavy_check_mark: | The value of the action. | \ No newline at end of file diff --git a/docs/models/operations/getactionqueuebehaviour.md b/docs/models/operations/getactionqueuebehaviour.md new file mode 100644 index 00000000..a0a6fd5b --- /dev/null +++ b/docs/models/operations/getactionqueuebehaviour.md @@ -0,0 +1,23 @@ +# GetActionQueueBehaviour + +Whether the action resolves and removes the item, unresolves and re-add it to the queue, or does not change the resolve status. + +## Example Usage + +```ruby +require "moderation_api" + +value = GetActionQueueBehaviour::REMOVE + +# Open enum: use .deserialize() to create instances from custom string values +custom = GetActionQueueBehaviour.deserialize("custom_value") +``` + + +## Values + +| Name | Value | +| ----------- | ----------- | +| `REMOVE` | REMOVE | +| `ADD` | ADD | +| `NO_CHANGE` | NO_CHANGE | \ No newline at end of file diff --git a/docs/models/operations/getactionrequest.md b/docs/models/operations/getactionrequest.md new file mode 100644 index 00000000..e53c84cc --- /dev/null +++ b/docs/models/operations/getactionrequest.md @@ -0,0 +1,8 @@ +# GetActionRequest + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------- | ---------------------------- | ---------------------------- | ---------------------------- | +| `id` | *::String* | :heavy_check_mark: | The ID of the action to get. | \ No newline at end of file diff --git a/docs/models/operations/getactionresponse.md b/docs/models/operations/getactionresponse.md new file mode 100644 index 00000000..fbfa162a --- /dev/null +++ b/docs/models/operations/getactionresponse.md @@ -0,0 +1,11 @@ +# GetActionResponse + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | +| `content_type` | *::String* | :heavy_check_mark: | HTTP response content type for this operation | +| `status_code` | *::Integer* | :heavy_check_mark: | HTTP response status code for this operation | +| `raw_response` | [Faraday::Response](https://www.rubydoc.info/gems/faraday/Faraday/Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `object` | [T.nilable(Models::Operations::GetActionResponseBody)](../../models/operations/getactionresponsebody.md) | :heavy_minus_sign: | Action retrieved successfully | \ No newline at end of file diff --git a/docs/models/operations/getactionresponsebody.md b/docs/models/operations/getactionresponsebody.md new file mode 100644 index 00000000..8cd6e511 --- /dev/null +++ b/docs/models/operations/getactionresponsebody.md @@ -0,0 +1,22 @@ +# GetActionResponseBody + +Action retrieved successfully + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *::String* | :heavy_check_mark: | The ID of the action. | +| `key` | *T.nilable(::String)* | :heavy_minus_sign: | User defined key of the action. | +| `created_at` | *::String* | :heavy_check_mark: | The date the action was created. | +| `name` | *::String* | :heavy_check_mark: | The name of the action. | +| `description` | *T.nilable(::String)* | :heavy_minus_sign: | The description of the action. | +| `type` | [T.nilable(Models::Operations::GetActionType)](../../models/operations/getactiontype.md) | :heavy_minus_sign: | The type of the action. | +| `built_in` | *T.nilable(T::Boolean)* | :heavy_minus_sign: | Whether the action is a built-in action or a custom one. | +| `queue_behaviour` | [T.nilable(Models::Operations::GetActionQueueBehaviour)](../../models/operations/getactionqueuebehaviour.md) | :heavy_minus_sign: | Whether the action resolves and removes the item, unresolves and re-add it to the queue, or does not change the resolve status. | +| `filter_in_queue_ids` | T::Array<*::String*> | :heavy_check_mark: | The IDs of the queues the action is available in. | +| `position` | [T.nilable(Models::Operations::GetActionPosition)](../../models/operations/getactionposition.md) | :heavy_minus_sign: | Show the action in all queues, selected queues or no queues (to use via API only). | +| `possible_values` | T::Array<[Models::Operations::GetActionPossibleValue](../../models/operations/getactionpossiblevalue.md)> | :heavy_check_mark: | The possible values of the action. The user will be prompted to select one of these values when executing the action. | +| `value_required` | *T.nilable(T::Boolean)* | :heavy_minus_sign: | Whether the action requires a value to be executed. | +| `free_text` | *T.nilable(T::Boolean)* | :heavy_minus_sign: | Whether the action allows any text to be entered as a value or if it must be one of the possible values. | \ No newline at end of file diff --git a/docs/models/operations/getactiontype.md b/docs/models/operations/getactiontype.md new file mode 100644 index 00000000..b668b5e0 --- /dev/null +++ b/docs/models/operations/getactiontype.md @@ -0,0 +1,28 @@ +# GetActionType + +## Example Usage + +```ruby +require "moderation_api" + +value = GetActionType::AUTHOR_BLOCK + +# Open enum: use .deserialize() to create instances from custom string values +custom = GetActionType.deserialize("custom_value") +``` + + +## Values + +| Name | Value | +| ------------------- | ------------------- | +| `AUTHOR_BLOCK` | AUTHOR_BLOCK | +| `AUTHOR_BLOCK_TEMP` | AUTHOR_BLOCK_TEMP | +| `AUTHOR_UNBLOCK` | AUTHOR_UNBLOCK | +| `AUTHOR_DELETE` | AUTHOR_DELETE | +| `AUTHOR_REPORT` | AUTHOR_REPORT | +| `AUTHOR_WARN` | AUTHOR_WARN | +| `AUTHOR_CUSTOM` | AUTHOR_CUSTOM | +| `ITEM_REJECT` | ITEM_REJECT | +| `ITEM_ALLOW` | ITEM_ALLOW | +| `ITEM_CUSTOM` | ITEM_CUSTOM | \ No newline at end of file diff --git a/docs/models/operations/getauthorrequest.md b/docs/models/operations/getauthorrequest.md new file mode 100644 index 00000000..199b5096 --- /dev/null +++ b/docs/models/operations/getauthorrequest.md @@ -0,0 +1,8 @@ +# GetAuthorRequest + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | +| `id` | *::String* | :heavy_check_mark: | Either external ID or the ID assigned by moderation API. | \ No newline at end of file diff --git a/docs/models/operations/getauthorresponse.md b/docs/models/operations/getauthorresponse.md new file mode 100644 index 00000000..809b262a --- /dev/null +++ b/docs/models/operations/getauthorresponse.md @@ -0,0 +1,11 @@ +# GetAuthorResponse + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| `content_type` | *::String* | :heavy_check_mark: | HTTP response content type for this operation | +| `status_code` | *::Integer* | :heavy_check_mark: | HTTP response status code for this operation | +| `raw_response` | [Faraday::Response](https://www.rubydoc.info/gems/faraday/Faraday/Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `public_author` | [T.nilable(Models::Components::PublicAuthor)](../../models/shared/publicauthor.md) | :heavy_minus_sign: | Successful response | \ No newline at end of file diff --git a/docs/models/operations/getchannelrequest.md b/docs/models/operations/getchannelrequest.md new file mode 100644 index 00000000..774c20b6 --- /dev/null +++ b/docs/models/operations/getchannelrequest.md @@ -0,0 +1,8 @@ +# GetChannelRequest + + +## Fields + +| Field | Type | Required | Description | +| ---------------------- | ---------------------- | ---------------------- | ---------------------- | +| `id` | *::String* | :heavy_check_mark: | The ID of the channel. | \ No newline at end of file diff --git a/docs/models/operations/getchannelresponse.md b/docs/models/operations/getchannelresponse.md new file mode 100644 index 00000000..8686a46e --- /dev/null +++ b/docs/models/operations/getchannelresponse.md @@ -0,0 +1,11 @@ +# GetChannelResponse + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | +| `content_type` | *::String* | :heavy_check_mark: | HTTP response content type for this operation | +| `status_code` | *::Integer* | :heavy_check_mark: | HTTP response status code for this operation | +| `raw_response` | [Faraday::Response](https://www.rubydoc.info/gems/faraday/Faraday/Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `channel` | [T.nilable(Models::Components::Channel)](../../models/shared/channel.md) | :heavy_minus_sign: | Channel retrieved successfully | \ No newline at end of file diff --git a/docs/models/operations/getprojectrequest.md b/docs/models/operations/getprojectrequest.md new file mode 100644 index 00000000..700d5406 --- /dev/null +++ b/docs/models/operations/getprojectrequest.md @@ -0,0 +1,8 @@ +# GetProjectRequest + + +## Fields + +| Field | Type | Required | Description | +| ---------------------- | ---------------------- | ---------------------- | ---------------------- | +| `id` | *::String* | :heavy_check_mark: | The ID of the project. | \ No newline at end of file diff --git a/docs/models/operations/getprojectresponse.md b/docs/models/operations/getprojectresponse.md new file mode 100644 index 00000000..d331b7cc --- /dev/null +++ b/docs/models/operations/getprojectresponse.md @@ -0,0 +1,11 @@ +# GetProjectResponse + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | +| `content_type` | *::String* | :heavy_check_mark: | HTTP response content type for this operation | +| `status_code` | *::Integer* | :heavy_check_mark: | HTTP response status code for this operation | +| `raw_response` | [Faraday::Response](https://www.rubydoc.info/gems/faraday/Faraday/Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `project` | [T.nilable(Models::Components::Project)](../../models/shared/project.md) | :heavy_minus_sign: | Project retrieved successfully | \ No newline at end of file diff --git a/docs/models/operations/getqueuecontenttype.md b/docs/models/operations/getqueuecontenttype.md new file mode 100644 index 00000000..d0d87005 --- /dev/null +++ b/docs/models/operations/getqueuecontenttype.md @@ -0,0 +1,27 @@ +# GetQueueContentType + +## Example Usage + +```ruby +require "moderation_api" + +value = GetQueueContentType::PROFILE + +# Open enum: use .deserialize() to create instances from custom string values +custom = GetQueueContentType.deserialize("custom_value") +``` + + +## Values + +| Name | Value | +| --------- | --------- | +| `PROFILE` | profile | +| `MESSAGE` | message | +| `POST` | post | +| `COMMENT` | comment | +| `EVENT` | event | +| `PRODUCT` | product | +| `REVIEW` | review | +| `VOICE` | voice | +| `OTHER` | other | \ No newline at end of file diff --git a/docs/models/operations/getqueuerecommendationaction.md b/docs/models/operations/getqueuerecommendationaction.md new file mode 100644 index 00000000..3b8605d4 --- /dev/null +++ b/docs/models/operations/getqueuerecommendationaction.md @@ -0,0 +1,21 @@ +# GetQueueRecommendationAction + +## Example Usage + +```ruby +require "moderation_api" + +value = GetQueueRecommendationAction::REVIEW + +# Open enum: use .deserialize() to create instances from custom string values +custom = GetQueueRecommendationAction.deserialize("custom_value") +``` + + +## Values + +| Name | Value | +| -------- | -------- | +| `REVIEW` | review | +| `ALLOW` | allow | +| `REJECT` | reject | \ No newline at end of file diff --git a/docs/models/operations/getqueuerequest.md b/docs/models/operations/getqueuerequest.md new file mode 100644 index 00000000..105139e9 --- /dev/null +++ b/docs/models/operations/getqueuerequest.md @@ -0,0 +1,8 @@ +# GetQueueRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `id` | *::String* | :heavy_check_mark: | The queue ID | \ No newline at end of file diff --git a/docs/models/operations/getqueueresponse.md b/docs/models/operations/getqueueresponse.md new file mode 100644 index 00000000..0b54c7f2 --- /dev/null +++ b/docs/models/operations/getqueueresponse.md @@ -0,0 +1,11 @@ +# GetQueueResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | +| `content_type` | *::String* | :heavy_check_mark: | HTTP response content type for this operation | +| `status_code` | *::Integer* | :heavy_check_mark: | HTTP response status code for this operation | +| `raw_response` | [Faraday::Response](https://www.rubydoc.info/gems/faraday/Faraday/Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `object` | [T.nilable(Models::Operations::GetQueueResponseBody)](../../models/operations/getqueueresponsebody.md) | :heavy_minus_sign: | Successful response | \ No newline at end of file diff --git a/docs/models/operations/getqueueresponsebody.md b/docs/models/operations/getqueueresponsebody.md new file mode 100644 index 00000000..e8686fdb --- /dev/null +++ b/docs/models/operations/getqueueresponsebody.md @@ -0,0 +1,10 @@ +# GetQueueResponseBody + +Successful response + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | +| `queue` | [Models::Operations::Queue](../../models/operations/queue.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getqueuestatsrequest.md b/docs/models/operations/getqueuestatsrequest.md new file mode 100644 index 00000000..555ba738 --- /dev/null +++ b/docs/models/operations/getqueuestatsrequest.md @@ -0,0 +1,9 @@ +# GetQueueStatsRequest + + +## Fields + +| Field | Type | Required | Description | +| ---------------------- | ---------------------- | ---------------------- | ---------------------- | +| `id` | *::String* | :heavy_check_mark: | The queue ID | +| `within_days` | *T.nilable(::Integer)* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getqueuestatsresponse.md b/docs/models/operations/getqueuestatsresponse.md new file mode 100644 index 00000000..f2b6cd9d --- /dev/null +++ b/docs/models/operations/getqueuestatsresponse.md @@ -0,0 +1,11 @@ +# GetQueueStatsResponse + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | +| `content_type` | *::String* | :heavy_check_mark: | HTTP response content type for this operation | +| `status_code` | *::Integer* | :heavy_check_mark: | HTTP response status code for this operation | +| `raw_response` | [Faraday::Response](https://www.rubydoc.info/gems/faraday/Faraday/Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `object` | [T.nilable(Models::Operations::GetQueueStatsResponseBody)](../../models/operations/getqueuestatsresponsebody.md) | :heavy_minus_sign: | Successful response | \ No newline at end of file diff --git a/docs/models/operations/getqueuestatsresponsebody.md b/docs/models/operations/getqueuestatsresponsebody.md new file mode 100644 index 00000000..f3cd8ce1 --- /dev/null +++ b/docs/models/operations/getqueuestatsresponsebody.md @@ -0,0 +1,13 @@ +# GetQueueStatsResponseBody + +Successful response + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | +| `review_stats` | [Models::Operations::ReviewStats](../../models/operations/reviewstats.md) | :heavy_check_mark: | N/A | +| `action_stats` | T::Array<[Models::Operations::ActionStat](../../models/operations/actionstat.md)> | :heavy_check_mark: | N/A | +| `top_reviewers` | T::Array<[Models::Operations::TopReviewer](../../models/operations/topreviewer.md)> | :heavy_check_mark: | List of top reviewers and their statistics | +| `trends` | [Models::Operations::Trends](../../models/operations/trends.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getqueuetype.md b/docs/models/operations/getqueuetype.md new file mode 100644 index 00000000..bcb720f0 --- /dev/null +++ b/docs/models/operations/getqueuetype.md @@ -0,0 +1,22 @@ +# GetQueueType + +## Example Usage + +```ruby +require "moderation_api" + +value = GetQueueType::FLAGGED + +# Open enum: use .deserialize() to create instances from custom string values +custom = GetQueueType.deserialize("custom_value") +``` + + +## Values + +| Name | Value | +| ------------- | ------------- | +| `FLAGGED` | FLAGGED | +| `NOT_FLAGGED` | NOT_FLAGGED | +| `THRESHOLDS` | THRESHOLDS | +| `MATCHED` | MATCHED | \ No newline at end of file diff --git a/docs/models/operations/getwebhookeventtype.md b/docs/models/operations/getwebhookeventtype.md new file mode 100644 index 00000000..2fd44b95 --- /dev/null +++ b/docs/models/operations/getwebhookeventtype.md @@ -0,0 +1,29 @@ +# GetWebhookEventType + +## Example Usage + +```ruby +require "moderation_api" + +value = GetWebhookEventType::QUEUE_ITEM_NEW + +# Open enum: use .deserialize() to create instances from custom string values +custom = GetWebhookEventType.deserialize("custom_value") +``` + + +## Values + +| Name | Value | +| ---------------------------- | ---------------------------- | +| `QUEUE_ITEM_NEW` | QUEUE_ITEM_NEW | +| `QUEUE_ITEM_COMPLETED` | QUEUE_ITEM_COMPLETED | +| `QUEUE_ITEM_ACTION` | QUEUE_ITEM_ACTION | +| `QUEUE_ITEM_REJECTED` | QUEUE_ITEM_REJECTED | +| `QUEUE_ITEM_ALLOWED` | QUEUE_ITEM_ALLOWED | +| `AUTHOR_BLOCKED` | AUTHOR_BLOCKED | +| `AUTHOR_UNBLOCKED` | AUTHOR_UNBLOCKED | +| `AUTHOR_SUSPENDED` | AUTHOR_SUSPENDED | +| `AUTHOR_UPDATED` | AUTHOR_UPDATED | +| `AUTHOR_TRUST_LEVEL_CHANGED` | AUTHOR_TRUST_LEVEL_CHANGED | +| `AUTHOR_ACTION` | AUTHOR_ACTION | \ No newline at end of file diff --git a/docs/models/operations/getwebhookpayloadversion.md b/docs/models/operations/getwebhookpayloadversion.md new file mode 100644 index 00000000..01962f48 --- /dev/null +++ b/docs/models/operations/getwebhookpayloadversion.md @@ -0,0 +1,22 @@ +# GetWebhookPayloadVersion + +Payload envelope version. V2 is the Stripe-style envelope; V1 is the legacy flat shape and is read-only via this API. + +## Example Usage + +```ruby +require "moderation_api" + +value = GetWebhookPayloadVersion::V1 + +# Open enum: use .deserialize() to create instances from custom string values +custom = GetWebhookPayloadVersion.deserialize("custom_value") +``` + + +## Values + +| Name | Value | +| ----- | ----- | +| `V1` | V1 | +| `V2` | V2 | \ No newline at end of file diff --git a/docs/models/operations/getwebhookrequest.md b/docs/models/operations/getwebhookrequest.md new file mode 100644 index 00000000..1aec7fdf --- /dev/null +++ b/docs/models/operations/getwebhookrequest.md @@ -0,0 +1,8 @@ +# GetWebhookRequest + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------- | ----------------------------- | ----------------------------- | ----------------------------- | +| `id` | *::String* | :heavy_check_mark: | The ID of the webhook to get. | \ No newline at end of file diff --git a/docs/models/operations/getwebhookresponse.md b/docs/models/operations/getwebhookresponse.md new file mode 100644 index 00000000..c526b5e1 --- /dev/null +++ b/docs/models/operations/getwebhookresponse.md @@ -0,0 +1,11 @@ +# GetWebhookResponse + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | +| `content_type` | *::String* | :heavy_check_mark: | HTTP response content type for this operation | +| `status_code` | *::Integer* | :heavy_check_mark: | HTTP response status code for this operation | +| `raw_response` | [Faraday::Response](https://www.rubydoc.info/gems/faraday/Faraday/Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `object` | [T.nilable(Models::Operations::GetWebhookResponseBody)](../../models/operations/getwebhookresponsebody.md) | :heavy_minus_sign: | Webhook retrieved successfully | \ No newline at end of file diff --git a/docs/models/operations/getwebhookresponsebody.md b/docs/models/operations/getwebhookresponsebody.md new file mode 100644 index 00000000..31e6239c --- /dev/null +++ b/docs/models/operations/getwebhookresponsebody.md @@ -0,0 +1,16 @@ +# GetWebhookResponseBody + +Webhook retrieved successfully + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *::String* | :heavy_check_mark: | The ID of the webhook. | +| `name` | *::String* | :heavy_check_mark: | The webhook's name. | +| `description` | *T.nilable(::String)* | :heavy_minus_sign: | The webhook's description. | +| `url` | *::String* | :heavy_check_mark: | The URL we call when a subscribed event occurs. | +| `event_types` | T::Array<[Models::Operations::GetWebhookEventType](../../models/operations/getwebhookeventtype.md)> | :heavy_check_mark: | Event types this webhook subscribes to. Empty for legacy v1 webhooks, which subscribe via their single deprecated `type` instead. | +| `payload_version` | [Models::Operations::GetWebhookPayloadVersion](../../models/operations/getwebhookpayloadversion.md) | :heavy_check_mark: | Payload envelope version. V2 is the Stripe-style envelope; V1 is the legacy flat shape and is read-only via this API. | +| `created_at` | *::String* | :heavy_check_mark: | The date the webhook was created. | \ No newline at end of file diff --git a/docs/models/operations/getwebhooksecretresponse.md b/docs/models/operations/getwebhooksecretresponse.md new file mode 100644 index 00000000..45f8a130 --- /dev/null +++ b/docs/models/operations/getwebhooksecretresponse.md @@ -0,0 +1,11 @@ +# GetWebhookSecretResponse + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | +| `content_type` | *::String* | :heavy_check_mark: | HTTP response content type for this operation | +| `status_code` | *::Integer* | :heavy_check_mark: | HTTP response status code for this operation | +| `raw_response` | [Faraday::Response](https://www.rubydoc.info/gems/faraday/Faraday/Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `object` | [T.nilable(Models::Operations::GetWebhookSecretResponseBody)](../../models/operations/getwebhooksecretresponsebody.md) | :heavy_minus_sign: | Signing secret retrieved successfully | \ No newline at end of file diff --git a/docs/models/operations/getwebhooksecretresponsebody.md b/docs/models/operations/getwebhooksecretresponsebody.md new file mode 100644 index 00000000..a5119f3d --- /dev/null +++ b/docs/models/operations/getwebhooksecretresponsebody.md @@ -0,0 +1,10 @@ +# GetWebhookSecretResponseBody + +Signing secret retrieved successfully + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `secret` | *::String* | :heavy_check_mark: | The signing secret for this project. Every webhook delivery is signed with HMAC-SHA256 over the raw JSON body, hex-encoded in the `modapi-signature` header. | \ No newline at end of file diff --git a/docs/models/operations/getwordlistembeddingstatusrequest.md b/docs/models/operations/getwordlistembeddingstatusrequest.md new file mode 100644 index 00000000..51285567 --- /dev/null +++ b/docs/models/operations/getwordlistembeddingstatusrequest.md @@ -0,0 +1,8 @@ +# GetWordlistEmbeddingStatusRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ | +| `id` | *::String* | :heavy_check_mark: | ID of the wordlist to check embedding status for | \ No newline at end of file diff --git a/docs/models/operations/getwordlistembeddingstatusresponse.md b/docs/models/operations/getwordlistembeddingstatusresponse.md new file mode 100644 index 00000000..3c2ce6bf --- /dev/null +++ b/docs/models/operations/getwordlistembeddingstatusresponse.md @@ -0,0 +1,11 @@ +# GetWordlistEmbeddingStatusResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ | +| `content_type` | *::String* | :heavy_check_mark: | HTTP response content type for this operation | +| `status_code` | *::Integer* | :heavy_check_mark: | HTTP response status code for this operation | +| `raw_response` | [Faraday::Response](https://www.rubydoc.info/gems/faraday/Faraday/Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `object` | [T.nilable(Models::Operations::GetWordlistEmbeddingStatusResponseBody)](../../models/operations/getwordlistembeddingstatusresponsebody.md) | :heavy_minus_sign: | Successful response | \ No newline at end of file diff --git a/docs/models/operations/getwordlistembeddingstatusresponsebody.md b/docs/models/operations/getwordlistembeddingstatusresponsebody.md new file mode 100644 index 00000000..54342e9d --- /dev/null +++ b/docs/models/operations/getwordlistembeddingstatusresponsebody.md @@ -0,0 +1,12 @@ +# GetWordlistEmbeddingStatusResponseBody + +Embedding status details + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------- | --------------------------------------------------- | --------------------------------------------------- | --------------------------------------------------- | +| `progress` | *::Float* | :heavy_check_mark: | Percentage of words that have been embedded (0-100) | +| `total_words` | *::Float* | :heavy_check_mark: | Total number of words in the wordlist | +| `remaining_words` | *::Float* | :heavy_check_mark: | Number of words still waiting to be embedded | \ No newline at end of file diff --git a/docs/models/operations/getwordlistrequest.md b/docs/models/operations/getwordlistrequest.md new file mode 100644 index 00000000..c88b8cb1 --- /dev/null +++ b/docs/models/operations/getwordlistrequest.md @@ -0,0 +1,8 @@ +# GetWordlistRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------------- | ------------------------- | ------------------------- | ------------------------- | +| `id` | *::String* | :heavy_check_mark: | ID of the wordlist to get | \ No newline at end of file diff --git a/docs/models/operations/getwordlistresponse.md b/docs/models/operations/getwordlistresponse.md new file mode 100644 index 00000000..5a410305 --- /dev/null +++ b/docs/models/operations/getwordlistresponse.md @@ -0,0 +1,11 @@ +# GetWordlistResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | +| `content_type` | *::String* | :heavy_check_mark: | HTTP response content type for this operation | +| `status_code` | *::Integer* | :heavy_check_mark: | HTTP response status code for this operation | +| `raw_response` | [Faraday::Response](https://www.rubydoc.info/gems/faraday/Faraday/Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `object` | [T.nilable(Models::Operations::GetWordlistResponseBody)](../../models/operations/getwordlistresponsebody.md) | :heavy_minus_sign: | Successful response | \ No newline at end of file diff --git a/docs/models/operations/getwordlistresponsebody.md b/docs/models/operations/getwordlistresponsebody.md new file mode 100644 index 00000000..da019fa2 --- /dev/null +++ b/docs/models/operations/getwordlistresponsebody.md @@ -0,0 +1,16 @@ +# GetWordlistResponseBody + +Successful response + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------- | ----------------------------- | ----------------------------- | ----------------------------- | +| `id` | *::String* | :heavy_check_mark: | ID of the wordlist | +| `name` | *T.nilable(::String)* | :heavy_check_mark: | N/A | +| `words` | T::Array<*::String*> | :heavy_check_mark: | Words in the wordlist | +| `created_at` | *::String* | :heavy_check_mark: | Creation date of the wordlist | +| `organization_id` | *::String* | :heavy_check_mark: | ID of the organization | +| `user_id` | *T.nilable(::String)* | :heavy_check_mark: | N/A | +| `strict` | *T::Boolean* | :heavy_check_mark: | Strict mode | \ No newline at end of file diff --git a/docs/models/operations/globalflaggingmode.md b/docs/models/operations/globalflaggingmode.md new file mode 100644 index 00000000..b0107329 --- /dev/null +++ b/docs/models/operations/globalflaggingmode.md @@ -0,0 +1,19 @@ +# GlobalFlaggingMode + +`ACTIVE` flags content. `DRY_RUN` evaluates without flagging. + +## Example Usage + +```ruby +require "moderation_api" + +value = GlobalFlaggingMode::DRY_RUN +``` + + +## Values + +| Name | Value | +| --------- | --------- | +| `DRY_RUN` | DRY_RUN | +| `ACTIVE` | ACTIVE | \ No newline at end of file diff --git a/docs/models/operations/guideline.md b/docs/models/operations/guideline.md new file mode 100644 index 00000000..bde28f94 --- /dev/null +++ b/docs/models/operations/guideline.md @@ -0,0 +1,12 @@ +# Guideline + + +## Fields + +| Field | Type | Required | Description | +| -------------------- | -------------------- | -------------------- | -------------------- | +| `flag` | *T::Boolean* | :heavy_check_mark: | N/A | +| `threshold` | *T.nilable(::Float)* | :heavy_minus_sign: | N/A | +| `id` | *::String* | :heavy_check_mark: | N/A | +| `instructions` | *::String* | :heavy_check_mark: | N/A | +| `guideline_key` | *::String* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/hate.md b/docs/models/operations/hate.md new file mode 100644 index 00000000..3b811611 --- /dev/null +++ b/docs/models/operations/hate.md @@ -0,0 +1,10 @@ +# Hate + + +## Fields + +| Field | Type | Required | Description | +| -------------------- | -------------------- | -------------------- | -------------------- | +| `flag` | *T::Boolean* | :heavy_check_mark: | N/A | +| `threshold` | *T.nilable(::Float)* | :heavy_minus_sign: | N/A | +| `id` | *::String* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/illegaltrade.md b/docs/models/operations/illegaltrade.md new file mode 100644 index 00000000..9272833e --- /dev/null +++ b/docs/models/operations/illegaltrade.md @@ -0,0 +1,10 @@ +# IllegalTrade + + +## Fields + +| Field | Type | Required | Description | +| -------------------- | -------------------- | -------------------- | -------------------- | +| `flag` | *T::Boolean* | :heavy_check_mark: | N/A | +| `threshold` | *T.nilable(::Float)* | :heavy_minus_sign: | N/A | +| `id` | *::String* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/illicit.md b/docs/models/operations/illicit.md new file mode 100644 index 00000000..efa23b58 --- /dev/null +++ b/docs/models/operations/illicit.md @@ -0,0 +1,10 @@ +# Illicit + + +## Fields + +| Field | Type | Required | Description | +| -------------------- | -------------------- | -------------------- | -------------------- | +| `flag` | *T::Boolean* | :heavy_check_mark: | N/A | +| `threshold` | *T.nilable(::Float)* | :heavy_minus_sign: | N/A | +| `id` | *::String* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/illicitalcohol.md b/docs/models/operations/illicitalcohol.md new file mode 100644 index 00000000..42de1436 --- /dev/null +++ b/docs/models/operations/illicitalcohol.md @@ -0,0 +1,10 @@ +# IllicitAlcohol + + +## Fields + +| Field | Type | Required | Description | +| -------------------- | -------------------- | -------------------- | -------------------- | +| `flag` | *T::Boolean* | :heavy_check_mark: | N/A | +| `threshold` | *T.nilable(::Float)* | :heavy_minus_sign: | N/A | +| `id` | *::String* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/illicitdrugs.md b/docs/models/operations/illicitdrugs.md new file mode 100644 index 00000000..d926d1e2 --- /dev/null +++ b/docs/models/operations/illicitdrugs.md @@ -0,0 +1,10 @@ +# IllicitDrugs + + +## Fields + +| Field | Type | Required | Description | +| -------------------- | -------------------- | -------------------- | -------------------- | +| `flag` | *T::Boolean* | :heavy_check_mark: | N/A | +| `threshold` | *T.nilable(::Float)* | :heavy_minus_sign: | N/A | +| `id` | *::String* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/illicitfirearms.md b/docs/models/operations/illicitfirearms.md new file mode 100644 index 00000000..3bbdc223 --- /dev/null +++ b/docs/models/operations/illicitfirearms.md @@ -0,0 +1,10 @@ +# IllicitFirearms + + +## Fields + +| Field | Type | Required | Description | +| -------------------- | -------------------- | -------------------- | -------------------- | +| `flag` | *T::Boolean* | :heavy_check_mark: | N/A | +| `threshold` | *T.nilable(::Float)* | :heavy_minus_sign: | N/A | +| `id` | *::String* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/illicitgambling.md b/docs/models/operations/illicitgambling.md new file mode 100644 index 00000000..19524cc9 --- /dev/null +++ b/docs/models/operations/illicitgambling.md @@ -0,0 +1,10 @@ +# IllicitGambling + + +## Fields + +| Field | Type | Required | Description | +| -------------------- | -------------------- | -------------------- | -------------------- | +| `flag` | *T::Boolean* | :heavy_check_mark: | N/A | +| `threshold` | *T.nilable(::Float)* | :heavy_minus_sign: | N/A | +| `id` | *::String* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/illicittobacco.md b/docs/models/operations/illicittobacco.md new file mode 100644 index 00000000..7c167670 --- /dev/null +++ b/docs/models/operations/illicittobacco.md @@ -0,0 +1,10 @@ +# IllicitTobacco + + +## Fields + +| Field | Type | Required | Description | +| -------------------- | -------------------- | -------------------- | -------------------- | +| `flag` | *T::Boolean* | :heavy_check_mark: | N/A | +| `threshold` | *T.nilable(::Float)* | :heavy_minus_sign: | N/A | +| `id` | *::String* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/imagerequest.md b/docs/models/operations/imagerequest.md new file mode 100644 index 00000000..2d0912cc --- /dev/null +++ b/docs/models/operations/imagerequest.md @@ -0,0 +1,12 @@ +# ImageRequest + +Image + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | +| `type` | *::String* | :heavy_check_mark: | N/A | +| `url` | *T.nilable(::String)* | :heavy_minus_sign: | A public URL of the image content. Either url or data must be provided. | +| `data` | *T.nilable(::String)* | :heavy_minus_sign: | Base64-encoded image data. Either url or data must be provided. Note: base64 images are not stored and will not appear in the review queue. | \ No newline at end of file diff --git a/docs/models/operations/imageresponse.md b/docs/models/operations/imageresponse.md new file mode 100644 index 00000000..f4c48224 --- /dev/null +++ b/docs/models/operations/imageresponse.md @@ -0,0 +1,12 @@ +# ImageResponse + +Image + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | +| `type` | *::String* | :heavy_check_mark: | N/A | +| `url` | *T.nilable(::String)* | :heavy_minus_sign: | A public URL of the image content. Either url or data must be provided. | +| `data` | *T.nilable(::String)* | :heavy_minus_sign: | Base64-encoded image data. Either url or data must be provided. Note: base64 images are not stored and will not appear in the review queue. | \ No newline at end of file diff --git a/docs/models/operations/insight.md b/docs/models/operations/insight.md new file mode 100644 index 00000000..829e588a --- /dev/null +++ b/docs/models/operations/insight.md @@ -0,0 +1,2 @@ +# Insight + diff --git a/docs/models/operations/isflagged.md b/docs/models/operations/isflagged.md new file mode 100644 index 00000000..415bc200 --- /dev/null +++ b/docs/models/operations/isflagged.md @@ -0,0 +1,22 @@ +# IsFlagged + +## Example Usage + +```ruby +require "moderation_api" + +value = IsFlagged::ALL + +# Open enum: use .deserialize() to create instances from custom string values +custom = IsFlagged.deserialize("custom_value") +``` + + +## Values + +| Name | Value | +| ---------------- | ---------------- | +| `ALL` | ALL | +| `FLAGGED` | FLAGGED | +| `NOT_FLAGGED` | NOT_FLAGGED | +| `SHADOW_FLAGGED` | SHADOW_FLAGGED | \ No newline at end of file diff --git a/docs/models/operations/languageinsight.md b/docs/models/operations/languageinsight.md new file mode 100644 index 00000000..04d29597 --- /dev/null +++ b/docs/models/operations/languageinsight.md @@ -0,0 +1,13 @@ +# LanguageInsight + +Language insight + + +## Fields + +| Field | Type | Required | Description | +| --------------------- | --------------------- | --------------------- | --------------------- | +| `id` | *::String* | :heavy_check_mark: | N/A | +| `type` | *::String* | :heavy_check_mark: | N/A | +| `probability` | *::Float* | :heavy_check_mark: | N/A | +| `value` | *T.nilable(::String)* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/listactionsdata.md b/docs/models/operations/listactionsdata.md new file mode 100644 index 00000000..ee53cd4a --- /dev/null +++ b/docs/models/operations/listactionsdata.md @@ -0,0 +1,20 @@ +# ListActionsData + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *::String* | :heavy_check_mark: | The ID of the action. | +| `key` | *T.nilable(::String)* | :heavy_minus_sign: | User defined key of the action. | +| `created_at` | *::String* | :heavy_check_mark: | The date the action was created. | +| `name` | *::String* | :heavy_check_mark: | The name of the action. | +| `description` | *T.nilable(::String)* | :heavy_minus_sign: | The description of the action. | +| `type` | [T.nilable(Models::Operations::ListActionsType)](../../models/operations/listactionstype.md) | :heavy_minus_sign: | The type of the action. | +| `built_in` | *T.nilable(T::Boolean)* | :heavy_minus_sign: | Whether the action is a built-in action or a custom one. | +| `queue_behaviour` | [T.nilable(Models::Operations::ListActionsQueueBehaviour)](../../models/operations/listactionsqueuebehaviour.md) | :heavy_minus_sign: | Whether the action resolves and removes the item, unresolves and re-add it to the queue, or does not change the resolve status. | +| `filter_in_queue_ids` | T::Array<*::String*> | :heavy_check_mark: | The IDs of the queues the action is available in. | +| `position` | [T.nilable(Models::Operations::ListActionsPosition)](../../models/operations/listactionsposition.md) | :heavy_minus_sign: | Show the action in all queues, selected queues or no queues (to use via API only). | +| `possible_values` | T::Array<[Models::Operations::ListActionsPossibleValue](../../models/operations/listactionspossiblevalue.md)> | :heavy_check_mark: | The possible values of the action. The user will be prompted to select one of these values when executing the action. | +| `value_required` | *T.nilable(T::Boolean)* | :heavy_minus_sign: | Whether the action requires a value to be executed. | +| `free_text` | *T.nilable(T::Boolean)* | :heavy_minus_sign: | Whether the action allows any text to be entered as a value or if it must be one of the possible values. | \ No newline at end of file diff --git a/docs/models/operations/listactionsposition.md b/docs/models/operations/listactionsposition.md new file mode 100644 index 00000000..58e177b7 --- /dev/null +++ b/docs/models/operations/listactionsposition.md @@ -0,0 +1,23 @@ +# ListActionsPosition + +Show the action in all queues, selected queues or no queues (to use via API only). + +## Example Usage + +```ruby +require "moderation_api" + +value = ListActionsPosition::ALL_QUEUES + +# Open enum: use .deserialize() to create instances from custom string values +custom = ListActionsPosition.deserialize("custom_value") +``` + + +## Values + +| Name | Value | +| ------------- | ------------- | +| `ALL_QUEUES` | ALL_QUEUES | +| `SOME_QUEUES` | SOME_QUEUES | +| `HIDDEN` | HIDDEN | \ No newline at end of file diff --git a/docs/models/operations/listactionspossiblevalue.md b/docs/models/operations/listactionspossiblevalue.md new file mode 100644 index 00000000..dcb0e897 --- /dev/null +++ b/docs/models/operations/listactionspossiblevalue.md @@ -0,0 +1,8 @@ +# ListActionsPossibleValue + + +## Fields + +| Field | Type | Required | Description | +| ------------------------ | ------------------------ | ------------------------ | ------------------------ | +| `value` | *::String* | :heavy_check_mark: | The value of the action. | \ No newline at end of file diff --git a/docs/models/operations/listactionsqueuebehaviour.md b/docs/models/operations/listactionsqueuebehaviour.md new file mode 100644 index 00000000..26dadcf2 --- /dev/null +++ b/docs/models/operations/listactionsqueuebehaviour.md @@ -0,0 +1,23 @@ +# ListActionsQueueBehaviour + +Whether the action resolves and removes the item, unresolves and re-add it to the queue, or does not change the resolve status. + +## Example Usage + +```ruby +require "moderation_api" + +value = ListActionsQueueBehaviour::REMOVE + +# Open enum: use .deserialize() to create instances from custom string values +custom = ListActionsQueueBehaviour.deserialize("custom_value") +``` + + +## Values + +| Name | Value | +| ----------- | ----------- | +| `REMOVE` | REMOVE | +| `ADD` | ADD | +| `NO_CHANGE` | NO_CHANGE | \ No newline at end of file diff --git a/docs/models/operations/listactionsrequest.md b/docs/models/operations/listactionsrequest.md new file mode 100644 index 00000000..7fa75047 --- /dev/null +++ b/docs/models/operations/listactionsrequest.md @@ -0,0 +1,10 @@ +# ListActionsRequest + + +## Fields + +| Field | Type | Required | Description | +| ---------------------- | ---------------------- | ---------------------- | ---------------------- | +| `queue_id` | *T.nilable(::String)* | :heavy_minus_sign: | N/A | +| `page` | *T.nilable(::Integer)* | :heavy_minus_sign: | N/A | +| `page_size` | *T.nilable(::Integer)* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/listactionsresponse.md b/docs/models/operations/listactionsresponse.md new file mode 100644 index 00000000..7ad3ede4 --- /dev/null +++ b/docs/models/operations/listactionsresponse.md @@ -0,0 +1,11 @@ +# ListActionsResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | +| `content_type` | *::String* | :heavy_check_mark: | HTTP response content type for this operation | +| `status_code` | *::Integer* | :heavy_check_mark: | HTTP response status code for this operation | +| `raw_response` | [Faraday::Response](https://www.rubydoc.info/gems/faraday/Faraday/Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `object` | [T.nilable(Models::Operations::ListActionsResponseBody)](../../models/operations/listactionsresponsebody.md) | :heavy_minus_sign: | Successful response | \ No newline at end of file diff --git a/docs/models/operations/listactionsresponsebody.md b/docs/models/operations/listactionsresponsebody.md new file mode 100644 index 00000000..4fdad1e5 --- /dev/null +++ b/docs/models/operations/listactionsresponsebody.md @@ -0,0 +1,11 @@ +# ListActionsResponseBody + +Successful response + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | +| `data` | T::Array<[Models::Operations::ListActionsData](../../models/operations/listactionsdata.md)> | :heavy_check_mark: | The items on this page. | +| `pagination` | [Models::Components::Pagination](../../models/shared/pagination.md) | :heavy_check_mark: | Where this page is in the full list. | \ No newline at end of file diff --git a/docs/models/operations/listactionstype.md b/docs/models/operations/listactionstype.md new file mode 100644 index 00000000..ca7cdcfc --- /dev/null +++ b/docs/models/operations/listactionstype.md @@ -0,0 +1,28 @@ +# ListActionsType + +## Example Usage + +```ruby +require "moderation_api" + +value = ListActionsType::AUTHOR_BLOCK + +# Open enum: use .deserialize() to create instances from custom string values +custom = ListActionsType.deserialize("custom_value") +``` + + +## Values + +| Name | Value | +| ------------------- | ------------------- | +| `AUTHOR_BLOCK` | AUTHOR_BLOCK | +| `AUTHOR_BLOCK_TEMP` | AUTHOR_BLOCK_TEMP | +| `AUTHOR_UNBLOCK` | AUTHOR_UNBLOCK | +| `AUTHOR_DELETE` | AUTHOR_DELETE | +| `AUTHOR_REPORT` | AUTHOR_REPORT | +| `AUTHOR_WARN` | AUTHOR_WARN | +| `AUTHOR_CUSTOM` | AUTHOR_CUSTOM | +| `ITEM_REJECT` | ITEM_REJECT | +| `ITEM_ALLOW` | ITEM_ALLOW | +| `ITEM_CUSTOM` | ITEM_CUSTOM | \ No newline at end of file diff --git a/docs/models/operations/listauthorsrequest.md b/docs/models/operations/listauthorsrequest.md new file mode 100644 index 00000000..03bf087f --- /dev/null +++ b/docs/models/operations/listauthorsrequest.md @@ -0,0 +1,14 @@ +# ListAuthorsRequest + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | +| `page` | *T.nilable(::Integer)* | :heavy_minus_sign: | N/A | +| `page_size` | *T.nilable(::Integer)* | :heavy_minus_sign: | N/A | +| `sort_by` | [T.nilable(Models::Operations::SortBy)](../../models/operations/sortby.md) | :heavy_minus_sign: | N/A | +| `sort_direction` | [T.nilable(Models::Operations::ListAuthorsSortDirection)](../../models/operations/listauthorssortdirection.md) | :heavy_minus_sign: | Sort direction | +| `member_since_date` | *T.nilable(::String)* | :heavy_minus_sign: | N/A | +| `last_active_date` | *T.nilable(::String)* | :heavy_minus_sign: | N/A | +| `content_types` | T::Array<*::String*> | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/listauthorsresponse.md b/docs/models/operations/listauthorsresponse.md new file mode 100644 index 00000000..edd3dc5e --- /dev/null +++ b/docs/models/operations/listauthorsresponse.md @@ -0,0 +1,11 @@ +# ListAuthorsResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | +| `content_type` | *::String* | :heavy_check_mark: | HTTP response content type for this operation | +| `status_code` | *::Integer* | :heavy_check_mark: | HTTP response status code for this operation | +| `raw_response` | [Faraday::Response](https://www.rubydoc.info/gems/faraday/Faraday/Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `object` | [T.nilable(Models::Operations::ListAuthorsResponseBody)](../../models/operations/listauthorsresponsebody.md) | :heavy_minus_sign: | Successful response | \ No newline at end of file diff --git a/docs/models/operations/listauthorsresponsebody.md b/docs/models/operations/listauthorsresponsebody.md new file mode 100644 index 00000000..ef4e7715 --- /dev/null +++ b/docs/models/operations/listauthorsresponsebody.md @@ -0,0 +1,11 @@ +# ListAuthorsResponseBody + +Successful response + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | +| `data` | T::Array<[Models::Components::PublicAuthor](../../models/shared/publicauthor.md)> | :heavy_check_mark: | The items on this page. | +| `pagination` | [Models::Components::Pagination](../../models/shared/pagination.md) | :heavy_check_mark: | Where this page is in the full list. | \ No newline at end of file diff --git a/docs/models/operations/listauthorssortdirection.md b/docs/models/operations/listauthorssortdirection.md new file mode 100644 index 00000000..3aace68d --- /dev/null +++ b/docs/models/operations/listauthorssortdirection.md @@ -0,0 +1,19 @@ +# ListAuthorsSortDirection + +Sort direction + +## Example Usage + +```ruby +require "moderation_api" + +value = ListAuthorsSortDirection::ASC +``` + + +## Values + +| Name | Value | +| ------ | ------ | +| `ASC` | asc | +| `DESC` | desc | \ No newline at end of file diff --git a/docs/models/operations/listchannelsrequest.md b/docs/models/operations/listchannelsrequest.md new file mode 100644 index 00000000..6f912085 --- /dev/null +++ b/docs/models/operations/listchannelsrequest.md @@ -0,0 +1,10 @@ +# ListChannelsRequest + + +## Fields + +| Field | Type | Required | Description | +| ---------------------- | ---------------------- | ---------------------- | ---------------------- | +| `project_id` | *::String* | :heavy_check_mark: | The ID of the project. | +| `page` | *T.nilable(::Integer)* | :heavy_minus_sign: | N/A | +| `page_size` | *T.nilable(::Integer)* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/listchannelsresponse.md b/docs/models/operations/listchannelsresponse.md new file mode 100644 index 00000000..8821bc29 --- /dev/null +++ b/docs/models/operations/listchannelsresponse.md @@ -0,0 +1,11 @@ +# ListChannelsResponse + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | +| `content_type` | *::String* | :heavy_check_mark: | HTTP response content type for this operation | +| `status_code` | *::Integer* | :heavy_check_mark: | HTTP response status code for this operation | +| `raw_response` | [Faraday::Response](https://www.rubydoc.info/gems/faraday/Faraday/Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `object` | [T.nilable(Models::Operations::ListChannelsResponseBody)](../../models/operations/listchannelsresponsebody.md) | :heavy_minus_sign: | Channels retrieved successfully | \ No newline at end of file diff --git a/docs/models/operations/listchannelsresponsebody.md b/docs/models/operations/listchannelsresponsebody.md new file mode 100644 index 00000000..ea93c393 --- /dev/null +++ b/docs/models/operations/listchannelsresponsebody.md @@ -0,0 +1,11 @@ +# ListChannelsResponseBody + +Channels retrieved successfully + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | +| `data` | T::Array<[Models::Components::Channel](../../models/shared/channel.md)> | :heavy_check_mark: | The items on this page. | +| `pagination` | [Models::Components::Pagination](../../models/shared/pagination.md) | :heavy_check_mark: | Where this page is in the full list. | \ No newline at end of file diff --git a/docs/models/operations/listprojectsrequest.md b/docs/models/operations/listprojectsrequest.md new file mode 100644 index 00000000..f8733046 --- /dev/null +++ b/docs/models/operations/listprojectsrequest.md @@ -0,0 +1,9 @@ +# ListProjectsRequest + + +## Fields + +| Field | Type | Required | Description | +| ---------------------- | ---------------------- | ---------------------- | ---------------------- | +| `page` | *T.nilable(::Integer)* | :heavy_minus_sign: | N/A | +| `page_size` | *T.nilable(::Integer)* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/listprojectsresponse.md b/docs/models/operations/listprojectsresponse.md new file mode 100644 index 00000000..7a674514 --- /dev/null +++ b/docs/models/operations/listprojectsresponse.md @@ -0,0 +1,11 @@ +# ListProjectsResponse + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | +| `content_type` | *::String* | :heavy_check_mark: | HTTP response content type for this operation | +| `status_code` | *::Integer* | :heavy_check_mark: | HTTP response status code for this operation | +| `raw_response` | [Faraday::Response](https://www.rubydoc.info/gems/faraday/Faraday/Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `object` | [T.nilable(Models::Operations::ListProjectsResponseBody)](../../models/operations/listprojectsresponsebody.md) | :heavy_minus_sign: | Projects retrieved successfully | \ No newline at end of file diff --git a/docs/models/operations/listprojectsresponsebody.md b/docs/models/operations/listprojectsresponsebody.md new file mode 100644 index 00000000..7ca16065 --- /dev/null +++ b/docs/models/operations/listprojectsresponsebody.md @@ -0,0 +1,11 @@ +# ListProjectsResponseBody + +Projects retrieved successfully + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | +| `data` | T::Array<[Models::Components::Project](../../models/shared/project.md)> | :heavy_check_mark: | The items on this page. | +| `pagination` | [Models::Components::Pagination](../../models/shared/pagination.md) | :heavy_check_mark: | Where this page is in the full list. | \ No newline at end of file diff --git a/docs/models/operations/listqueueitemsaction.md b/docs/models/operations/listqueueitemsaction.md new file mode 100644 index 00000000..65954cbc --- /dev/null +++ b/docs/models/operations/listqueueitemsaction.md @@ -0,0 +1,12 @@ +# ListQueueItemsAction + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | +| `id` | *::String* | :heavy_check_mark: | Action ID | +| `name` | *::String* | :heavy_check_mark: | Action name | +| `comment` | *T.nilable(::String)* | :heavy_minus_sign: | Action comment | +| `timestamp` | *::Float* | :heavy_check_mark: | Unix timestamp of when the action was taken | +| `reviewer` | *T.nilable(::String)* | :heavy_minus_sign: | Moderator userID | \ No newline at end of file diff --git a/docs/models/operations/listqueueitemsdata.md b/docs/models/operations/listqueueitemsdata.md new file mode 100644 index 00000000..8d1140d5 --- /dev/null +++ b/docs/models/operations/listqueueitemsdata.md @@ -0,0 +1,18 @@ +# ListQueueItemsData + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | +| `id` | *::String* | :heavy_check_mark: | Content ID | +| `content` | *::String* | :heavy_check_mark: | The content to be moderated | +| `language` | *T.nilable(::String)* | :heavy_minus_sign: | Content language | +| `labels` | T::Array<[Models::Operations::ListQueueItemsLabel](../../models/operations/listqueueitemslabel.md)> | :heavy_check_mark: | N/A | +| `conversation_id` | *T.nilable(::String)* | :heavy_minus_sign: | Conversation ID | +| `author_id` | *T.nilable(::String)* | :heavy_minus_sign: | Author ID | +| `actions` | T::Array<[Models::Operations::ListQueueItemsAction](../../models/operations/listqueueitemsaction.md)> | :heavy_minus_sign: | Action IDs taken on this item | +| `flagged` | *T::Boolean* | :heavy_check_mark: | Whether the item is flagged by any label | +| `status` | [Models::Operations::ListQueueItemsStatus](../../models/operations/listqueueitemsstatus.md) | :heavy_check_mark: | Status of the item | +| `timestamp` | *::Float* | :heavy_check_mark: | Unix timestamp of when the item was created | +| `content_type` | *T.nilable(::String)* | :heavy_minus_sign: | Type of the content object | \ No newline at end of file diff --git a/docs/models/operations/listqueueitemslabel.md b/docs/models/operations/listqueueitemslabel.md new file mode 100644 index 00000000..4d72baee --- /dev/null +++ b/docs/models/operations/listqueueitemslabel.md @@ -0,0 +1,10 @@ +# ListQueueItemsLabel + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------- | -------------------------------- | -------------------------------- | -------------------------------- | +| `label` | *::String* | :heavy_check_mark: | Label name | +| `score` | *::Float* | :heavy_check_mark: | Confidence score of the label | +| `flagged` | *T::Boolean* | :heavy_check_mark: | Whether this label caused a flag | \ No newline at end of file diff --git a/docs/models/operations/listqueueitemsrequest.md b/docs/models/operations/listqueueitemsrequest.md new file mode 100644 index 00000000..6a3065ba --- /dev/null +++ b/docs/models/operations/listqueueitemsrequest.md @@ -0,0 +1,19 @@ +# ListQueueItemsRequest + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `id` | *::String* | :heavy_check_mark: | The queue ID | +| `page` | *T.nilable(::Integer)* | :heavy_minus_sign: | N/A | +| `page_size` | *T.nilable(::Integer)* | :heavy_minus_sign: | N/A | +| `sort_field` | [T.nilable(Models::Operations::SortField)](../../models/operations/sortfield.md) | :heavy_minus_sign: | N/A | +| `sort_direction` | [T.nilable(Models::Operations::ListQueueItemsSortDirection)](../../models/operations/listqueueitemssortdirection.md) | :heavy_minus_sign: | Sort direction | +| `conversation_ids` | T::Array<*::String*> | :heavy_minus_sign: | N/A | +| `labels` | T::Array<*::String*> | :heavy_minus_sign: | N/A | +| `after_date` | *T.nilable(::String)* | :heavy_minus_sign: | N/A | +| `before_date` | *T.nilable(::String)* | :heavy_minus_sign: | N/A | +| `include_resolved` | *T.nilable(T::Boolean)* | :heavy_minus_sign: | N/A | +| `author_id` | *T.nilable(::String)* | :heavy_minus_sign: | N/A | +| `filtered_action_ids` | T::Array<*::String*> | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/listqueueitemsresponse.md b/docs/models/operations/listqueueitemsresponse.md new file mode 100644 index 00000000..64ce10b4 --- /dev/null +++ b/docs/models/operations/listqueueitemsresponse.md @@ -0,0 +1,11 @@ +# ListQueueItemsResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | +| `content_type` | *::String* | :heavy_check_mark: | HTTP response content type for this operation | +| `status_code` | *::Integer* | :heavy_check_mark: | HTTP response status code for this operation | +| `raw_response` | [Faraday::Response](https://www.rubydoc.info/gems/faraday/Faraday/Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `object` | [T.nilable(Models::Operations::ListQueueItemsResponseBody)](../../models/operations/listqueueitemsresponsebody.md) | :heavy_minus_sign: | Successful response | \ No newline at end of file diff --git a/docs/models/operations/listqueueitemsresponsebody.md b/docs/models/operations/listqueueitemsresponsebody.md new file mode 100644 index 00000000..d475a79f --- /dev/null +++ b/docs/models/operations/listqueueitemsresponsebody.md @@ -0,0 +1,11 @@ +# ListQueueItemsResponseBody + +Successful response + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | +| `data` | T::Array<[Models::Operations::ListQueueItemsData](../../models/operations/listqueueitemsdata.md)> | :heavy_check_mark: | The items on this page. | +| `pagination` | [Models::Components::Pagination](../../models/shared/pagination.md) | :heavy_check_mark: | Where this page is in the full list. | \ No newline at end of file diff --git a/docs/models/operations/listqueueitemssortdirection.md b/docs/models/operations/listqueueitemssortdirection.md new file mode 100644 index 00000000..a77aeec9 --- /dev/null +++ b/docs/models/operations/listqueueitemssortdirection.md @@ -0,0 +1,19 @@ +# ListQueueItemsSortDirection + +Sort direction + +## Example Usage + +```ruby +require "moderation_api" + +value = ListQueueItemsSortDirection::ASC +``` + + +## Values + +| Name | Value | +| ------ | ------ | +| `ASC` | asc | +| `DESC` | desc | \ No newline at end of file diff --git a/docs/models/operations/listqueueitemsstatus.md b/docs/models/operations/listqueueitemsstatus.md new file mode 100644 index 00000000..911e0f41 --- /dev/null +++ b/docs/models/operations/listqueueitemsstatus.md @@ -0,0 +1,22 @@ +# ListQueueItemsStatus + +Status of the item + +## Example Usage + +```ruby +require "moderation_api" + +value = ListQueueItemsStatus::PENDING + +# Open enum: use .deserialize() to create instances from custom string values +custom = ListQueueItemsStatus.deserialize("custom_value") +``` + + +## Values + +| Name | Value | +| ---------- | ---------- | +| `PENDING` | pending | +| `RESOLVED` | resolved | \ No newline at end of file diff --git a/docs/models/operations/listwebhooksdata.md b/docs/models/operations/listwebhooksdata.md new file mode 100644 index 00000000..1221cf4b --- /dev/null +++ b/docs/models/operations/listwebhooksdata.md @@ -0,0 +1,14 @@ +# ListWebhooksData + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *::String* | :heavy_check_mark: | The ID of the webhook. | +| `name` | *::String* | :heavy_check_mark: | The webhook's name. | +| `description` | *T.nilable(::String)* | :heavy_minus_sign: | The webhook's description. | +| `url` | *::String* | :heavy_check_mark: | The URL we call when a subscribed event occurs. | +| `event_types` | T::Array<[Models::Operations::ListWebhooksEventType](../../models/operations/listwebhookseventtype.md)> | :heavy_check_mark: | Event types this webhook subscribes to. Empty for legacy v1 webhooks, which subscribe via their single deprecated `type` instead. | +| `payload_version` | [Models::Operations::ListWebhooksPayloadVersion](../../models/operations/listwebhookspayloadversion.md) | :heavy_check_mark: | Payload envelope version. V2 is the Stripe-style envelope; V1 is the legacy flat shape and is read-only via this API. | +| `created_at` | *::String* | :heavy_check_mark: | The date the webhook was created. | \ No newline at end of file diff --git a/docs/models/operations/listwebhookseventtype.md b/docs/models/operations/listwebhookseventtype.md new file mode 100644 index 00000000..5a0eb248 --- /dev/null +++ b/docs/models/operations/listwebhookseventtype.md @@ -0,0 +1,29 @@ +# ListWebhooksEventType + +## Example Usage + +```ruby +require "moderation_api" + +value = ListWebhooksEventType::QUEUE_ITEM_NEW + +# Open enum: use .deserialize() to create instances from custom string values +custom = ListWebhooksEventType.deserialize("custom_value") +``` + + +## Values + +| Name | Value | +| ---------------------------- | ---------------------------- | +| `QUEUE_ITEM_NEW` | QUEUE_ITEM_NEW | +| `QUEUE_ITEM_COMPLETED` | QUEUE_ITEM_COMPLETED | +| `QUEUE_ITEM_ACTION` | QUEUE_ITEM_ACTION | +| `QUEUE_ITEM_REJECTED` | QUEUE_ITEM_REJECTED | +| `QUEUE_ITEM_ALLOWED` | QUEUE_ITEM_ALLOWED | +| `AUTHOR_BLOCKED` | AUTHOR_BLOCKED | +| `AUTHOR_UNBLOCKED` | AUTHOR_UNBLOCKED | +| `AUTHOR_SUSPENDED` | AUTHOR_SUSPENDED | +| `AUTHOR_UPDATED` | AUTHOR_UPDATED | +| `AUTHOR_TRUST_LEVEL_CHANGED` | AUTHOR_TRUST_LEVEL_CHANGED | +| `AUTHOR_ACTION` | AUTHOR_ACTION | \ No newline at end of file diff --git a/docs/models/operations/listwebhookspayloadversion.md b/docs/models/operations/listwebhookspayloadversion.md new file mode 100644 index 00000000..1eb54522 --- /dev/null +++ b/docs/models/operations/listwebhookspayloadversion.md @@ -0,0 +1,22 @@ +# ListWebhooksPayloadVersion + +Payload envelope version. V2 is the Stripe-style envelope; V1 is the legacy flat shape and is read-only via this API. + +## Example Usage + +```ruby +require "moderation_api" + +value = ListWebhooksPayloadVersion::V1 + +# Open enum: use .deserialize() to create instances from custom string values +custom = ListWebhooksPayloadVersion.deserialize("custom_value") +``` + + +## Values + +| Name | Value | +| ----- | ----- | +| `V1` | V1 | +| `V2` | V2 | \ No newline at end of file diff --git a/docs/models/operations/listwebhooksrequest.md b/docs/models/operations/listwebhooksrequest.md new file mode 100644 index 00000000..ad5b15c1 --- /dev/null +++ b/docs/models/operations/listwebhooksrequest.md @@ -0,0 +1,9 @@ +# ListWebhooksRequest + + +## Fields + +| Field | Type | Required | Description | +| ---------------------- | ---------------------- | ---------------------- | ---------------------- | +| `page` | *T.nilable(::Integer)* | :heavy_minus_sign: | N/A | +| `page_size` | *T.nilable(::Integer)* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/listwebhooksresponse.md b/docs/models/operations/listwebhooksresponse.md new file mode 100644 index 00000000..11fddea2 --- /dev/null +++ b/docs/models/operations/listwebhooksresponse.md @@ -0,0 +1,11 @@ +# ListWebhooksResponse + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | +| `content_type` | *::String* | :heavy_check_mark: | HTTP response content type for this operation | +| `status_code` | *::Integer* | :heavy_check_mark: | HTTP response status code for this operation | +| `raw_response` | [Faraday::Response](https://www.rubydoc.info/gems/faraday/Faraday/Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `object` | [T.nilable(Models::Operations::ListWebhooksResponseBody)](../../models/operations/listwebhooksresponsebody.md) | :heavy_minus_sign: | Webhooks retrieved successfully | \ No newline at end of file diff --git a/docs/models/operations/listwebhooksresponsebody.md b/docs/models/operations/listwebhooksresponsebody.md new file mode 100644 index 00000000..0270938a --- /dev/null +++ b/docs/models/operations/listwebhooksresponsebody.md @@ -0,0 +1,11 @@ +# ListWebhooksResponseBody + +Webhooks retrieved successfully + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | +| `data` | T::Array<[Models::Operations::ListWebhooksData](../../models/operations/listwebhooksdata.md)> | :heavy_check_mark: | The items on this page. | +| `pagination` | [Models::Components::Pagination](../../models/shared/pagination.md) | :heavy_check_mark: | Where this page is in the full list. | \ No newline at end of file diff --git a/docs/models/operations/listwordlistsdata.md b/docs/models/operations/listwordlistsdata.md new file mode 100644 index 00000000..3efa8aa9 --- /dev/null +++ b/docs/models/operations/listwordlistsdata.md @@ -0,0 +1,12 @@ +# ListWordlistsData + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------- | --------------------------------- | --------------------------------- | --------------------------------- | +| `id` | *::String* | :heavy_check_mark: | Unique identifier of the wordlist | +| `name` | *T.nilable(::String)* | :heavy_check_mark: | Name of the wordlist | +| `description` | *T.nilable(::String)* | :heavy_check_mark: | Description of the wordlist | +| `created_at` | *T.nilable(::String)* | :heavy_check_mark: | When the wordlist was created | +| `user_id` | *T.nilable(::String)* | :heavy_check_mark: | User who created the wordlist | \ No newline at end of file diff --git a/docs/models/operations/listwordlistsrequest.md b/docs/models/operations/listwordlistsrequest.md new file mode 100644 index 00000000..63d39566 --- /dev/null +++ b/docs/models/operations/listwordlistsrequest.md @@ -0,0 +1,9 @@ +# ListWordlistsRequest + + +## Fields + +| Field | Type | Required | Description | +| ---------------------- | ---------------------- | ---------------------- | ---------------------- | +| `page` | *T.nilable(::Integer)* | :heavy_minus_sign: | N/A | +| `page_size` | *T.nilable(::Integer)* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/listwordlistsresponse.md b/docs/models/operations/listwordlistsresponse.md new file mode 100644 index 00000000..2339e612 --- /dev/null +++ b/docs/models/operations/listwordlistsresponse.md @@ -0,0 +1,11 @@ +# ListWordlistsResponse + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | +| `content_type` | *::String* | :heavy_check_mark: | HTTP response content type for this operation | +| `status_code` | *::Integer* | :heavy_check_mark: | HTTP response status code for this operation | +| `raw_response` | [Faraday::Response](https://www.rubydoc.info/gems/faraday/Faraday/Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `object` | [T.nilable(Models::Operations::ListWordlistsResponseBody)](../../models/operations/listwordlistsresponsebody.md) | :heavy_minus_sign: | Successful response | \ No newline at end of file diff --git a/docs/models/operations/listwordlistsresponsebody.md b/docs/models/operations/listwordlistsresponsebody.md new file mode 100644 index 00000000..99631621 --- /dev/null +++ b/docs/models/operations/listwordlistsresponsebody.md @@ -0,0 +1,11 @@ +# ListWordlistsResponseBody + +Successful response + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | +| `data` | T::Array<[Models::Operations::ListWordlistsData](../../models/operations/listwordlistsdata.md)> | :heavy_check_mark: | The items on this page. | +| `pagination` | [Models::Components::Pagination](../../models/shared/pagination.md) | :heavy_check_mark: | Where this page is in the full list. | \ No newline at end of file diff --git a/docs/models/operations/lowqualitycontent.md b/docs/models/operations/lowqualitycontent.md new file mode 100644 index 00000000..53ff041c --- /dev/null +++ b/docs/models/operations/lowqualitycontent.md @@ -0,0 +1,11 @@ +# LowQualityContent + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | +| `flag` | *T::Boolean* | :heavy_check_mark: | N/A | +| `threshold` | *T.nilable(::Float)* | :heavy_minus_sign: | N/A | +| `id` | *::String* | :heavy_check_mark: | N/A | +| `min_words` | *T.nilable(::Integer)* | :heavy_minus_sign: | Flag content with fewer than this many words as low-effort. Defaults to 3. Set to disable by omitting. | \ No newline at end of file diff --git a/docs/models/operations/match.md b/docs/models/operations/match.md new file mode 100644 index 00000000..b76f79f3 --- /dev/null +++ b/docs/models/operations/match.md @@ -0,0 +1,13 @@ +# Match + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `probability` | *::Float* | :heavy_check_mark: | N/A | +| `match` | *::String* | :heavy_check_mark: | N/A | +| `span` | T::Array<*::Integer*> | :heavy_check_mark: | N/A | +| `reasons` | T::Array<*::String*> | :heavy_minus_sign: | Stable codes explaining why a URL was flagged (URL Risk only). | +| `signals` | [T.nilable(Models::Operations::SignalsResponse)](../../models/operations/signalsresponse.md) | :heavy_minus_sign: | Observable properties of a URL (URL Risk only). Absent for allow/block list matches. | +| `entity_type` | *T.nilable(::String)* | :heavy_minus_sign: | Sub-type of the entity match — e.g. the NER key (email, phone, name, …) for PII matches. Absent for URL Risk and wordlist matches where the type is already encoded in the parent label. | \ No newline at end of file diff --git a/docs/models/operations/matchedrule.md b/docs/models/operations/matchedrule.md new file mode 100644 index 00000000..f9c115cd --- /dev/null +++ b/docs/models/operations/matchedrule.md @@ -0,0 +1,9 @@ +# MatchedRule + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `key` | *::String* | :heavy_check_mark: | N/A | +| `name` | *::String* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/mediatype.md b/docs/models/operations/mediatype.md new file mode 100644 index 00000000..5bedeca8 --- /dev/null +++ b/docs/models/operations/mediatype.md @@ -0,0 +1,23 @@ +# MediaType + +## Example Usage + +```ruby +require "moderation_api" + +value = MediaType::TEXT + +# Open enum: use .deserialize() to create instances from custom string values +custom = MediaType.deserialize("custom_value") +``` + + +## Values + +| Name | Value | +| -------- | -------- | +| `TEXT` | text | +| `IMAGE` | image | +| `VIDEO` | video | +| `OBJECT` | object | +| `AUDIO` | audio | \ No newline at end of file diff --git a/docs/models/operations/meta.md b/docs/models/operations/meta.md new file mode 100644 index 00000000..d22367e4 --- /dev/null +++ b/docs/models/operations/meta.md @@ -0,0 +1,14 @@ +# Meta + +Metadata about the moderation request + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | +| `status` | [Models::Operations::MetaStatus](../../models/operations/metastatus.md) | :heavy_check_mark: | N/A | +| `timestamp` | *::Float* | :heavy_check_mark: | N/A | +| `channel_key` | *::String* | :heavy_check_mark: | The unique key of the channel where the content was handled. Either the channel provided by you or automatically routed. | +| `usage` | *::Float* | :heavy_check_mark: | N/A | +| `processing_time` | *T.nilable(::String)* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/metadatafilter.md b/docs/models/operations/metadatafilter.md new file mode 100644 index 00000000..c561897e --- /dev/null +++ b/docs/models/operations/metadatafilter.md @@ -0,0 +1,9 @@ +# MetadataFilter + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `key` | *::String* | :heavy_check_mark: | N/A | +| `value` | *::String* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/metastatus.md b/docs/models/operations/metastatus.md new file mode 100644 index 00000000..f9051ff1 --- /dev/null +++ b/docs/models/operations/metastatus.md @@ -0,0 +1,20 @@ +# MetaStatus + +## Example Usage + +```ruby +require "moderation_api" + +value = MetaStatus::SUCCESS + +# Open enum: use .deserialize() to create instances from custom string values +custom = MetaStatus.deserialize("custom_value") +``` + + +## Values + +| Name | Value | +| ----------------- | ----------------- | +| `SUCCESS` | success | +| `PARTIAL_SUCCESS` | partial_success | \ No newline at end of file diff --git a/docs/models/operations/metatype.md b/docs/models/operations/metatype.md new file mode 100644 index 00000000..42b21c58 --- /dev/null +++ b/docs/models/operations/metatype.md @@ -0,0 +1,26 @@ +# MetaType + +The meta type of content being moderated + +## Example Usage + +```ruby +require "moderation_api" + +value = MetaType::PROFILE +``` + + +## Values + +| Name | Value | +| --------- | --------- | +| `PROFILE` | profile | +| `MESSAGE` | message | +| `POST` | post | +| `COMMENT` | comment | +| `EVENT` | event | +| `PRODUCT` | product | +| `REVIEW` | review | +| `VOICE` | voice | +| `OTHER` | other | \ No newline at end of file diff --git a/docs/models/operations/method.md b/docs/models/operations/method.md new file mode 100644 index 00000000..0f69fb59 --- /dev/null +++ b/docs/models/operations/method.md @@ -0,0 +1,20 @@ +# Method + +## Example Usage + +```ruby +require "moderation_api" + +value = Method::REGISTERED_DOMAIN_TOKEN + +# Open enum: use .deserialize() to create instances from custom string values +custom = Method.deserialize("custom_value") +``` + + +## Values + +| Name | Value | +| ------------------------- | ------------------------- | +| `REGISTERED_DOMAIN_TOKEN` | registered_domain_token | +| `SUBDOMAIN_TOKEN` | subdomain_token | \ No newline at end of file diff --git a/docs/models/operations/modified.md b/docs/models/operations/modified.md new file mode 100644 index 00000000..33f0d79a --- /dev/null +++ b/docs/models/operations/modified.md @@ -0,0 +1,2 @@ +# Modified + diff --git a/docs/models/operations/object.md b/docs/models/operations/object.md new file mode 100644 index 00000000..fa806b15 --- /dev/null +++ b/docs/models/operations/object.md @@ -0,0 +1,11 @@ +# Object + +Object + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `type` | *::String* | :heavy_check_mark: | N/A | +| `data` | T::Hash[Symbol, [T.any(Models::Operations::DataText, Models::Operations::DataImage, Models::Operations::DataVideo, Models::Operations::DataAudio)](../../models/operations/contentleafrequest.md)] | :heavy_check_mark: | Values in the object. Can be mixed content types. | \ No newline at end of file diff --git a/docs/models/operations/personalinformation.md b/docs/models/operations/personalinformation.md new file mode 100644 index 00000000..4c82f486 --- /dev/null +++ b/docs/models/operations/personalinformation.md @@ -0,0 +1,10 @@ +# PersonalInformation + + +## Fields + +| Field | Type | Required | Description | +| -------------------- | -------------------- | -------------------- | -------------------- | +| `flag` | *T::Boolean* | :heavy_check_mark: | N/A | +| `threshold` | *T.nilable(::Float)* | :heavy_minus_sign: | N/A | +| `id` | *::String* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/personalstoryinsight.md b/docs/models/operations/personalstoryinsight.md new file mode 100644 index 00000000..dd3b3298 --- /dev/null +++ b/docs/models/operations/personalstoryinsight.md @@ -0,0 +1,13 @@ +# PersonalStoryInsight + +Personal story insight. Includes a personal experience or story as a source of support for the statements made in the comment. + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | +| `id` | *::String* | :heavy_check_mark: | N/A | +| `type` | *::String* | :heavy_check_mark: | N/A | +| `probability` | *::Float* | :heavy_check_mark: | N/A | +| `value` | *T.nilable(T::Boolean)* | :heavy_check_mark: | Whether the content shows personal story. | \ No newline at end of file diff --git a/docs/models/operations/piimasking.md b/docs/models/operations/piimasking.md new file mode 100644 index 00000000..bd37d71e --- /dev/null +++ b/docs/models/operations/piimasking.md @@ -0,0 +1,9 @@ +# PIIMasking + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | +| `id` | *::String* | :heavy_check_mark: | N/A | +| `entities` | T::Hash[Symbol, [Models::Operations::Entities1](../../models/operations/entities1.md)] | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/policyrequest.md b/docs/models/operations/policyrequest.md new file mode 100644 index 00000000..cf8154e9 --- /dev/null +++ b/docs/models/operations/policyrequest.md @@ -0,0 +1,2 @@ +# PolicyRequest + diff --git a/docs/models/operations/policyresponse.md b/docs/models/operations/policyresponse.md new file mode 100644 index 00000000..19998fae --- /dev/null +++ b/docs/models/operations/policyresponse.md @@ -0,0 +1,4 @@ +# PolicyResponse + +Policy output schema. + diff --git a/docs/models/operations/political.md b/docs/models/operations/political.md new file mode 100644 index 00000000..7218a281 --- /dev/null +++ b/docs/models/operations/political.md @@ -0,0 +1,10 @@ +# Political + + +## Fields + +| Field | Type | Required | Description | +| -------------------- | -------------------- | -------------------- | -------------------- | +| `flag` | *T::Boolean* | :heavy_check_mark: | N/A | +| `threshold` | *T.nilable(::Float)* | :heavy_minus_sign: | N/A | +| `id` | *::String* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/profanity.md b/docs/models/operations/profanity.md new file mode 100644 index 00000000..11576149 --- /dev/null +++ b/docs/models/operations/profanity.md @@ -0,0 +1,10 @@ +# Profanity + + +## Fields + +| Field | Type | Required | Description | +| -------------------- | -------------------- | -------------------- | -------------------- | +| `flag` | *T::Boolean* | :heavy_check_mark: | N/A | +| `threshold` | *T.nilable(::Float)* | :heavy_minus_sign: | N/A | +| `id` | *::String* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/promotion.md b/docs/models/operations/promotion.md new file mode 100644 index 00000000..13e902e4 --- /dev/null +++ b/docs/models/operations/promotion.md @@ -0,0 +1,10 @@ +# Promotion + + +## Fields + +| Field | Type | Required | Description | +| -------------------- | -------------------- | -------------------- | -------------------- | +| `flag` | *T::Boolean* | :heavy_check_mark: | N/A | +| `threshold` | *T.nilable(::Float)* | :heavy_minus_sign: | N/A | +| `id` | *::String* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/queue.md b/docs/models/operations/queue.md new file mode 100644 index 00000000..f47f85c3 --- /dev/null +++ b/docs/models/operations/queue.md @@ -0,0 +1,14 @@ +# Queue + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | +| `id` | *::String* | :heavy_check_mark: | N/A | +| `name` | *::String* | :heavy_check_mark: | N/A | +| `description` | *::String* | :heavy_check_mark: | N/A | +| `filter` | [Models::Operations::Filter](../../models/operations/filter.md) | :heavy_check_mark: | N/A | +| `unresolved_items_count` | *::Float* | :heavy_check_mark: | N/A | +| `resolved_items_count` | *::Float* | :heavy_check_mark: | N/A | +| `total_items_count` | *::Float* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/reasoncode.md b/docs/models/operations/reasoncode.md new file mode 100644 index 00000000..8247c803 --- /dev/null +++ b/docs/models/operations/reasoncode.md @@ -0,0 +1,2 @@ +# ReasonCode + diff --git a/docs/models/operations/reasoncodeenum.md b/docs/models/operations/reasoncodeenum.md new file mode 100644 index 00000000..2032ad56 --- /dev/null +++ b/docs/models/operations/reasoncodeenum.md @@ -0,0 +1,29 @@ +# ReasonCodeEnum + +## Example Usage + +```ruby +require "moderation_api" + +value = ReasonCodeEnum::SEVERITY_REJECT + +# Open enum: use .deserialize() to create instances from custom string values +custom = ReasonCodeEnum.deserialize("custom_value") +``` + + +## Values + +| Name | Value | +| -------------------- | -------------------- | +| `SEVERITY_REJECT` | severity_reject | +| `SEVERITY_REVIEW` | severity_review | +| `AUTHOR_BLOCK` | author_block | +| `DRY_RUN` | dry_run | +| `TRUSTED_ALLOW` | trusted_allow | +| `UNTRUSTED_SEVERITY` | untrusted_severity | +| `RULE_MATCH` | rule_match | +| `RULE_DEFAULT` | rule_default | +| `RULE_FALLBACK` | rule_fallback | +| `CLIENT_OVERRIDE` | client_override | +| `CASEBOOK_MATCH` | casebook_match | \ No newline at end of file diff --git a/docs/models/operations/recommendation.md b/docs/models/operations/recommendation.md new file mode 100644 index 00000000..c3565494 --- /dev/null +++ b/docs/models/operations/recommendation.md @@ -0,0 +1,12 @@ +# Recommendation + +The recommendation for the content based on the evaluation. + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `action` | [Models::Operations::SubmitContentRecommendationAction](../../models/operations/submitcontentrecommendationaction.md) | :heavy_check_mark: | The action to take based on the recommendation | +| `reason_codes` | T::Array<[T.any(Models::Operations::ReasonCodeEnum, ::String)](../../models/operations/reasoncode.md)> | :heavy_check_mark: | Reason codes for the recommendation. Standard codes plus a `rule:` code identifying the rule that produced the action. Can be used to display a reason to the user. | +| `matched_rules` | T::Array<[Models::Operations::MatchedRule](../../models/operations/matchedrule.md)> | :heavy_minus_sign: | Rules that matched during evaluation, if rules engine is active. | \ No newline at end of file diff --git a/docs/models/operations/religion.md b/docs/models/operations/religion.md new file mode 100644 index 00000000..3046835c --- /dev/null +++ b/docs/models/operations/religion.md @@ -0,0 +1,10 @@ +# Religion + + +## Fields + +| Field | Type | Required | Description | +| -------------------- | -------------------- | -------------------- | -------------------- | +| `flag` | *T::Boolean* | :heavy_check_mark: | N/A | +| `threshold` | *T.nilable(::Float)* | :heavy_minus_sign: | N/A | +| `id` | *::String* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/removewordlistwordsrequest.md b/docs/models/operations/removewordlistwordsrequest.md new file mode 100644 index 00000000..556b9c89 --- /dev/null +++ b/docs/models/operations/removewordlistwordsrequest.md @@ -0,0 +1,9 @@ +# RemoveWordlistWordsRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | +| `id` | *::String* | :heavy_check_mark: | ID of the wordlist to remove words from | +| `words` | T::Array<*::String*> | :heavy_check_mark: | Array of words to remove from the wordlist | \ No newline at end of file diff --git a/docs/models/operations/removewordlistwordsresponse.md b/docs/models/operations/removewordlistwordsresponse.md new file mode 100644 index 00000000..5858ff14 --- /dev/null +++ b/docs/models/operations/removewordlistwordsresponse.md @@ -0,0 +1,11 @@ +# RemoveWordlistWordsResponse + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | +| `content_type` | *::String* | :heavy_check_mark: | HTTP response content type for this operation | +| `status_code` | *::Integer* | :heavy_check_mark: | HTTP response status code for this operation | +| `raw_response` | [Faraday::Response](https://www.rubydoc.info/gems/faraday/Faraday/Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `object` | [T.nilable(Models::Operations::RemoveWordlistWordsResponseBody)](../../models/operations/removewordlistwordsresponsebody.md) | :heavy_minus_sign: | Words successfully removed from wordlist | \ No newline at end of file diff --git a/docs/models/operations/removewordlistwordsresponsebody.md b/docs/models/operations/removewordlistwordsresponsebody.md new file mode 100644 index 00000000..0c2300dc --- /dev/null +++ b/docs/models/operations/removewordlistwordsresponsebody.md @@ -0,0 +1,12 @@ +# RemoveWordlistWordsResponseBody + +Words successfully removed from wordlist + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------- | --------------------------------- | --------------------------------- | --------------------------------- | +| `removed_count` | *::Float* | :heavy_check_mark: | Number of words removed | +| `total_count` | *::Float* | :heavy_check_mark: | Total number of words in wordlist | +| `removed_words` | T::Array<*::String*> | :heavy_check_mark: | List of words removed | \ No newline at end of file diff --git a/docs/models/operations/resolvequeueitemrequest.md b/docs/models/operations/resolvequeueitemrequest.md new file mode 100644 index 00000000..abac39c2 --- /dev/null +++ b/docs/models/operations/resolvequeueitemrequest.md @@ -0,0 +1,10 @@ +# ResolveQueueItemRequest + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | +| `id` | *::String* | :heavy_check_mark: | The queue ID | +| `item_id` | *::String* | :heavy_check_mark: | The item ID to resolve | +| `body` | [Models::Operations::ResolveQueueItemRequestBody](../../models/operations/resolvequeueitemrequestbody.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/resolvequeueitemrequestbody.md b/docs/models/operations/resolvequeueitemrequestbody.md new file mode 100644 index 00000000..8cc7e054 --- /dev/null +++ b/docs/models/operations/resolvequeueitemrequestbody.md @@ -0,0 +1,8 @@ +# ResolveQueueItemRequestBody + + +## Fields + +| Field | Type | Required | Description | +| --------------------- | --------------------- | --------------------- | --------------------- | +| `comment` | *T.nilable(::String)* | :heavy_minus_sign: | Optional comment | \ No newline at end of file diff --git a/docs/models/operations/resolvequeueitemresponse.md b/docs/models/operations/resolvequeueitemresponse.md new file mode 100644 index 00000000..1d7f8726 --- /dev/null +++ b/docs/models/operations/resolvequeueitemresponse.md @@ -0,0 +1,11 @@ +# ResolveQueueItemResponse + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | +| `content_type` | *::String* | :heavy_check_mark: | HTTP response content type for this operation | +| `status_code` | *::Integer* | :heavy_check_mark: | HTTP response status code for this operation | +| `raw_response` | [Faraday::Response](https://www.rubydoc.info/gems/faraday/Faraday/Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `object` | [T.nilable(Models::Operations::ResolveQueueItemResponseBody)](../../models/operations/resolvequeueitemresponsebody.md) | :heavy_minus_sign: | Successful response | \ No newline at end of file diff --git a/docs/models/operations/resolvequeueitemresponsebody.md b/docs/models/operations/resolvequeueitemresponsebody.md new file mode 100644 index 00000000..ae178fcb --- /dev/null +++ b/docs/models/operations/resolvequeueitemresponsebody.md @@ -0,0 +1,12 @@ +# ResolveQueueItemResponseBody + +Successful response + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `success` | *T::Boolean* | :heavy_check_mark: | N/A | +| `resolved_at` | *::String* | :heavy_check_mark: | Timestamp when the item was resolved | +| `comment` | *T.nilable(::String)* | :heavy_minus_sign: | Optional comment | \ No newline at end of file diff --git a/docs/models/operations/respectinsight.md b/docs/models/operations/respectinsight.md new file mode 100644 index 00000000..12406bba --- /dev/null +++ b/docs/models/operations/respectinsight.md @@ -0,0 +1,13 @@ +# RespectInsight + +Respect insight. Shows deference or appreciation to others, or acknowledges the validity of another person. + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------- | ---------------------------------- | ---------------------------------- | ---------------------------------- | +| `id` | *::String* | :heavy_check_mark: | N/A | +| `type` | *::String* | :heavy_check_mark: | N/A | +| `probability` | *::Float* | :heavy_check_mark: | N/A | +| `value` | *T.nilable(T::Boolean)* | :heavy_check_mark: | Whether the content shows respect. | \ No newline at end of file diff --git a/docs/models/operations/reviewstats.md b/docs/models/operations/reviewstats.md new file mode 100644 index 00000000..5c6b8269 --- /dev/null +++ b/docs/models/operations/reviewstats.md @@ -0,0 +1,10 @@ +# ReviewStats + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | +| `average_time_to_review` | *::Float* | :heavy_check_mark: | Average time in milliseconds to review an item | +| `total_reviewed` | *::Float* | :heavy_check_mark: | Total number of items reviewed | +| `total_pending` | *::Float* | :heavy_check_mark: | Total number of items pending review | \ No newline at end of file diff --git a/docs/models/operations/scores.md b/docs/models/operations/scores.md new file mode 100644 index 00000000..5c61ba7b --- /dev/null +++ b/docs/models/operations/scores.md @@ -0,0 +1,11 @@ +# Scores + +Positive and negative scored independently: mixed content scores high on both. Present whenever `value` is set. + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `positive` | *::Float* | :heavy_check_mark: | How positive the content is, 0 to 1. | +| `negative` | *::Float* | :heavy_check_mark: | How negative the content is, 0 to 1. | \ No newline at end of file diff --git a/docs/models/operations/selfharm.md b/docs/models/operations/selfharm.md new file mode 100644 index 00000000..a5f651f1 --- /dev/null +++ b/docs/models/operations/selfharm.md @@ -0,0 +1,10 @@ +# SelfHarm + + +## Fields + +| Field | Type | Required | Description | +| -------------------- | -------------------- | -------------------- | -------------------- | +| `flag` | *T::Boolean* | :heavy_check_mark: | N/A | +| `threshold` | *T.nilable(::Float)* | :heavy_minus_sign: | N/A | +| `id` | *::String* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/selfpromotion.md b/docs/models/operations/selfpromotion.md new file mode 100644 index 00000000..cdafc91d --- /dev/null +++ b/docs/models/operations/selfpromotion.md @@ -0,0 +1,10 @@ +# SelfPromotion + + +## Fields + +| Field | Type | Required | Description | +| -------------------- | -------------------- | -------------------- | -------------------- | +| `flag` | *T::Boolean* | :heavy_check_mark: | N/A | +| `threshold` | *T.nilable(::Float)* | :heavy_minus_sign: | N/A | +| `id` | *::String* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/sentimentinsight.md b/docs/models/operations/sentimentinsight.md new file mode 100644 index 00000000..73aac59c --- /dev/null +++ b/docs/models/operations/sentimentinsight.md @@ -0,0 +1,14 @@ +# SentimentInsight + +Sentiment insight + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | +| `id` | *::String* | :heavy_check_mark: | N/A | +| `type` | *::String* | :heavy_check_mark: | N/A | +| `probability` | *::Float* | :heavy_check_mark: | N/A | +| `value` | [T.nilable(Models::Operations::Value)](../../models/operations/value.md) | :heavy_check_mark: | N/A | +| `scores` | [T.nilable(Models::Operations::Scores)](../../models/operations/scores.md) | :heavy_minus_sign: | Positive and negative scored independently: mixed content scores high on both. Present whenever `value` is set. | \ No newline at end of file diff --git a/docs/models/operations/sexual.md b/docs/models/operations/sexual.md new file mode 100644 index 00000000..767860ef --- /dev/null +++ b/docs/models/operations/sexual.md @@ -0,0 +1,10 @@ +# Sexual + + +## Fields + +| Field | Type | Required | Description | +| -------------------- | -------------------- | -------------------- | -------------------- | +| `flag` | *T::Boolean* | :heavy_check_mark: | N/A | +| `threshold` | *T.nilable(::Float)* | :heavy_minus_sign: | N/A | +| `id` | *::String* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/sexualminors.md b/docs/models/operations/sexualminors.md new file mode 100644 index 00000000..06b4eb8a --- /dev/null +++ b/docs/models/operations/sexualminors.md @@ -0,0 +1,10 @@ +# SexualMinors + + +## Fields + +| Field | Type | Required | Description | +| -------------------- | -------------------- | -------------------- | -------------------- | +| `flag` | *T::Boolean* | :heavy_check_mark: | N/A | +| `threshold` | *T.nilable(::Float)* | :heavy_minus_sign: | N/A | +| `id` | *::String* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/sexualsolicitation.md b/docs/models/operations/sexualsolicitation.md new file mode 100644 index 00000000..2ad5c80a --- /dev/null +++ b/docs/models/operations/sexualsolicitation.md @@ -0,0 +1,10 @@ +# SexualSolicitation + + +## Fields + +| Field | Type | Required | Description | +| -------------------- | -------------------- | -------------------- | -------------------- | +| `flag` | *T::Boolean* | :heavy_check_mark: | N/A | +| `threshold` | *T.nilable(::Float)* | :heavy_minus_sign: | N/A | +| `id` | *::String* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/signalsrequest.md b/docs/models/operations/signalsrequest.md new file mode 100644 index 00000000..87d6929b --- /dev/null +++ b/docs/models/operations/signalsrequest.md @@ -0,0 +1,8 @@ +# SignalsRequest + + +## Fields + +| Field | Type | Required | Description | +| ----------------------- | ----------------------- | ----------------------- | ----------------------- | +| `flag` | *T.nilable(T::Boolean)* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/signalsresponse.md b/docs/models/operations/signalsresponse.md new file mode 100644 index 00000000..2888a0c4 --- /dev/null +++ b/docs/models/operations/signalsresponse.md @@ -0,0 +1,18 @@ +# SignalsResponse + +Observable properties of a URL (URL Risk only). Absent for allow/block list matches. + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | +| `brand_impersonation` | [T.nilable(Models::Operations::BrandImpersonation)](../../models/operations/brandimpersonation.md) | :heavy_check_mark: | N/A | +| `has_suspicious_characters` | *T::Boolean* | :heavy_check_mark: | N/A | +| `is_link_shortener` | *T::Boolean* | :heavy_check_mark: | N/A | +| `domain_age_days` | *T.nilable(::Integer)* | :heavy_check_mark: | N/A | +| `has_email_setup` | *T.nilable(T::Boolean)* | :heavy_check_mark: | N/A | +| `redirect_count` | *T.nilable(::Integer)* | :heavy_check_mark: | N/A | +| `final_url` | *T.nilable(::String)* | :heavy_check_mark: | N/A | +| `bot_protection` | *T.nilable(T::Boolean)* | :heavy_check_mark: | N/A | +| `is_reported` | *T::Boolean* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/sortby.md b/docs/models/operations/sortby.md new file mode 100644 index 00000000..defb7001 --- /dev/null +++ b/docs/models/operations/sortby.md @@ -0,0 +1,23 @@ +# SortBy + +## Example Usage + +```ruby +require "moderation_api" + +value = SortBy::TRUST_LEVEL +``` + + +## Values + +| Name | Value | +| ----------------------- | ----------------------- | +| `TRUST_LEVEL` | trustLevel | +| `VIOLATION_COUNT` | violationCount | +| `REPORT_COUNT` | reportCount | +| `MEMBER_SINCE` | memberSince | +| `LAST_ACTIVE` | lastActive | +| `CONTENT_COUNT` | contentCount | +| `FLAGGED_CONTENT_RATIO` | flaggedContentRatio | +| `AVERAGE_SENTIMENT` | averageSentiment | \ No newline at end of file diff --git a/docs/models/operations/sortfield.md b/docs/models/operations/sortfield.md new file mode 100644 index 00000000..e2329012 --- /dev/null +++ b/docs/models/operations/sortfield.md @@ -0,0 +1,18 @@ +# SortField + +## Example Usage + +```ruby +require "moderation_api" + +value = SortField::CREATED_AT +``` + + +## Values + +| Name | Value | +| ------------- | ------------- | +| `CREATED_AT` | createdAt | +| `SEVERITY` | severity | +| `REVIEWED_AT` | reviewedAt | \ No newline at end of file diff --git a/docs/models/operations/spam.md b/docs/models/operations/spam.md new file mode 100644 index 00000000..84df12e7 --- /dev/null +++ b/docs/models/operations/spam.md @@ -0,0 +1,10 @@ +# Spam + + +## Fields + +| Field | Type | Required | Description | +| -------------------- | -------------------- | -------------------- | -------------------- | +| `flag` | *T::Boolean* | :heavy_check_mark: | N/A | +| `threshold` | *T.nilable(::Float)* | :heavy_minus_sign: | N/A | +| `id` | *::String* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/submitcontentlabel.md b/docs/models/operations/submitcontentlabel.md new file mode 100644 index 00000000..ef876b3e --- /dev/null +++ b/docs/models/operations/submitcontentlabel.md @@ -0,0 +1,11 @@ +# SubmitContentLabel + + +## Fields + +| Field | Type | Required | Description | +| ----------------------- | ----------------------- | ----------------------- | ----------------------- | +| `id` | *::String* | :heavy_check_mark: | N/A | +| `probability` | *::Float* | :heavy_check_mark: | N/A | +| `flagged` | *T::Boolean* | :heavy_check_mark: | N/A | +| `shadow_flagged` | *T.nilable(T::Boolean)* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/submitcontentrecommendationaction.md b/docs/models/operations/submitcontentrecommendationaction.md new file mode 100644 index 00000000..e4060232 --- /dev/null +++ b/docs/models/operations/submitcontentrecommendationaction.md @@ -0,0 +1,23 @@ +# SubmitContentRecommendationAction + +The action to take based on the recommendation + +## Example Usage + +```ruby +require "moderation_api" + +value = SubmitContentRecommendationAction::REVIEW + +# Open enum: use .deserialize() to create instances from custom string values +custom = SubmitContentRecommendationAction.deserialize("custom_value") +``` + + +## Values + +| Name | Value | +| -------- | -------- | +| `REVIEW` | review | +| `ALLOW` | allow | +| `REJECT` | reject | \ No newline at end of file diff --git a/docs/models/operations/submitcontentrequest.md b/docs/models/operations/submitcontentrequest.md new file mode 100644 index 00000000..d4bfeb49 --- /dev/null +++ b/docs/models/operations/submitcontentrequest.md @@ -0,0 +1,18 @@ +# SubmitContentRequest + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `content` | [T.any(Models::Operations::TextRequest, Models::Operations::ImageRequest, Models::Operations::VideoRequest, Models::Operations::AudioRequest, Models::Operations::Object)](../../models/operations/contentrequest.md) | :heavy_check_mark: | The content sent for moderation | +| `timestamp` | *T.nilable(::Float)* | :heavy_minus_sign: | Unix timestamp (in milliseconds) of when the content was created. Use if content is not submitted in real-time. | +| `channel` | *T.nilable(::String)* | :heavy_minus_sign: | Provide a channel ID or key. Will use the project's default channel if not provided. | +| `content_id` | *T.nilable(::String)* | :heavy_minus_sign: | The unique ID of the content in your database. | +| `meta_type` | [T.nilable(Models::Operations::MetaType)](../../models/operations/metatype.md) | :heavy_minus_sign: | The meta type of content being moderated | +| `author_id` | *T.nilable(::String)* | :heavy_minus_sign: | The author of the content. | +| `conversation_id` | *T.nilable(::String)* | :heavy_minus_sign: | For example the ID of a chat room or a post | +| `metadata` | T::Hash[Symbol, *::Object*] | :heavy_minus_sign: | Any metadata you want to store with the content | +| `client_action` | [T.nilable(Models::Operations::ClientAction)](../../models/operations/clientaction.md) | :heavy_minus_sign: | A recommendation from your own client-side flagging (e.g. a banned-IP list or a third-party tool). Feeds the rules engine and can escalate or override the recommended action. Does not change whether our analysis flagged the content. | +| `do_not_store` | *T.nilable(T::Boolean)* | :heavy_minus_sign: | Do not store the content. The content won't enter the review queue | +| `policies` | T::Array<[T.any(Models::Operations::Toxicity, Models::Operations::PersonalInformation, Models::Operations::Hate, Models::Operations::Illicit, Models::Operations::IllicitDrugs, Models::Operations::IllicitAlcohol, Models::Operations::IllicitFirearms, Models::Operations::IllicitTobacco, Models::Operations::IllicitGambling, Models::Operations::Cannabis, Models::Operations::Adult, Models::Operations::Crypto, Models::Operations::Sexual, Models::Operations::SexualMinors, Models::Operations::Profanity, Models::Operations::Violence, Models::Operations::SelfHarm, Models::Operations::Spam, Models::Operations::LowQualityContent, Models::Operations::FaceDetection, Models::Operations::SelfPromotion, Models::Operations::Political, Models::Operations::Religion, Models::Operations::Threat, Models::Operations::SexualSolicitation, Models::Operations::ChannelCircumvention, Models::Operations::IllegalTrade, Models::Operations::Alcohol, Models::Operations::Drugs, Models::Operations::Gambling, Models::Operations::Tobacco, Models::Operations::Weapons, Models::Operations::Promotion, Models::Operations::Extremism, Models::Operations::CodeAbuse, Models::Operations::UnicodeSpoofing, Models::Operations::PIIMasking, Models::Operations::URLMasking, Models::Operations::URLRisk, Models::Operations::Guideline)](../../models/operations/policyrequest.md)> | :heavy_minus_sign: | (Enterprise) override the channel policies for this moderation request only. | \ No newline at end of file diff --git a/docs/models/operations/submitcontentresponse.md b/docs/models/operations/submitcontentresponse.md new file mode 100644 index 00000000..05a90f57 --- /dev/null +++ b/docs/models/operations/submitcontentresponse.md @@ -0,0 +1,11 @@ +# SubmitContentResponse + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | +| `content_type` | *::String* | :heavy_check_mark: | HTTP response content type for this operation | +| `status_code` | *::Integer* | :heavy_check_mark: | HTTP response status code for this operation | +| `raw_response` | [Faraday::Response](https://www.rubydoc.info/gems/faraday/Faraday/Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `object` | [T.nilable(Models::Operations::SubmitContentResponseBody)](../../models/operations/submitcontentresponsebody.md) | :heavy_minus_sign: | Successful response | \ No newline at end of file diff --git a/docs/models/operations/submitcontentresponsebody.md b/docs/models/operations/submitcontentresponsebody.md new file mode 100644 index 00000000..d8e1391d --- /dev/null +++ b/docs/models/operations/submitcontentresponsebody.md @@ -0,0 +1,18 @@ +# SubmitContentResponseBody + +Successful response + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `content` | [Models::Operations::ContentResponse](../../models/operations/contentresponse.md) | :heavy_check_mark: | Potentially modified content. | +| `author` | [T.nilable(Models::Operations::Author)](../../models/operations/author.md) | :heavy_check_mark: | The author of the content if your account has authors enabled. Requires you to send authorId when submitting content. | +| `evaluation` | [Models::Operations::Evaluation](../../models/operations/evaluation.md) | :heavy_check_mark: | The evaluation of the content after running the channel policies. | +| `recommendation` | [Models::Operations::Recommendation](../../models/operations/recommendation.md) | :heavy_check_mark: | The recommendation for the content based on the evaluation. | +| `casebook` | [T.nilable(Models::Operations::Casebook)](../../models/operations/casebook.md) | :heavy_check_mark: | What your casebook — the record of your past moderation decisions — found for this content, or null when it had nothing close enough to say, when the matching cases disagreed, or when casebook lookups are not switched on for this channel. Reports what the casebook found; whether it decided the outcome is shown in `recommendation`, where a higher-priority rule may have settled the item first. | +| `policies` | T::Array<[T.any(Models::Operations::ClassifierOutput, Models::Operations::EntityMatcherOutput)](../../models/operations/policyresponse.md)> | :heavy_check_mark: | Results of all policies in the channel. Sorted by highest probability. | +| `insights` | T::Array<[T.any(Models::Operations::SentimentInsight, Models::Operations::LanguageInsight, Models::Operations::CuriosityInsight, Models::Operations::RespectInsight, Models::Operations::PersonalStoryInsight, Models::Operations::CompassionInsight)](../../models/operations/insight.md)> | :heavy_check_mark: | Results of all insights enabled in the channel. | +| `meta` | [Models::Operations::Meta](../../models/operations/meta.md) | :heavy_check_mark: | Metadata about the moderation request | +| `errors` | T::Array<[Models::Operations::Error](../../models/operations/error.md)> | :heavy_minus_sign: | Policies that had errors | \ No newline at end of file diff --git a/docs/models/operations/textrequest.md b/docs/models/operations/textrequest.md new file mode 100644 index 00000000..7fea3178 --- /dev/null +++ b/docs/models/operations/textrequest.md @@ -0,0 +1,11 @@ +# TextRequest + +Text + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `type` | *::String* | :heavy_check_mark: | N/A | +| `text` | *::String* | :heavy_check_mark: | The content text | \ No newline at end of file diff --git a/docs/models/operations/textresponse.md b/docs/models/operations/textresponse.md new file mode 100644 index 00000000..52eaf048 --- /dev/null +++ b/docs/models/operations/textresponse.md @@ -0,0 +1,11 @@ +# TextResponse + +Text + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `type` | *::String* | :heavy_check_mark: | N/A | +| `text` | *::String* | :heavy_check_mark: | The content text | \ No newline at end of file diff --git a/docs/models/operations/threat.md b/docs/models/operations/threat.md new file mode 100644 index 00000000..047e2673 --- /dev/null +++ b/docs/models/operations/threat.md @@ -0,0 +1,10 @@ +# Threat + + +## Fields + +| Field | Type | Required | Description | +| -------------------- | -------------------- | -------------------- | -------------------- | +| `flag` | *T::Boolean* | :heavy_check_mark: | N/A | +| `threshold` | *T.nilable(::Float)* | :heavy_minus_sign: | N/A | +| `id` | *::String* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/tobacco.md b/docs/models/operations/tobacco.md new file mode 100644 index 00000000..817975f3 --- /dev/null +++ b/docs/models/operations/tobacco.md @@ -0,0 +1,10 @@ +# Tobacco + + +## Fields + +| Field | Type | Required | Description | +| -------------------- | -------------------- | -------------------- | -------------------- | +| `flag` | *T::Boolean* | :heavy_check_mark: | N/A | +| `threshold` | *T.nilable(::Float)* | :heavy_minus_sign: | N/A | +| `id` | *::String* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/topaction.md b/docs/models/operations/topaction.md new file mode 100644 index 00000000..ef0546da --- /dev/null +++ b/docs/models/operations/topaction.md @@ -0,0 +1,10 @@ +# TopAction + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `action_id` | *::String* | :heavy_check_mark: | Most used action by this reviewer | +| `action_name` | *::String* | :heavy_check_mark: | Name of the most used action | +| `count` | *::Float* | :heavy_check_mark: | Number of times this action was used | \ No newline at end of file diff --git a/docs/models/operations/topic.md b/docs/models/operations/topic.md new file mode 100644 index 00000000..d6babefc --- /dev/null +++ b/docs/models/operations/topic.md @@ -0,0 +1,9 @@ +# Topic + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `id` | *::String* | :heavy_check_mark: | N/A | +| `label` | *::String* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/topreviewer.md b/docs/models/operations/topreviewer.md new file mode 100644 index 00000000..7f89e4f8 --- /dev/null +++ b/docs/models/operations/topreviewer.md @@ -0,0 +1,13 @@ +# TopReviewer + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | +| `user_id` | *::String* | :heavy_check_mark: | ID of the reviewer | +| `name` | *::String* | :heavy_check_mark: | Name of the reviewer | +| `review_count` | *::Float* | :heavy_check_mark: | Number of items reviewed | +| `average_time_per_review` | *::Float* | :heavy_check_mark: | Average review time in milliseconds | +| `accuracy_score` | *T.nilable(::Float)* | :heavy_minus_sign: | Optional accuracy score based on review quality metrics | +| `top_actions` | T::Array<[Models::Operations::TopAction](../../models/operations/topaction.md)> | :heavy_check_mark: | Most common actions taken by this reviewer | \ No newline at end of file diff --git a/docs/models/operations/toxicity.md b/docs/models/operations/toxicity.md new file mode 100644 index 00000000..3be96cd2 --- /dev/null +++ b/docs/models/operations/toxicity.md @@ -0,0 +1,10 @@ +# Toxicity + + +## Fields + +| Field | Type | Required | Description | +| -------------------- | -------------------- | -------------------- | -------------------- | +| `flag` | *T::Boolean* | :heavy_check_mark: | N/A | +| `threshold` | *T.nilable(::Float)* | :heavy_minus_sign: | N/A | +| `id` | *::String* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/transcriptionquality.md b/docs/models/operations/transcriptionquality.md new file mode 100644 index 00000000..a6a26142 --- /dev/null +++ b/docs/models/operations/transcriptionquality.md @@ -0,0 +1,20 @@ +# TranscriptionQuality + +Trade-off between transcription speed and accuracy. + +## Example Usage + +```ruby +require "moderation_api" + +value = TranscriptionQuality::SPEED +``` + + +## Values + +| Name | Value | +| ---------- | ---------- | +| `SPEED` | SPEED | +| `BALANCED` | BALANCED | +| `ACCURACY` | ACCURACY | \ No newline at end of file diff --git a/docs/models/operations/trends.md b/docs/models/operations/trends.md new file mode 100644 index 00000000..a79a7adc --- /dev/null +++ b/docs/models/operations/trends.md @@ -0,0 +1,9 @@ +# Trends + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | +| `daily_review_counts` | T::Array<[Models::Operations::DailyReviewCount](../../models/operations/dailyreviewcount.md)> | :heavy_check_mark: | N/A | +| `flagged_content_trends` | T::Array<[Models::Operations::FlaggedContentTrend](../../models/operations/flaggedcontenttrend.md)> | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/trustlevel.md b/docs/models/operations/trustlevel.md new file mode 100644 index 00000000..f748af6b --- /dev/null +++ b/docs/models/operations/trustlevel.md @@ -0,0 +1,9 @@ +# TrustLevel + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | +| `level` | *::Float* | :heavy_check_mark: | Author trust level (-1, 0, 1, 2, 3, or 4) | +| `manual` | *T::Boolean* | :heavy_check_mark: | True if the trust level was set manually by a moderator | \ No newline at end of file diff --git a/docs/models/operations/unicodespoofing.md b/docs/models/operations/unicodespoofing.md new file mode 100644 index 00000000..cd8dd53e --- /dev/null +++ b/docs/models/operations/unicodespoofing.md @@ -0,0 +1,11 @@ +# UnicodeSpoofing + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `flag` | *T::Boolean* | :heavy_check_mark: | N/A | +| `threshold` | *T.nilable(::Float)* | :heavy_minus_sign: | N/A | +| `id` | *::String* | :heavy_check_mark: | N/A | +| `signals` | T::Hash[Symbol, [Models::Operations::SignalsRequest](../../models/operations/signalsrequest.md)] | :heavy_minus_sign: | Per-signal flag toggles. Omitted spoofing signals are enabled; encoding_damage defaults to off because decode damage (U+FFFD) marks a broken pipeline, not an attack. A disabled signal is still detected and reported as a label, but does not by itself flag the policy. | \ No newline at end of file diff --git a/docs/models/operations/unresolvequeueitemrequest.md b/docs/models/operations/unresolvequeueitemrequest.md new file mode 100644 index 00000000..6d5810a3 --- /dev/null +++ b/docs/models/operations/unresolvequeueitemrequest.md @@ -0,0 +1,10 @@ +# UnresolveQueueItemRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | +| `id` | *::String* | :heavy_check_mark: | The queue ID | +| `item_id` | *::String* | :heavy_check_mark: | The item ID to unresolve | +| `body` | [Models::Operations::UnresolveQueueItemRequestBody](../../models/operations/unresolvequeueitemrequestbody.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/unresolvequeueitemrequestbody.md b/docs/models/operations/unresolvequeueitemrequestbody.md new file mode 100644 index 00000000..97106e40 --- /dev/null +++ b/docs/models/operations/unresolvequeueitemrequestbody.md @@ -0,0 +1,8 @@ +# UnresolveQueueItemRequestBody + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | +| `comment` | *T.nilable(::String)* | :heavy_minus_sign: | Optional reason for unresolving the item | \ No newline at end of file diff --git a/docs/models/operations/unresolvequeueitemresponse.md b/docs/models/operations/unresolvequeueitemresponse.md new file mode 100644 index 00000000..682f1734 --- /dev/null +++ b/docs/models/operations/unresolvequeueitemresponse.md @@ -0,0 +1,11 @@ +# UnresolveQueueItemResponse + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | +| `content_type` | *::String* | :heavy_check_mark: | HTTP response content type for this operation | +| `status_code` | *::Integer* | :heavy_check_mark: | HTTP response status code for this operation | +| `raw_response` | [Faraday::Response](https://www.rubydoc.info/gems/faraday/Faraday/Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `object` | [T.nilable(Models::Operations::UnresolveQueueItemResponseBody)](../../models/operations/unresolvequeueitemresponsebody.md) | :heavy_minus_sign: | Successful response | \ No newline at end of file diff --git a/docs/models/operations/unresolvequeueitemresponsebody.md b/docs/models/operations/unresolvequeueitemresponsebody.md new file mode 100644 index 00000000..f55b39ae --- /dev/null +++ b/docs/models/operations/unresolvequeueitemresponsebody.md @@ -0,0 +1,12 @@ +# UnresolveQueueItemResponseBody + +Successful response + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------- | -------------------------------------- | -------------------------------------- | -------------------------------------- | +| `success` | *T::Boolean* | :heavy_check_mark: | N/A | +| `status` | *::String* | :heavy_check_mark: | New status of the item | +| `unresolved_at` | *::String* | :heavy_check_mark: | Timestamp when the item was unresolved | \ No newline at end of file diff --git a/docs/models/operations/updateactionpositionrequest.md b/docs/models/operations/updateactionpositionrequest.md new file mode 100644 index 00000000..2bb58366 --- /dev/null +++ b/docs/models/operations/updateactionpositionrequest.md @@ -0,0 +1,20 @@ +# UpdateActionPositionRequest + +Show the action in all queues, selected queues or no queues (to use via API only). + +## Example Usage + +```ruby +require "moderation_api" + +value = UpdateActionPositionRequest::ALL_QUEUES +``` + + +## Values + +| Name | Value | +| ------------- | ------------- | +| `ALL_QUEUES` | ALL_QUEUES | +| `SOME_QUEUES` | SOME_QUEUES | +| `HIDDEN` | HIDDEN | \ No newline at end of file diff --git a/docs/models/operations/updateactionpositionresponse.md b/docs/models/operations/updateactionpositionresponse.md new file mode 100644 index 00000000..471a8ed9 --- /dev/null +++ b/docs/models/operations/updateactionpositionresponse.md @@ -0,0 +1,23 @@ +# UpdateActionPositionResponse + +Show the action in all queues, selected queues or no queues (to use via API only). + +## Example Usage + +```ruby +require "moderation_api" + +value = UpdateActionPositionResponse::ALL_QUEUES + +# Open enum: use .deserialize() to create instances from custom string values +custom = UpdateActionPositionResponse.deserialize("custom_value") +``` + + +## Values + +| Name | Value | +| ------------- | ------------- | +| `ALL_QUEUES` | ALL_QUEUES | +| `SOME_QUEUES` | SOME_QUEUES | +| `HIDDEN` | HIDDEN | \ No newline at end of file diff --git a/docs/models/operations/updateactionpossiblevaluerequest.md b/docs/models/operations/updateactionpossiblevaluerequest.md new file mode 100644 index 00000000..ae5609b1 --- /dev/null +++ b/docs/models/operations/updateactionpossiblevaluerequest.md @@ -0,0 +1,8 @@ +# UpdateActionPossibleValueRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------------ | ------------------------ | ------------------------ | ------------------------ | +| `value` | *::String* | :heavy_check_mark: | The value of the action. | \ No newline at end of file diff --git a/docs/models/operations/updateactionpossiblevalueresponse.md b/docs/models/operations/updateactionpossiblevalueresponse.md new file mode 100644 index 00000000..211739a2 --- /dev/null +++ b/docs/models/operations/updateactionpossiblevalueresponse.md @@ -0,0 +1,8 @@ +# UpdateActionPossibleValueResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------ | ------------------------ | ------------------------ | ------------------------ | +| `value` | *::String* | :heavy_check_mark: | The value of the action. | \ No newline at end of file diff --git a/docs/models/operations/updateactionqueuebehaviourrequest.md b/docs/models/operations/updateactionqueuebehaviourrequest.md new file mode 100644 index 00000000..b6dd4573 --- /dev/null +++ b/docs/models/operations/updateactionqueuebehaviourrequest.md @@ -0,0 +1,20 @@ +# UpdateActionQueueBehaviourRequest + +Whether the action resolves and removes the item, unresolves and re-add it to the queue, or does not change the resolve status. + +## Example Usage + +```ruby +require "moderation_api" + +value = UpdateActionQueueBehaviourRequest::REMOVE +``` + + +## Values + +| Name | Value | +| ----------- | ----------- | +| `REMOVE` | REMOVE | +| `ADD` | ADD | +| `NO_CHANGE` | NO_CHANGE | \ No newline at end of file diff --git a/docs/models/operations/updateactionqueuebehaviourresponse.md b/docs/models/operations/updateactionqueuebehaviourresponse.md new file mode 100644 index 00000000..32c2dc47 --- /dev/null +++ b/docs/models/operations/updateactionqueuebehaviourresponse.md @@ -0,0 +1,23 @@ +# UpdateActionQueueBehaviourResponse + +Whether the action resolves and removes the item, unresolves and re-add it to the queue, or does not change the resolve status. + +## Example Usage + +```ruby +require "moderation_api" + +value = UpdateActionQueueBehaviourResponse::REMOVE + +# Open enum: use .deserialize() to create instances from custom string values +custom = UpdateActionQueueBehaviourResponse.deserialize("custom_value") +``` + + +## Values + +| Name | Value | +| ----------- | ----------- | +| `REMOVE` | REMOVE | +| `ADD` | ADD | +| `NO_CHANGE` | NO_CHANGE | \ No newline at end of file diff --git a/docs/models/operations/updateactionrequest.md b/docs/models/operations/updateactionrequest.md new file mode 100644 index 00000000..e117c2eb --- /dev/null +++ b/docs/models/operations/updateactionrequest.md @@ -0,0 +1,9 @@ +# UpdateActionRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | +| `id` | *::String* | :heavy_check_mark: | The ID of the action to update. | +| `body` | [Models::Operations::UpdateActionRequestBody](../../models/operations/updateactionrequestbody.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/updateactionrequestbody.md b/docs/models/operations/updateactionrequestbody.md new file mode 100644 index 00000000..9abfcde8 --- /dev/null +++ b/docs/models/operations/updateactionrequestbody.md @@ -0,0 +1,18 @@ +# UpdateActionRequestBody + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | +| `key` | *T.nilable(::String)* | :heavy_minus_sign: | User defined key of the action. | +| `name` | *T.nilable(::String)* | :heavy_minus_sign: | The name of the action. | +| `description` | *T.nilable(::String)* | :heavy_minus_sign: | The description of the action. | +| `type` | [T.nilable(Models::Operations::UpdateActionTypeRequest)](../../models/operations/updateactiontyperequest.md) | :heavy_minus_sign: | The type of the action. | +| `built_in` | *T.nilable(T::Boolean)* | :heavy_minus_sign: | Whether the action is a built-in action or a custom one. | +| `queue_behaviour` | [T.nilable(Models::Operations::UpdateActionQueueBehaviourRequest)](../../models/operations/updateactionqueuebehaviourrequest.md) | :heavy_minus_sign: | Whether the action resolves and removes the item, unresolves and re-add it to the queue, or does not change the resolve status. | +| `filter_in_queue_ids` | T::Array<*::String*> | :heavy_minus_sign: | The IDs of the queues the action is available in. | +| `position` | [T.nilable(Models::Operations::UpdateActionPositionRequest)](../../models/operations/updateactionpositionrequest.md) | :heavy_minus_sign: | Show the action in all queues, selected queues or no queues (to use via API only). | +| `possible_values` | T::Array<[Models::Operations::UpdateActionPossibleValueRequest](../../models/operations/updateactionpossiblevaluerequest.md)> | :heavy_minus_sign: | The possible values of the action. The user will be prompted to select one of these values when executing the action. | +| `value_required` | *T.nilable(T::Boolean)* | :heavy_minus_sign: | Whether the action requires a value to be executed. | +| `free_text` | *T.nilable(T::Boolean)* | :heavy_minus_sign: | Whether the action allows any text to be entered as a value or if it must be one of the possible values. | \ No newline at end of file diff --git a/docs/models/operations/updateactionresponse.md b/docs/models/operations/updateactionresponse.md new file mode 100644 index 00000000..14f09e5b --- /dev/null +++ b/docs/models/operations/updateactionresponse.md @@ -0,0 +1,11 @@ +# UpdateActionResponse + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | +| `content_type` | *::String* | :heavy_check_mark: | HTTP response content type for this operation | +| `status_code` | *::Integer* | :heavy_check_mark: | HTTP response status code for this operation | +| `raw_response` | [Faraday::Response](https://www.rubydoc.info/gems/faraday/Faraday/Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `object` | [T.nilable(Models::Operations::UpdateActionResponseBody)](../../models/operations/updateactionresponsebody.md) | :heavy_minus_sign: | Action updated successfully | \ No newline at end of file diff --git a/docs/models/operations/updateactionresponsebody.md b/docs/models/operations/updateactionresponsebody.md new file mode 100644 index 00000000..1eeb2cb7 --- /dev/null +++ b/docs/models/operations/updateactionresponsebody.md @@ -0,0 +1,22 @@ +# UpdateActionResponseBody + +Action updated successfully + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *::String* | :heavy_check_mark: | The ID of the action. | +| `key` | *T.nilable(::String)* | :heavy_minus_sign: | User defined key of the action. | +| `created_at` | *::String* | :heavy_check_mark: | The date the action was created. | +| `name` | *::String* | :heavy_check_mark: | The name of the action. | +| `description` | *T.nilable(::String)* | :heavy_minus_sign: | The description of the action. | +| `type` | [T.nilable(Models::Operations::UpdateActionTypeResponse)](../../models/operations/updateactiontyperesponse.md) | :heavy_minus_sign: | The type of the action. | +| `built_in` | *T.nilable(T::Boolean)* | :heavy_minus_sign: | Whether the action is a built-in action or a custom one. | +| `queue_behaviour` | [T.nilable(Models::Operations::UpdateActionQueueBehaviourResponse)](../../models/operations/updateactionqueuebehaviourresponse.md) | :heavy_minus_sign: | Whether the action resolves and removes the item, unresolves and re-add it to the queue, or does not change the resolve status. | +| `filter_in_queue_ids` | T::Array<*::String*> | :heavy_check_mark: | The IDs of the queues the action is available in. | +| `position` | [T.nilable(Models::Operations::UpdateActionPositionResponse)](../../models/operations/updateactionpositionresponse.md) | :heavy_minus_sign: | Show the action in all queues, selected queues or no queues (to use via API only). | +| `possible_values` | T::Array<[Models::Operations::UpdateActionPossibleValueResponse](../../models/operations/updateactionpossiblevalueresponse.md)> | :heavy_check_mark: | The possible values of the action. The user will be prompted to select one of these values when executing the action. | +| `value_required` | *T.nilable(T::Boolean)* | :heavy_minus_sign: | Whether the action requires a value to be executed. | +| `free_text` | *T.nilable(T::Boolean)* | :heavy_minus_sign: | Whether the action allows any text to be entered as a value or if it must be one of the possible values. | \ No newline at end of file diff --git a/docs/models/operations/updateactiontyperequest.md b/docs/models/operations/updateactiontyperequest.md new file mode 100644 index 00000000..c692905e --- /dev/null +++ b/docs/models/operations/updateactiontyperequest.md @@ -0,0 +1,25 @@ +# UpdateActionTypeRequest + +## Example Usage + +```ruby +require "moderation_api" + +value = UpdateActionTypeRequest::AUTHOR_BLOCK +``` + + +## Values + +| Name | Value | +| ------------------- | ------------------- | +| `AUTHOR_BLOCK` | AUTHOR_BLOCK | +| `AUTHOR_BLOCK_TEMP` | AUTHOR_BLOCK_TEMP | +| `AUTHOR_UNBLOCK` | AUTHOR_UNBLOCK | +| `AUTHOR_DELETE` | AUTHOR_DELETE | +| `AUTHOR_REPORT` | AUTHOR_REPORT | +| `AUTHOR_WARN` | AUTHOR_WARN | +| `AUTHOR_CUSTOM` | AUTHOR_CUSTOM | +| `ITEM_REJECT` | ITEM_REJECT | +| `ITEM_ALLOW` | ITEM_ALLOW | +| `ITEM_CUSTOM` | ITEM_CUSTOM | \ No newline at end of file diff --git a/docs/models/operations/updateactiontyperesponse.md b/docs/models/operations/updateactiontyperesponse.md new file mode 100644 index 00000000..30860241 --- /dev/null +++ b/docs/models/operations/updateactiontyperesponse.md @@ -0,0 +1,28 @@ +# UpdateActionTypeResponse + +## Example Usage + +```ruby +require "moderation_api" + +value = UpdateActionTypeResponse::AUTHOR_BLOCK + +# Open enum: use .deserialize() to create instances from custom string values +custom = UpdateActionTypeResponse.deserialize("custom_value") +``` + + +## Values + +| Name | Value | +| ------------------- | ------------------- | +| `AUTHOR_BLOCK` | AUTHOR_BLOCK | +| `AUTHOR_BLOCK_TEMP` | AUTHOR_BLOCK_TEMP | +| `AUTHOR_UNBLOCK` | AUTHOR_UNBLOCK | +| `AUTHOR_DELETE` | AUTHOR_DELETE | +| `AUTHOR_REPORT` | AUTHOR_REPORT | +| `AUTHOR_WARN` | AUTHOR_WARN | +| `AUTHOR_CUSTOM` | AUTHOR_CUSTOM | +| `ITEM_REJECT` | ITEM_REJECT | +| `ITEM_ALLOW` | ITEM_ALLOW | +| `ITEM_CUSTOM` | ITEM_CUSTOM | \ No newline at end of file diff --git a/docs/models/operations/updateauthormetadata.md b/docs/models/operations/updateauthormetadata.md new file mode 100644 index 00000000..a55bb400 --- /dev/null +++ b/docs/models/operations/updateauthormetadata.md @@ -0,0 +1,14 @@ +# UpdateAuthorMetadata + +Additional metadata provided by your system. We recommend including any relevant information that may assist in the moderation process. + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------- | --------------------------------------------- | --------------------------------------------- | --------------------------------------------- | +| `email_verified` | *T.nilable(T::Boolean)* | :heavy_minus_sign: | Whether the author's email is verified | +| `phone_verified` | *T.nilable(T::Boolean)* | :heavy_minus_sign: | Whether the author's phone number is verified | +| `identity_verified` | *T.nilable(T::Boolean)* | :heavy_minus_sign: | Whether the author's identity is verified | +| `is_paying_customer` | *T.nilable(T::Boolean)* | :heavy_minus_sign: | Whether the author is a paying customer | +| `additional_properties` | T::Hash[Symbol, *::Object*] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/updateauthorrequest.md b/docs/models/operations/updateauthorrequest.md new file mode 100644 index 00000000..6fbb0474 --- /dev/null +++ b/docs/models/operations/updateauthorrequest.md @@ -0,0 +1,9 @@ +# UpdateAuthorRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | +| `id` | *::String* | :heavy_check_mark: | Either external ID or the ID assigned by moderation API. | +| `body` | [Models::Operations::UpdateAuthorRequestBody](../../models/operations/updateauthorrequestbody.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/updateauthorrequestbody.md b/docs/models/operations/updateauthorrequestbody.md new file mode 100644 index 00000000..33275e8d --- /dev/null +++ b/docs/models/operations/updateauthorrequestbody.md @@ -0,0 +1,16 @@ +# UpdateAuthorRequestBody + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | +| `profile_picture` | *T.nilable(::String)* | :heavy_minus_sign: | URL of the author's profile picture | +| `external_link` | *T.nilable(::String)* | :heavy_minus_sign: | URL of the author's external profile | +| `name` | *T.nilable(::String)* | :heavy_minus_sign: | Author name or identifier | +| `email` | *T.nilable(::String)* | :heavy_minus_sign: | Author email address | +| `company` | *T.nilable(::String)* | :heavy_minus_sign: | The author's company or organization | +| `metadata` | [T.nilable(Models::Operations::UpdateAuthorMetadata)](../../models/operations/updateauthormetadata.md) | :heavy_minus_sign: | Additional metadata provided by your system. We recommend including any relevant information that may assist in the moderation process. | +| `first_seen` | *T.nilable(::Float)* | :heavy_minus_sign: | Timestamp when author first appeared | +| `last_seen` | *T.nilable(::Float)* | :heavy_minus_sign: | Timestamp of last activity | +| `manual_trust_level` | *T.nilable(::Float)* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/updateauthorresponse.md b/docs/models/operations/updateauthorresponse.md new file mode 100644 index 00000000..ca8b215e --- /dev/null +++ b/docs/models/operations/updateauthorresponse.md @@ -0,0 +1,11 @@ +# UpdateAuthorResponse + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| `content_type` | *::String* | :heavy_check_mark: | HTTP response content type for this operation | +| `status_code` | *::Integer* | :heavy_check_mark: | HTTP response status code for this operation | +| `raw_response` | [Faraday::Response](https://www.rubydoc.info/gems/faraday/Faraday/Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `public_author` | [T.nilable(Models::Components::PublicAuthor)](../../models/shared/publicauthor.md) | :heavy_minus_sign: | Successful response | \ No newline at end of file diff --git a/docs/models/operations/updatechannelcontenttype.md b/docs/models/operations/updatechannelcontenttype.md new file mode 100644 index 00000000..3ef17723 --- /dev/null +++ b/docs/models/operations/updatechannelcontenttype.md @@ -0,0 +1,26 @@ +# UpdateChannelContentType + +The kind of content the channel moderates. + +## Example Usage + +```ruby +require "moderation_api" + +value = UpdateChannelContentType::PROFILE +``` + + +## Values + +| Name | Value | +| --------- | --------- | +| `PROFILE` | profile | +| `MESSAGE` | message | +| `POST` | post | +| `COMMENT` | comment | +| `EVENT` | event | +| `PRODUCT` | product | +| `REVIEW` | review | +| `VOICE` | voice | +| `OTHER` | other | \ No newline at end of file diff --git a/docs/models/operations/updatechannelrequest.md b/docs/models/operations/updatechannelrequest.md new file mode 100644 index 00000000..701fcc07 --- /dev/null +++ b/docs/models/operations/updatechannelrequest.md @@ -0,0 +1,9 @@ +# UpdateChannelRequest + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | +| `id` | *::String* | :heavy_check_mark: | The ID of the channel to update. | +| `body` | [Models::Operations::UpdateChannelRequestBody](../../models/operations/updatechannelrequestbody.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/updatechannelrequestbody.md b/docs/models/operations/updatechannelrequestbody.md new file mode 100644 index 00000000..66ed8b3d --- /dev/null +++ b/docs/models/operations/updatechannelrequestbody.md @@ -0,0 +1,23 @@ +# UpdateChannelRequestBody + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | +| `name` | *T.nilable(::String)* | :heavy_minus_sign: | The channel's name. | +| `key` | *T.nilable(::String)* | :heavy_minus_sign: | The key you pass as `channel` when you moderate content. Changing it breaks integrations that send the old key. | +| `description` | *T.nilable(::String)* | :heavy_minus_sign: | The channel's description. | +| `content_type` | [T.nilable(Models::Operations::UpdateChannelContentType)](../../models/operations/updatechannelcontenttype.md) | :heavy_minus_sign: | The kind of content the channel moderates. | +| `flagging_mode` | [T.nilable(Models::Operations::FlaggingMode)](../../models/operations/flaggingmode.md) | :heavy_minus_sign: | `ACTIVE` flags content. `DRY_RUN` evaluates content without flagging it. | +| `context_enabled` | *T.nilable(T::Boolean)* | :heavy_minus_sign: | Whether earlier messages in the conversation are read when moderating a message. | +| `enable_image_moderation` | *T.nilable(T::Boolean)* | :heavy_minus_sign: | Whether images are moderated. | +| `enable_video_moderation` | *T.nilable(T::Boolean)* | :heavy_minus_sign: | Whether videos are moderated. | +| `enable_audio_moderation` | *T.nilable(T::Boolean)* | :heavy_minus_sign: | Whether audio is moderated. | +| `enable_voice_moderation` | *T.nilable(T::Boolean)* | :heavy_minus_sign: | Whether real-time voice streams are moderated. | +| `include_transcript_in_response` | *T.nilable(T::Boolean)* | :heavy_minus_sign: | Whether audio and video transcripts are returned in responses. | +| `transcription_quality` | [T.nilable(Models::Operations::TranscriptionQuality)](../../models/operations/transcriptionquality.md) | :heavy_minus_sign: | Trade-off between transcription speed and accuracy. | +| `unicode_spoof_detection_enabled` | *T.nilable(T::Boolean)* | :heavy_minus_sign: | Whether look-alike Unicode characters are normalized before moderation. | +| `frame_capture_interval` | *T.nilable(::Float)* | :heavy_minus_sign: | Seconds between frames captured from a video. | +| `max_frames_per_video` | *T.nilable(::Integer)* | :heavy_minus_sign: | The most frames moderated per video. | +| `spread_frames` | *T.nilable(T::Boolean)* | :heavy_minus_sign: | Whether frames are spread evenly across the whole video. | \ No newline at end of file diff --git a/docs/models/operations/updatechannelresponse.md b/docs/models/operations/updatechannelresponse.md new file mode 100644 index 00000000..d2bf701f --- /dev/null +++ b/docs/models/operations/updatechannelresponse.md @@ -0,0 +1,11 @@ +# UpdateChannelResponse + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | +| `content_type` | *::String* | :heavy_check_mark: | HTTP response content type for this operation | +| `status_code` | *::Integer* | :heavy_check_mark: | HTTP response status code for this operation | +| `raw_response` | [Faraday::Response](https://www.rubydoc.info/gems/faraday/Faraday/Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `channel` | [T.nilable(Models::Components::Channel)](../../models/shared/channel.md) | :heavy_minus_sign: | Channel updated successfully | \ No newline at end of file diff --git a/docs/models/operations/updateprojectrequest.md b/docs/models/operations/updateprojectrequest.md new file mode 100644 index 00000000..ad394aad --- /dev/null +++ b/docs/models/operations/updateprojectrequest.md @@ -0,0 +1,9 @@ +# UpdateProjectRequest + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | +| `id` | *::String* | :heavy_check_mark: | The ID of the project to update. | +| `body` | [Models::Operations::UpdateProjectRequestBody](../../models/operations/updateprojectrequestbody.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/updateprojectrequestbody.md b/docs/models/operations/updateprojectrequestbody.md new file mode 100644 index 00000000..564417dc --- /dev/null +++ b/docs/models/operations/updateprojectrequestbody.md @@ -0,0 +1,14 @@ +# UpdateProjectRequestBody + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | +| `name` | *T.nilable(::String)* | :heavy_minus_sign: | The project's name. | +| `description` | *T.nilable(::String)* | :heavy_minus_sign: | The project's description. | +| `domain` | *T.nilable(::String)* | :heavy_minus_sign: | The website or app the project moderates content for. Setting it on a project without context writes one. | +| `context` | *T.nilable(::String)* | :heavy_minus_sign: | What the platform is and who uses it. | +| `global_flagging_mode` | [T.nilable(Models::Operations::GlobalFlaggingMode)](../../models/operations/globalflaggingmode.md) | :heavy_minus_sign: | `ACTIVE` flags content. `DRY_RUN` evaluates without flagging. | +| `enable_request_logging` | *T.nilable(T::Boolean)* | :heavy_minus_sign: | Whether moderated content is stored and shown in the dashboard. | +| `casebook_enabled` | *T.nilable(T::Boolean)* | :heavy_minus_sign: | Whether review queue decisions are recorded in the casebook. | \ No newline at end of file diff --git a/docs/models/operations/updateprojectresponse.md b/docs/models/operations/updateprojectresponse.md new file mode 100644 index 00000000..f15ee954 --- /dev/null +++ b/docs/models/operations/updateprojectresponse.md @@ -0,0 +1,11 @@ +# UpdateProjectResponse + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | +| `content_type` | *::String* | :heavy_check_mark: | HTTP response content type for this operation | +| `status_code` | *::Integer* | :heavy_check_mark: | HTTP response status code for this operation | +| `raw_response` | [Faraday::Response](https://www.rubydoc.info/gems/faraday/Faraday/Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `project` | [T.nilable(Models::Components::Project)](../../models/shared/project.md) | :heavy_minus_sign: | Project updated successfully | \ No newline at end of file diff --git a/docs/models/operations/updatewebhookeventtyperequest.md b/docs/models/operations/updatewebhookeventtyperequest.md new file mode 100644 index 00000000..1b806c90 --- /dev/null +++ b/docs/models/operations/updatewebhookeventtyperequest.md @@ -0,0 +1,26 @@ +# UpdateWebhookEventTypeRequest + +## Example Usage + +```ruby +require "moderation_api" + +value = UpdateWebhookEventTypeRequest::QUEUE_ITEM_NEW +``` + + +## Values + +| Name | Value | +| ---------------------------- | ---------------------------- | +| `QUEUE_ITEM_NEW` | QUEUE_ITEM_NEW | +| `QUEUE_ITEM_COMPLETED` | QUEUE_ITEM_COMPLETED | +| `QUEUE_ITEM_ACTION` | QUEUE_ITEM_ACTION | +| `QUEUE_ITEM_REJECTED` | QUEUE_ITEM_REJECTED | +| `QUEUE_ITEM_ALLOWED` | QUEUE_ITEM_ALLOWED | +| `AUTHOR_BLOCKED` | AUTHOR_BLOCKED | +| `AUTHOR_UNBLOCKED` | AUTHOR_UNBLOCKED | +| `AUTHOR_SUSPENDED` | AUTHOR_SUSPENDED | +| `AUTHOR_UPDATED` | AUTHOR_UPDATED | +| `AUTHOR_TRUST_LEVEL_CHANGED` | AUTHOR_TRUST_LEVEL_CHANGED | +| `AUTHOR_ACTION` | AUTHOR_ACTION | \ No newline at end of file diff --git a/docs/models/operations/updatewebhookeventtyperesponse.md b/docs/models/operations/updatewebhookeventtyperesponse.md new file mode 100644 index 00000000..dfb2a347 --- /dev/null +++ b/docs/models/operations/updatewebhookeventtyperesponse.md @@ -0,0 +1,29 @@ +# UpdateWebhookEventTypeResponse + +## Example Usage + +```ruby +require "moderation_api" + +value = UpdateWebhookEventTypeResponse::QUEUE_ITEM_NEW + +# Open enum: use .deserialize() to create instances from custom string values +custom = UpdateWebhookEventTypeResponse.deserialize("custom_value") +``` + + +## Values + +| Name | Value | +| ---------------------------- | ---------------------------- | +| `QUEUE_ITEM_NEW` | QUEUE_ITEM_NEW | +| `QUEUE_ITEM_COMPLETED` | QUEUE_ITEM_COMPLETED | +| `QUEUE_ITEM_ACTION` | QUEUE_ITEM_ACTION | +| `QUEUE_ITEM_REJECTED` | QUEUE_ITEM_REJECTED | +| `QUEUE_ITEM_ALLOWED` | QUEUE_ITEM_ALLOWED | +| `AUTHOR_BLOCKED` | AUTHOR_BLOCKED | +| `AUTHOR_UNBLOCKED` | AUTHOR_UNBLOCKED | +| `AUTHOR_SUSPENDED` | AUTHOR_SUSPENDED | +| `AUTHOR_UPDATED` | AUTHOR_UPDATED | +| `AUTHOR_TRUST_LEVEL_CHANGED` | AUTHOR_TRUST_LEVEL_CHANGED | +| `AUTHOR_ACTION` | AUTHOR_ACTION | \ No newline at end of file diff --git a/docs/models/operations/updatewebhookpayloadversion.md b/docs/models/operations/updatewebhookpayloadversion.md new file mode 100644 index 00000000..82a9fec0 --- /dev/null +++ b/docs/models/operations/updatewebhookpayloadversion.md @@ -0,0 +1,22 @@ +# UpdateWebhookPayloadVersion + +Payload envelope version. V2 is the Stripe-style envelope; V1 is the legacy flat shape and is read-only via this API. + +## Example Usage + +```ruby +require "moderation_api" + +value = UpdateWebhookPayloadVersion::V1 + +# Open enum: use .deserialize() to create instances from custom string values +custom = UpdateWebhookPayloadVersion.deserialize("custom_value") +``` + + +## Values + +| Name | Value | +| ----- | ----- | +| `V1` | V1 | +| `V2` | V2 | \ No newline at end of file diff --git a/docs/models/operations/updatewebhookrequest.md b/docs/models/operations/updatewebhookrequest.md new file mode 100644 index 00000000..827ecff7 --- /dev/null +++ b/docs/models/operations/updatewebhookrequest.md @@ -0,0 +1,9 @@ +# UpdateWebhookRequest + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | +| `id` | *::String* | :heavy_check_mark: | The ID of the webhook to update. | +| `body` | [Models::Operations::UpdateWebhookRequestBody](../../models/operations/updatewebhookrequestbody.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/updatewebhookrequestbody.md b/docs/models/operations/updatewebhookrequestbody.md new file mode 100644 index 00000000..240e16b6 --- /dev/null +++ b/docs/models/operations/updatewebhookrequestbody.md @@ -0,0 +1,11 @@ +# UpdateWebhookRequestBody + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | +| `name` | *T.nilable(::String)* | :heavy_minus_sign: | The webhook's name, used to identify it in the dashboard | +| `description` | *T.nilable(::String)* | :heavy_minus_sign: | The webhook's description | +| `url` | *T.nilable(::String)* | :heavy_minus_sign: | The webhook's URL. We'll call this URL when an event occurs. | +| `event_types` | T::Array<[Models::Operations::UpdateWebhookEventTypeRequest](../../models/operations/updatewebhookeventtyperequest.md)> | :heavy_minus_sign: | Event types this webhook subscribes to. One webhook URL receives all events you list here. | \ No newline at end of file diff --git a/docs/models/operations/updatewebhookresponse.md b/docs/models/operations/updatewebhookresponse.md new file mode 100644 index 00000000..f2646b93 --- /dev/null +++ b/docs/models/operations/updatewebhookresponse.md @@ -0,0 +1,11 @@ +# UpdateWebhookResponse + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | +| `content_type` | *::String* | :heavy_check_mark: | HTTP response content type for this operation | +| `status_code` | *::Integer* | :heavy_check_mark: | HTTP response status code for this operation | +| `raw_response` | [Faraday::Response](https://www.rubydoc.info/gems/faraday/Faraday/Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `object` | [T.nilable(Models::Operations::UpdateWebhookResponseBody)](../../models/operations/updatewebhookresponsebody.md) | :heavy_minus_sign: | Webhook updated successfully | \ No newline at end of file diff --git a/docs/models/operations/updatewebhookresponsebody.md b/docs/models/operations/updatewebhookresponsebody.md new file mode 100644 index 00000000..724cf192 --- /dev/null +++ b/docs/models/operations/updatewebhookresponsebody.md @@ -0,0 +1,16 @@ +# UpdateWebhookResponseBody + +Webhook updated successfully + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *::String* | :heavy_check_mark: | The ID of the webhook. | +| `name` | *::String* | :heavy_check_mark: | The webhook's name. | +| `description` | *T.nilable(::String)* | :heavy_minus_sign: | The webhook's description. | +| `url` | *::String* | :heavy_check_mark: | The URL we call when a subscribed event occurs. | +| `event_types` | T::Array<[Models::Operations::UpdateWebhookEventTypeResponse](../../models/operations/updatewebhookeventtyperesponse.md)> | :heavy_check_mark: | Event types this webhook subscribes to. Empty for legacy v1 webhooks, which subscribe via their single deprecated `type` instead. | +| `payload_version` | [Models::Operations::UpdateWebhookPayloadVersion](../../models/operations/updatewebhookpayloadversion.md) | :heavy_check_mark: | Payload envelope version. V2 is the Stripe-style envelope; V1 is the legacy flat shape and is read-only via this API. | +| `created_at` | *::String* | :heavy_check_mark: | The date the webhook was created. | \ No newline at end of file diff --git a/docs/models/operations/updatewordlistrequest.md b/docs/models/operations/updatewordlistrequest.md new file mode 100644 index 00000000..05bb8a43 --- /dev/null +++ b/docs/models/operations/updatewordlistrequest.md @@ -0,0 +1,9 @@ +# UpdateWordlistRequest + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | +| `id` | *::String* | :heavy_check_mark: | ID of the wordlist to update | +| `body` | [Models::Operations::UpdateWordlistRequestBody](../../models/operations/updatewordlistrequestbody.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/updatewordlistrequestbody.md b/docs/models/operations/updatewordlistrequestbody.md new file mode 100644 index 00000000..b17e4917 --- /dev/null +++ b/docs/models/operations/updatewordlistrequestbody.md @@ -0,0 +1,12 @@ +# UpdateWordlistRequestBody + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | +| `name` | *T.nilable(::String)* | :heavy_minus_sign: | New name for the wordlist | +| `key` | *T.nilable(::String)* | :heavy_minus_sign: | New key for the wordlist | +| `description` | *T.nilable(::String)* | :heavy_minus_sign: | New description for the wordlist | +| `words` | T::Array<*::String*> | :heavy_minus_sign: | New words for the wordlist. Replace the existing words with these new ones. Duplicate words will be ignored. | +| `strict` | *T.nilable(T::Boolean)* | :heavy_minus_sign: | Deprecated. Now using threshold in project settings. | \ No newline at end of file diff --git a/docs/models/operations/updatewordlistresponse.md b/docs/models/operations/updatewordlistresponse.md new file mode 100644 index 00000000..c98764d7 --- /dev/null +++ b/docs/models/operations/updatewordlistresponse.md @@ -0,0 +1,11 @@ +# UpdateWordlistResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | +| `content_type` | *::String* | :heavy_check_mark: | HTTP response content type for this operation | +| `status_code` | *::Integer* | :heavy_check_mark: | HTTP response status code for this operation | +| `raw_response` | [Faraday::Response](https://www.rubydoc.info/gems/faraday/Faraday/Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `object` | [T.nilable(Models::Operations::UpdateWordlistResponseBody)](../../models/operations/updatewordlistresponsebody.md) | :heavy_minus_sign: | Wordlist updated successfully | \ No newline at end of file diff --git a/docs/models/operations/updatewordlistresponsebody.md b/docs/models/operations/updatewordlistresponsebody.md new file mode 100644 index 00000000..bd3ea2c7 --- /dev/null +++ b/docs/models/operations/updatewordlistresponsebody.md @@ -0,0 +1,16 @@ +# UpdateWordlistResponseBody + +Wordlist updated successfully + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------- | ----------------------------- | ----------------------------- | ----------------------------- | +| `id` | *::String* | :heavy_check_mark: | ID of the wordlist | +| `name` | *T.nilable(::String)* | :heavy_check_mark: | N/A | +| `words` | T::Array<*::String*> | :heavy_check_mark: | Words in the wordlist | +| `created_at` | *::String* | :heavy_check_mark: | Creation date of the wordlist | +| `organization_id` | *::String* | :heavy_check_mark: | ID of the organization | +| `user_id` | *T.nilable(::String)* | :heavy_check_mark: | N/A | +| `strict` | *T::Boolean* | :heavy_check_mark: | Strict mode | \ No newline at end of file diff --git a/docs/models/operations/urlmasking.md b/docs/models/operations/urlmasking.md new file mode 100644 index 00000000..d491d7b0 --- /dev/null +++ b/docs/models/operations/urlmasking.md @@ -0,0 +1,9 @@ +# URLMasking + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | +| `id` | *::String* | :heavy_check_mark: | N/A | +| `entities` | T::Hash[Symbol, [Models::Operations::Entities2](../../models/operations/entities2.md)] | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/urlrisk.md b/docs/models/operations/urlrisk.md new file mode 100644 index 00000000..8b8ef5bc --- /dev/null +++ b/docs/models/operations/urlrisk.md @@ -0,0 +1,13 @@ +# URLRisk + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `flag` | *T::Boolean* | :heavy_check_mark: | N/A | +| `threshold` | *T.nilable(::Float)* | :heavy_minus_sign: | N/A | +| `id` | *::String* | :heavy_check_mark: | N/A | +| `allowlist_wordlist_ids` | T::Array<*::String*> | :heavy_minus_sign: | IDs of wordlists whose entries are treated as allowed URL domains. Matches short-circuit the risk model and are never flagged. | +| `blocklist_wordlist_ids` | T::Array<*::String*> | :heavy_minus_sign: | IDs of wordlists whose entries are treated as blocked URL domains. Matches short-circuit the risk model and are always flagged. Blocklists take precedence over allowlists. | +| `flag_link_shorteners` | *T.nilable(T::Boolean)* | :heavy_minus_sign: | When true, any URL detected as a free link shortener (bit.ly, t.co, tinyurl, etc.) is always flagged regardless of risk score. Allowlist matches still win. | \ No newline at end of file diff --git a/docs/models/operations/value.md b/docs/models/operations/value.md new file mode 100644 index 00000000..5b914761 --- /dev/null +++ b/docs/models/operations/value.md @@ -0,0 +1,21 @@ +# Value + +## Example Usage + +```ruby +require "moderation_api" + +value = Value::POSITIVE + +# Open enum: use .deserialize() to create instances from custom string values +custom = Value.deserialize("custom_value") +``` + + +## Values + +| Name | Value | +| ---------- | ---------- | +| `POSITIVE` | positive | +| `NEUTRAL` | neutral | +| `NEGATIVE` | negative | \ No newline at end of file diff --git a/docs/models/operations/verdict.md b/docs/models/operations/verdict.md new file mode 100644 index 00000000..b6494793 --- /dev/null +++ b/docs/models/operations/verdict.md @@ -0,0 +1,22 @@ +# Verdict + +The ruling your past decisions point to for this content. + +## Example Usage + +```ruby +require "moderation_api" + +value = Verdict::ALLOW + +# Open enum: use .deserialize() to create instances from custom string values +custom = Verdict.deserialize("custom_value") +``` + + +## Values + +| Name | Value | +| -------- | -------- | +| `ALLOW` | allow | +| `REJECT` | reject | \ No newline at end of file diff --git a/docs/models/operations/videorequest.md b/docs/models/operations/videorequest.md new file mode 100644 index 00000000..11c248c2 --- /dev/null +++ b/docs/models/operations/videorequest.md @@ -0,0 +1,11 @@ +# VideoRequest + +Video + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------- | --------------------------------- | --------------------------------- | --------------------------------- | +| `type` | *::String* | :heavy_check_mark: | N/A | +| `url` | *::String* | :heavy_check_mark: | A public URL of the video content | \ No newline at end of file diff --git a/docs/models/operations/videoresponse.md b/docs/models/operations/videoresponse.md new file mode 100644 index 00000000..781c75c7 --- /dev/null +++ b/docs/models/operations/videoresponse.md @@ -0,0 +1,11 @@ +# VideoResponse + +Video + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------- | --------------------------------- | --------------------------------- | --------------------------------- | +| `type` | *::String* | :heavy_check_mark: | N/A | +| `url` | *::String* | :heavy_check_mark: | A public URL of the video content | \ No newline at end of file diff --git a/docs/models/operations/violence.md b/docs/models/operations/violence.md new file mode 100644 index 00000000..e79fb7e3 --- /dev/null +++ b/docs/models/operations/violence.md @@ -0,0 +1,10 @@ +# Violence + + +## Fields + +| Field | Type | Required | Description | +| -------------------- | -------------------- | -------------------- | -------------------- | +| `flag` | *T::Boolean* | :heavy_check_mark: | N/A | +| `threshold` | *T.nilable(::Float)* | :heavy_minus_sign: | N/A | +| `id` | *::String* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/weapons.md b/docs/models/operations/weapons.md new file mode 100644 index 00000000..b8169187 --- /dev/null +++ b/docs/models/operations/weapons.md @@ -0,0 +1,10 @@ +# Weapons + + +## Fields + +| Field | Type | Required | Description | +| -------------------- | -------------------- | -------------------- | -------------------- | +| `flag` | *T::Boolean* | :heavy_check_mark: | N/A | +| `threshold` | *T.nilable(::Float)* | :heavy_minus_sign: | N/A | +| `id` | *::String* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/withinunit.md b/docs/models/operations/withinunit.md new file mode 100644 index 00000000..e29cd47e --- /dev/null +++ b/docs/models/operations/withinunit.md @@ -0,0 +1,24 @@ +# WithinUnit + +## Example Usage + +```ruby +require "moderation_api" + +value = WithinUnit::MINUTES + +# Open enum: use .deserialize() to create instances from custom string values +custom = WithinUnit.deserialize("custom_value") +``` + + +## Values + +| Name | Value | +| --------- | --------- | +| `MINUTES` | MINUTES | +| `HOURS` | HOURS | +| `DAYS` | DAYS | +| `WEEKS` | WEEKS | +| `MONTHS` | MONTHS | +| `YEARS` | YEARS | \ No newline at end of file diff --git a/docs/sdks/account/README.md b/docs/sdks/account/README.md new file mode 100644 index 00000000..c5237bc2 --- /dev/null +++ b/docs/sdks/account/README.md @@ -0,0 +1,41 @@ +# Account + +## Overview + +### Available Operations + +* [retrieve](#retrieve) - Get account details + +## retrieve + +Get account details + +### Example Usage + + +```ruby +require 'moderation_api' + +Models = ::ModerationApi::Models +s = ::ModerationApi::ModerationApi.new( + secret_key: '' +) +res = s.account.retrieve + +unless res.object.nil? + # handle response +end + +``` + +### Response + +**[T.nilable(Models::Operations::GetAccountResponse)](../../models/operations/getaccountresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ----------------------------------- | ----------------------------------- | ----------------------------------- | +| Models::Errors::AuthenticationError | 401 | application/json | +| Models::Errors::RateLimitError | 429 | application/json | +| Errors::APIError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/actions/README.md b/docs/sdks/actions/README.md new file mode 100644 index 00000000..6e86ed29 --- /dev/null +++ b/docs/sdks/actions/README.md @@ -0,0 +1,284 @@ +# Actions + +## Overview + +### Available Operations + +* [list](#list) - List moderation actions +* [create](#create) - Create an action +* [retrieve](#retrieve) - Get an action +* [update](#update) - Update an action +* [delete](#delete) - Delete an action +* [execute](#execute) - Execute moderation action + +## list + +List the moderation actions of the project. The list is paginated. + +### Example Usage + + +```ruby +require 'moderation_api' + +Models = ::ModerationApi::Models +s = ::ModerationApi::ModerationApi.new( + secret_key: '' +) +res = s.actions.list(page: 1, page_size: 20) + +unless res.object.nil? + # handle response +end + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------- | ---------------------- | ---------------------- | ---------------------- | +| `queue_id` | *T.nilable(::String)* | :heavy_minus_sign: | N/A | +| `page` | *T.nilable(::Integer)* | :heavy_minus_sign: | N/A | +| `page_size` | *T.nilable(::Integer)* | :heavy_minus_sign: | N/A | + +### Response + +**[T.nilable(Models::Operations::ListActionsResponse)](../../models/operations/listactionsresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------------------------- | ------------------------------------- | ------------------------------------- | +| Models::Errors::BadRequestError | 400 | application/json | +| Models::Errors::AuthenticationError | 401 | application/json | +| Models::Errors::PermissionDeniedError | 403 | application/json | +| Models::Errors::NotFoundError | 404 | application/json | +| Models::Errors::RateLimitError | 429 | application/json | +| Models::Errors::InternalServerError | 500 | application/json | +| Errors::APIError | 4XX, 5XX | \*/\* | + +## create + +Create an action. + +### Example Usage + + +```ruby +require 'moderation_api' + +Models = ::ModerationApi::Models +s = ::ModerationApi::ModerationApi.new( + secret_key: '' +) + +req = Models::Operations::CreateActionRequest.new( + key: 'suspend-24h', + name: 'Suspend for 24 hours', + type: Models::Operations::CreateActionTypeRequest::AUTHOR_BLOCK_TEMP, + queue_behaviour: Models::Operations::CreateActionQueueBehaviourRequest::REMOVE +) +res = s.actions.create(request: req) + +unless res.object.nil? + # handle response +end + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | +| `request` | [Models::Operations::CreateActionRequest](../../models/operations/createactionrequest.md) | :heavy_check_mark: | The request object to use for the request. | + +### Response + +**[T.nilable(Models::Operations::CreateActionResponse)](../../models/operations/createactionresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ----------------------------------- | ----------------------------------- | ----------------------------------- | +| Models::Errors::BadRequestError | 400 | application/json | +| Models::Errors::AuthenticationError | 401 | application/json | +| Models::Errors::ConflictError | 409 | application/json | +| Models::Errors::RateLimitError | 429 | application/json | +| Errors::APIError | 4XX, 5XX | \*/\* | + +## retrieve + +Get an action by ID. + +### Example Usage + + +```ruby +require 'moderation_api' + +Models = ::ModerationApi::Models +s = ::ModerationApi::ModerationApi.new( + secret_key: '' +) +res = s.actions.retrieve(id: '') + +unless res.object.nil? + # handle response +end + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------- | ---------------------------- | ---------------------------- | ---------------------------- | +| `id` | *::String* | :heavy_check_mark: | The ID of the action to get. | + +### Response + +**[T.nilable(Models::Operations::GetActionResponse)](../../models/operations/getactionresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ----------------------------------- | ----------------------------------- | ----------------------------------- | +| Models::Errors::BadRequestError | 400 | application/json | +| Models::Errors::AuthenticationError | 401 | application/json | +| Models::Errors::NotFoundError | 404 | application/json | +| Models::Errors::RateLimitError | 429 | application/json | +| Errors::APIError | 4XX, 5XX | \*/\* | + +## update + +Update an action. + +### Example Usage + + +```ruby +require 'moderation_api' + +Models = ::ModerationApi::Models +s = ::ModerationApi::ModerationApi.new( + secret_key: '' +) +res = s.actions.update(id: '', body: Models::Operations::UpdateActionRequestBody.new) + +unless res.object.nil? + # handle response +end + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | +| `id` | *::String* | :heavy_check_mark: | The ID of the action to update. | +| `body` | [Models::Operations::UpdateActionRequestBody](../../models/operations/updateactionrequestbody.md) | :heavy_check_mark: | N/A | + +### Response + +**[T.nilable(Models::Operations::UpdateActionResponse)](../../models/operations/updateactionresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ----------------------------------- | ----------------------------------- | ----------------------------------- | +| Models::Errors::BadRequestError | 400 | application/json | +| Models::Errors::AuthenticationError | 401 | application/json | +| Models::Errors::NotFoundError | 404 | application/json | +| Models::Errors::ConflictError | 409 | application/json | +| Models::Errors::RateLimitError | 429 | application/json | +| Errors::APIError | 4XX, 5XX | \*/\* | + +## delete + +Delete an action and all of its webhooks. + +### Example Usage + + +```ruby +require 'moderation_api' + +Models = ::ModerationApi::Models +s = ::ModerationApi::ModerationApi.new( + secret_key: '' +) +res = s.actions.delete(id: '') + +unless res.object.nil? + # handle response +end + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | +| `id` | *::String* | :heavy_check_mark: | The ID of the action to delete. | + +### Response + +**[T.nilable(Models::Operations::DeleteActionResponse)](../../models/operations/deleteactionresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ----------------------------------- | ----------------------------------- | ----------------------------------- | +| Models::Errors::BadRequestError | 400 | application/json | +| Models::Errors::AuthenticationError | 401 | application/json | +| Models::Errors::NotFoundError | 404 | application/json | +| Models::Errors::RateLimitError | 429 | application/json | +| Errors::APIError | 4XX, 5XX | \*/\* | + +## execute + +Execute a moderation action on one or more content items. + +### Example Usage + + +```ruby +require 'moderation_api' + +Models = ::ModerationApi::Models +s = ::ModerationApi::ModerationApi.new( + secret_key: '' +) + +req = Models::Operations::ExecuteActionRequest.new( + action_key: 'suspend-24h', + author_ids: [ + 'user-1092', + ] +) +res = s.actions.execute(request: req) + +unless res.object.nil? + # handle response +end + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | +| `request` | [Models::Operations::ExecuteActionRequest](../../models/operations/executeactionrequest.md) | :heavy_check_mark: | The request object to use for the request. | + +### Response + +**[T.nilable(Models::Operations::ExecuteActionResponse)](../../models/operations/executeactionresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ----------------------------------- | ----------------------------------- | ----------------------------------- | +| Models::Errors::BadRequestError | 400 | application/json | +| Models::Errors::AuthenticationError | 401 | application/json | +| Models::Errors::NotFoundError | 404 | application/json | +| Models::Errors::RateLimitError | 429 | application/json | +| Errors::APIError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/authors/README.md b/docs/sdks/authors/README.md new file mode 100644 index 00000000..1712fd18 --- /dev/null +++ b/docs/sdks/authors/README.md @@ -0,0 +1,248 @@ +# Authors + +## Overview + +### Available Operations + +* [list](#list) - List authors +* [create](#create) - Create a new author +* [retrieve](#retrieve) - Get author details +* [update](#update) - Update author details +* [delete](#delete) - Delete an author + +## list + +List authors with their activity metrics and reputation. The list is paginated. + +### Example Usage + + +```ruby +require 'moderation_api' + +Models = ::ModerationApi::Models +s = ::ModerationApi::ModerationApi.new( + secret_key: '' +) + +req = Models::Operations::ListAuthorsRequest.new +res = s.authors.list(request: req) + +unless res.object.nil? + # handle response +end + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | +| `request` | [Models::Operations::ListAuthorsRequest](../../models/operations/listauthorsrequest.md) | :heavy_check_mark: | The request object to use for the request. | + +### Response + +**[T.nilable(Models::Operations::ListAuthorsResponse)](../../models/operations/listauthorsresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------------------------- | ------------------------------------- | ------------------------------------- | +| Models::Errors::BadRequestError | 400 | application/json | +| Models::Errors::AuthenticationError | 401 | application/json | +| Models::Errors::PermissionDeniedError | 403 | application/json | +| Models::Errors::NotFoundError | 404 | application/json | +| Models::Errors::RateLimitError | 429 | application/json | +| Models::Errors::InternalServerError | 500 | application/json | +| Errors::APIError | 4XX, 5XX | \*/\* | + +## create + +Create a new author. Typically not needed as authors are created automatically when content is moderated. + +### Example Usage + + +```ruby +require 'moderation_api' + +Models = ::ModerationApi::Models +s = ::ModerationApi::ModerationApi.new( + secret_key: '' +) + +req = Models::Operations::CreateAuthorRequest.new( + name: 'Jamie Rivera', + email: 'jamie@example.com', + metadata: Models::Operations::CreateAuthorMetadata.new( + email_verified: true, + is_paying_customer: false + ), + external_id: 'user-1092' +) +res = s.authors.create(request: req) + +unless res.public_author.nil? + # handle response +end + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | +| `request` | [Models::Operations::CreateAuthorRequest](../../models/operations/createauthorrequest.md) | :heavy_check_mark: | The request object to use for the request. | + +### Response + +**[T.nilable(Models::Operations::CreateAuthorResponse)](../../models/operations/createauthorresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------------------------- | ------------------------------------- | ------------------------------------- | +| Models::Errors::BadRequestError | 400 | application/json | +| Models::Errors::AuthenticationError | 401 | application/json | +| Models::Errors::PermissionDeniedError | 403 | application/json | +| Models::Errors::RateLimitError | 429 | application/json | +| Models::Errors::InternalServerError | 500 | application/json | +| Errors::APIError | 4XX, 5XX | \*/\* | + +## retrieve + +Get detailed information about a specific author including historical data and analysis + +### Example Usage + + +```ruby +require 'moderation_api' + +Models = ::ModerationApi::Models +s = ::ModerationApi::ModerationApi.new( + secret_key: '' +) +res = s.authors.retrieve(id: '') + +unless res.public_author.nil? + # handle response +end + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | +| `id` | *::String* | :heavy_check_mark: | Either external ID or the ID assigned by moderation API. | + +### Response + +**[T.nilable(Models::Operations::GetAuthorResponse)](../../models/operations/getauthorresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------------------------- | ------------------------------------- | ------------------------------------- | +| Models::Errors::BadRequestError | 400 | application/json | +| Models::Errors::AuthenticationError | 401 | application/json | +| Models::Errors::PermissionDeniedError | 403 | application/json | +| Models::Errors::NotFoundError | 404 | application/json | +| Models::Errors::RateLimitError | 429 | application/json | +| Models::Errors::InternalServerError | 500 | application/json | +| Errors::APIError | 4XX, 5XX | \*/\* | + +## update + +Update the details of a specific author + +### Example Usage + + +```ruby +require 'moderation_api' + +Models = ::ModerationApi::Models +s = ::ModerationApi::ModerationApi.new( + secret_key: '' +) +res = s.authors.update(id: '', body: Models::Operations::UpdateAuthorRequestBody.new( + metadata: Models::Operations::UpdateAuthorMetadata.new( + identity_verified: true + ), + manual_trust_level: 2.0 +)) + +unless res.public_author.nil? + # handle response +end + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | +| `id` | *::String* | :heavy_check_mark: | Either external ID or the ID assigned by moderation API. | +| `body` | [Models::Operations::UpdateAuthorRequestBody](../../models/operations/updateauthorrequestbody.md) | :heavy_check_mark: | N/A | + +### Response + +**[T.nilable(Models::Operations::UpdateAuthorResponse)](../../models/operations/updateauthorresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------------------------- | ------------------------------------- | ------------------------------------- | +| Models::Errors::BadRequestError | 400 | application/json | +| Models::Errors::AuthenticationError | 401 | application/json | +| Models::Errors::PermissionDeniedError | 403 | application/json | +| Models::Errors::NotFoundError | 404 | application/json | +| Models::Errors::RateLimitError | 429 | application/json | +| Models::Errors::InternalServerError | 500 | application/json | +| Errors::APIError | 4XX, 5XX | \*/\* | + +## delete + +Delete a specific author. This resets the author: status, blocks, trust level, metrics and action history are removed. The author is created again with a clean record the next time content is moderated for the same ID. + +### Example Usage + + +```ruby +require 'moderation_api' + +Models = ::ModerationApi::Models +s = ::ModerationApi::ModerationApi.new( + secret_key: '' +) +res = s.authors.delete(id: '') + +unless res.object.nil? + # handle response +end + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | +| `id` | *::String* | :heavy_check_mark: | Either external ID or the ID assigned by moderation API. | + +### Response + +**[T.nilable(Models::Operations::DeleteAuthorResponse)](../../models/operations/deleteauthorresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------------------------- | ------------------------------------- | ------------------------------------- | +| Models::Errors::BadRequestError | 400 | application/json | +| Models::Errors::AuthenticationError | 401 | application/json | +| Models::Errors::PermissionDeniedError | 403 | application/json | +| Models::Errors::NotFoundError | 404 | application/json | +| Models::Errors::RateLimitError | 429 | application/json | +| Models::Errors::InternalServerError | 500 | application/json | +| Errors::APIError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/channels/README.md b/docs/sdks/channels/README.md new file mode 100644 index 00000000..214028fc --- /dev/null +++ b/docs/sdks/channels/README.md @@ -0,0 +1,275 @@ +# Channels + +## Overview + +### Available Operations + +* [list](#list) - List channels +* [create](#create) - Create a channel +* [retrieve](#retrieve) - Get a channel +* [update](#update) - Update a channel +* [delete](#delete) - Delete a channel +* [duplicate](#duplicate) - Duplicate a channel + +## list + +List the channels in a project. The list is paginated. Needs the `channels:read` permission. + +### Example Usage + + +```ruby +require 'moderation_api' + +Models = ::ModerationApi::Models +s = ::ModerationApi::ModerationApi.new( + secret_key: '' +) +res = s.channels.list(project_id: '', page: 1, page_size: 20) + +unless res.object.nil? + # handle response +end + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------- | ---------------------- | ---------------------- | ---------------------- | +| `project_id` | *::String* | :heavy_check_mark: | The ID of the project. | +| `page` | *T.nilable(::Integer)* | :heavy_minus_sign: | N/A | +| `page_size` | *T.nilable(::Integer)* | :heavy_minus_sign: | N/A | + +### Response + +**[T.nilable(Models::Operations::ListChannelsResponse)](../../models/operations/listchannelsresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------------------------- | ------------------------------------- | ------------------------------------- | +| Models::Errors::AuthenticationError | 401 | application/json | +| Models::Errors::PermissionDeniedError | 403 | application/json | +| Models::Errors::NotFoundError | 404 | application/json | +| Models::Errors::RateLimitError | 429 | application/json | +| Errors::APIError | 4XX, 5XX | \*/\* | + +## create + +Create a channel in a project, with the default rules. The project's first channel becomes its default. Needs the `channels:write` permission. + +### Example Usage + + +```ruby +require 'moderation_api' + +Models = ::ModerationApi::Models +s = ::ModerationApi::ModerationApi.new( + secret_key: '' +) +res = s.channels.create(project_id: '', body: Models::Operations::CreateChannelRequestBody.new( + name: '' +)) + +unless res.channel.nil? + # handle response +end + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | +| `project_id` | *::String* | :heavy_check_mark: | The ID of the project to add the channel to. | +| `body` | [Models::Operations::CreateChannelRequestBody](../../models/operations/createchannelrequestbody.md) | :heavy_check_mark: | N/A | + +### Response + +**[T.nilable(Models::Operations::CreateChannelResponse)](../../models/operations/createchannelresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------------------------- | ------------------------------------- | ------------------------------------- | +| Models::Errors::BadRequestError | 400 | application/json | +| Models::Errors::AuthenticationError | 401 | application/json | +| Models::Errors::PermissionDeniedError | 403 | application/json | +| Models::Errors::NotFoundError | 404 | application/json | +| Models::Errors::RateLimitError | 429 | application/json | +| Errors::APIError | 4XX, 5XX | \*/\* | + +## retrieve + +Get a channel by ID. Needs the `channels:read` permission. + +### Example Usage + + +```ruby +require 'moderation_api' + +Models = ::ModerationApi::Models +s = ::ModerationApi::ModerationApi.new( + secret_key: '' +) +res = s.channels.retrieve(id: '') + +unless res.channel.nil? + # handle response +end + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------- | ---------------------- | ---------------------- | ---------------------- | +| `id` | *::String* | :heavy_check_mark: | The ID of the channel. | + +### Response + +**[T.nilable(Models::Operations::GetChannelResponse)](../../models/operations/getchannelresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------------------------- | ------------------------------------- | ------------------------------------- | +| Models::Errors::AuthenticationError | 401 | application/json | +| Models::Errors::PermissionDeniedError | 403 | application/json | +| Models::Errors::NotFoundError | 404 | application/json | +| Models::Errors::RateLimitError | 429 | application/json | +| Errors::APIError | 4XX, 5XX | \*/\* | + +## update + +Update a channel. Fields you leave out keep their value. Needs the `channels:write` permission. + +### Example Usage + + +```ruby +require 'moderation_api' + +Models = ::ModerationApi::Models +s = ::ModerationApi::ModerationApi.new( + secret_key: '' +) +res = s.channels.update(id: '', body: Models::Operations::UpdateChannelRequestBody.new) + +unless res.channel.nil? + # handle response +end + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | +| `id` | *::String* | :heavy_check_mark: | The ID of the channel to update. | +| `body` | [Models::Operations::UpdateChannelRequestBody](../../models/operations/updatechannelrequestbody.md) | :heavy_check_mark: | N/A | + +### Response + +**[T.nilable(Models::Operations::UpdateChannelResponse)](../../models/operations/updatechannelresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------------------------- | ------------------------------------- | ------------------------------------- | +| Models::Errors::BadRequestError | 400 | application/json | +| Models::Errors::AuthenticationError | 401 | application/json | +| Models::Errors::PermissionDeniedError | 403 | application/json | +| Models::Errors::NotFoundError | 404 | application/json | +| Models::Errors::RateLimitError | 429 | application/json | +| Errors::APIError | 4XX, 5XX | \*/\* | + +## delete + +Delete a channel. Its key is freed for a new channel. When it was the default, the oldest remaining channel becomes the default. A channel that still moderates a Slack workspace must be disconnected first. Needs the `channels:write` permission. + +### Example Usage + + +```ruby +require 'moderation_api' + +Models = ::ModerationApi::Models +s = ::ModerationApi::ModerationApi.new( + secret_key: '' +) +res = s.channels.delete(id: '') + +unless res.object.nil? + # handle response +end + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------- | ---------------------- | ---------------------- | ---------------------- | +| `id` | *::String* | :heavy_check_mark: | The ID of the channel. | + +### Response + +**[T.nilable(Models::Operations::DeleteChannelResponse)](../../models/operations/deletechannelresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------------------------- | ------------------------------------- | ------------------------------------- | +| Models::Errors::BadRequestError | 400 | application/json | +| Models::Errors::AuthenticationError | 401 | application/json | +| Models::Errors::PermissionDeniedError | 403 | application/json | +| Models::Errors::NotFoundError | 404 | application/json | +| Models::Errors::RateLimitError | 429 | application/json | +| Errors::APIError | 4XX, 5XX | \*/\* | + +## duplicate + +Copy a channel in its project, with every setting, policy, rule and wordlist. Integrations (Discord, Slack, WordPress) are not copied. Needs the `channels:write` permission. + +### Example Usage + + +```ruby +require 'moderation_api' + +Models = ::ModerationApi::Models +s = ::ModerationApi::ModerationApi.new( + secret_key: '' +) +res = s.channels.duplicate(id: '', body: Models::Operations::DuplicateChannelRequestBody.new) + +unless res.channel.nil? + # handle response +end + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | +| `id` | *::String* | :heavy_check_mark: | The ID of the channel to copy. | +| `body` | [Models::Operations::DuplicateChannelRequestBody](../../models/operations/duplicatechannelrequestbody.md) | :heavy_check_mark: | N/A | + +### Response + +**[T.nilable(Models::Operations::DuplicateChannelResponse)](../../models/operations/duplicatechannelresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------------------------- | ------------------------------------- | ------------------------------------- | +| Models::Errors::BadRequestError | 400 | application/json | +| Models::Errors::AuthenticationError | 401 | application/json | +| Models::Errors::PermissionDeniedError | 403 | application/json | +| Models::Errors::NotFoundError | 404 | application/json | +| Models::Errors::RateLimitError | 429 | application/json | +| Errors::APIError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/content/README.md b/docs/sdks/content/README.md new file mode 100644 index 00000000..d5a368b3 --- /dev/null +++ b/docs/sdks/content/README.md @@ -0,0 +1,61 @@ +# Content + +## Overview + +### Available Operations + +* [submit](#submit) + +## submit + +### Example Usage + + +```ruby +require 'moderation_api' + +Models = ::ModerationApi::Models +s = ::ModerationApi::ModerationApi.new( + secret_key: '' +) + +req = Models::Operations::SubmitContentRequest.new( + content: Models::Operations::TextRequest.new( + type: 'text', + text: 'Hey, check out my profile for a deal!' + ), + content_id: 'message-48213', + author_id: 'user-1092', + conversation_id: 'room-general', + metadata: { + 'platform' => 'ios', + } +) +res = s.content.submit(request: req) + +unless res.object.nil? + # handle response +end + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | +| `request` | [Models::Operations::SubmitContentRequest](../../models/operations/submitcontentrequest.md) | :heavy_check_mark: | The request object to use for the request. | + +### Response + +**[T.nilable(Models::Operations::SubmitContentResponse)](../../models/operations/submitcontentresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------------------------- | ------------------------------------- | ------------------------------------- | +| Models::Errors::BadRequestError | 400 | application/json | +| Models::Errors::AuthenticationError | 401 | application/json | +| Models::Errors::PermissionDeniedError | 403 | application/json | +| Models::Errors::RateLimitError | 429 | application/json | +| Models::Errors::InternalServerError | 500 | application/json | +| Errors::APIError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/items/README.md b/docs/sdks/items/README.md new file mode 100644 index 00000000..8f054970 --- /dev/null +++ b/docs/sdks/items/README.md @@ -0,0 +1,151 @@ +# Queue.Items + +## Overview + +### Available Operations + +* [list](#list) - Get queue items +* [resolve](#resolve) - Resolve a queue item +* [unresolve](#unresolve) - Unresolve a queue item + +## list + +Get paginated list of items in a moderation queue with filtering options + +### Example Usage + + +```ruby +require 'moderation_api' + +Models = ::ModerationApi::Models +s = ::ModerationApi::ModerationApi.new( + secret_key: '' +) + +req = Models::Operations::ListQueueItemsRequest.new( + id: '' +) +res = s.queue.items.list(request: req) + +unless res.object.nil? + # handle response +end + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | +| `request` | [Models::Operations::ListQueueItemsRequest](../../models/operations/listqueueitemsrequest.md) | :heavy_check_mark: | The request object to use for the request. | + +### Response + +**[T.nilable(Models::Operations::ListQueueItemsResponse)](../../models/operations/listqueueitemsresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------------------------- | ------------------------------------- | ------------------------------------- | +| Models::Errors::BadRequestError | 400 | application/json | +| Models::Errors::AuthenticationError | 401 | application/json | +| Models::Errors::PermissionDeniedError | 403 | application/json | +| Models::Errors::NotFoundError | 404 | application/json | +| Models::Errors::RateLimitError | 429 | application/json | +| Models::Errors::InternalServerError | 500 | application/json | +| Errors::APIError | 4XX, 5XX | \*/\* | + +## resolve + +Mark a queue item as resolved with a specific moderation action + +### Example Usage + + +```ruby +require 'moderation_api' + +Models = ::ModerationApi::Models +s = ::ModerationApi::ModerationApi.new( + secret_key: '' +) +res = s.queue.items.resolve(id: '', item_id: '', body: Models::Operations::ResolveQueueItemRequestBody.new( + comment: 'Reviewed: no violation.' +)) + +unless res.object.nil? + # handle response +end + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | +| `id` | *::String* | :heavy_check_mark: | The queue ID | +| `item_id` | *::String* | :heavy_check_mark: | The item ID to resolve | +| `body` | [Models::Operations::ResolveQueueItemRequestBody](../../models/operations/resolvequeueitemrequestbody.md) | :heavy_check_mark: | N/A | + +### Response + +**[T.nilable(Models::Operations::ResolveQueueItemResponse)](../../models/operations/resolvequeueitemresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------------------------- | ------------------------------------- | ------------------------------------- | +| Models::Errors::BadRequestError | 400 | application/json | +| Models::Errors::AuthenticationError | 401 | application/json | +| Models::Errors::PermissionDeniedError | 403 | application/json | +| Models::Errors::RateLimitError | 429 | application/json | +| Models::Errors::InternalServerError | 500 | application/json | +| Errors::APIError | 4XX, 5XX | \*/\* | + +## unresolve + +Mark a previously resolved queue item as unresolved/pending + +### Example Usage + + +```ruby +require 'moderation_api' + +Models = ::ModerationApi::Models +s = ::ModerationApi::ModerationApi.new( + secret_key: '' +) +res = s.queue.items.unresolve(id: '', item_id: '', body: Models::Operations::UnresolveQueueItemRequestBody.new( + comment: 'Reopened after an appeal.' +)) + +unless res.object.nil? + # handle response +end + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | +| `id` | *::String* | :heavy_check_mark: | The queue ID | +| `item_id` | *::String* | :heavy_check_mark: | The item ID to unresolve | +| `body` | [Models::Operations::UnresolveQueueItemRequestBody](../../models/operations/unresolvequeueitemrequestbody.md) | :heavy_check_mark: | N/A | + +### Response + +**[T.nilable(Models::Operations::UnresolveQueueItemResponse)](../../models/operations/unresolvequeueitemresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------------------------- | ------------------------------------- | ------------------------------------- | +| Models::Errors::BadRequestError | 400 | application/json | +| Models::Errors::AuthenticationError | 401 | application/json | +| Models::Errors::PermissionDeniedError | 403 | application/json | +| Models::Errors::RateLimitError | 429 | application/json | +| Models::Errors::InternalServerError | 500 | application/json | +| Errors::APIError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/projects/README.md b/docs/sdks/projects/README.md new file mode 100644 index 00000000..3824f56a --- /dev/null +++ b/docs/sdks/projects/README.md @@ -0,0 +1,272 @@ +# Projects + +## Overview + +### Available Operations + +* [list](#list) - List projects +* [create](#create) - Create a project +* [retrieve](#retrieve) - Get a project +* [update](#update) - Update a project +* [delete](#delete) - Delete a project +* [duplicate](#duplicate) - Duplicate a project + +## list + +List the projects in the organization. The list is paginated. Needs the `projects:read` permission. + +### Example Usage + + +```ruby +require 'moderation_api' + +Models = ::ModerationApi::Models +s = ::ModerationApi::ModerationApi.new( + secret_key: '' +) +res = s.projects.list(page: 1, page_size: 20) + +unless res.object.nil? + # handle response +end + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------- | ---------------------- | ---------------------- | ---------------------- | +| `page` | *T.nilable(::Integer)* | :heavy_minus_sign: | N/A | +| `page_size` | *T.nilable(::Integer)* | :heavy_minus_sign: | N/A | + +### Response + +**[T.nilable(Models::Operations::ListProjectsResponse)](../../models/operations/listprojectsresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------------------------- | ------------------------------------- | ------------------------------------- | +| Models::Errors::AuthenticationError | 401 | application/json | +| Models::Errors::PermissionDeniedError | 403 | application/json | +| Models::Errors::RateLimitError | 429 | application/json | +| Errors::APIError | 4XX, 5XX | \*/\* | + +## create + +Create a project with one channel, a review queue inbox and a secret API key. Give a domain or context and the project suggests policies for the platform. Needs the `projects:write` permission and a key that reaches all projects. + +### Example Usage + + +```ruby +require 'moderation_api' + +Models = ::ModerationApi::Models +s = ::ModerationApi::ModerationApi.new( + secret_key: '' +) + +req = Models::Operations::CreateProjectRequest.new( + name: '' +) +res = s.projects.create(request: req) + +unless res.project_with_key.nil? + # handle response +end + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | +| `request` | [Models::Operations::CreateProjectRequest](../../models/operations/createprojectrequest.md) | :heavy_check_mark: | The request object to use for the request. | + +### Response + +**[T.nilable(Models::Operations::CreateProjectResponse)](../../models/operations/createprojectresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------------------------- | ------------------------------------- | ------------------------------------- | +| Models::Errors::BadRequestError | 400 | application/json | +| Models::Errors::AuthenticationError | 401 | application/json | +| Models::Errors::PermissionDeniedError | 403 | application/json | +| Models::Errors::RateLimitError | 429 | application/json | +| Errors::APIError | 4XX, 5XX | \*/\* | + +## retrieve + +Get a project by ID. Needs the `projects:read` permission. + +### Example Usage + + +```ruby +require 'moderation_api' + +Models = ::ModerationApi::Models +s = ::ModerationApi::ModerationApi.new( + secret_key: '' +) +res = s.projects.retrieve(id: '') + +unless res.project.nil? + # handle response +end + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------- | ---------------------- | ---------------------- | ---------------------- | +| `id` | *::String* | :heavy_check_mark: | The ID of the project. | + +### Response + +**[T.nilable(Models::Operations::GetProjectResponse)](../../models/operations/getprojectresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------------------------- | ------------------------------------- | ------------------------------------- | +| Models::Errors::AuthenticationError | 401 | application/json | +| Models::Errors::PermissionDeniedError | 403 | application/json | +| Models::Errors::NotFoundError | 404 | application/json | +| Models::Errors::RateLimitError | 429 | application/json | +| Errors::APIError | 4XX, 5XX | \*/\* | + +## update + +Update a project. Fields you leave out keep their value. Needs the `projects:write` permission. + +### Example Usage + + +```ruby +require 'moderation_api' + +Models = ::ModerationApi::Models +s = ::ModerationApi::ModerationApi.new( + secret_key: '' +) +res = s.projects.update(id: '', body: Models::Operations::UpdateProjectRequestBody.new) + +unless res.project.nil? + # handle response +end + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | +| `id` | *::String* | :heavy_check_mark: | The ID of the project to update. | +| `body` | [Models::Operations::UpdateProjectRequestBody](../../models/operations/updateprojectrequestbody.md) | :heavy_check_mark: | N/A | + +### Response + +**[T.nilable(Models::Operations::UpdateProjectResponse)](../../models/operations/updateprojectresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------------------------- | ------------------------------------- | ------------------------------------- | +| Models::Errors::BadRequestError | 400 | application/json | +| Models::Errors::AuthenticationError | 401 | application/json | +| Models::Errors::PermissionDeniedError | 403 | application/json | +| Models::Errors::NotFoundError | 404 | application/json | +| Models::Errors::RateLimitError | 429 | application/json | +| Errors::APIError | 4XX, 5XX | \*/\* | + +## delete + +Delete a project with everything in it: channels, queues, API keys and stored content. This can't be undone. The project's API keys stop working at once. Needs the `projects:write` permission. + +### Example Usage + + +```ruby +require 'moderation_api' + +Models = ::ModerationApi::Models +s = ::ModerationApi::ModerationApi.new( + secret_key: '' +) +res = s.projects.delete(id: '') + +unless res.object.nil? + # handle response +end + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------- | ---------------------- | ---------------------- | ---------------------- | +| `id` | *::String* | :heavy_check_mark: | The ID of the project. | + +### Response + +**[T.nilable(Models::Operations::DeleteProjectResponse)](../../models/operations/deleteprojectresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------------------------- | ------------------------------------- | ------------------------------------- | +| Models::Errors::AuthenticationError | 401 | application/json | +| Models::Errors::PermissionDeniedError | 403 | application/json | +| Models::Errors::NotFoundError | 404 | application/json | +| Models::Errors::RateLimitError | 429 | application/json | +| Errors::APIError | 4XX, 5XX | \*/\* | + +## duplicate + +Copy a project's configuration into a new project: its settings, every channel with its policies, rules and wordlists, its moderation actions and its review queues. The copy gets its own secret API key. Webhooks, integrations, API keys and content are not copied. Needs the `projects:write` permission and a key that reaches all projects. + +### Example Usage + + +```ruby +require 'moderation_api' + +Models = ::ModerationApi::Models +s = ::ModerationApi::ModerationApi.new( + secret_key: '' +) +res = s.projects.duplicate(id: '', body: Models::Operations::DuplicateProjectRequestBody.new) + +unless res.project_with_key.nil? + # handle response +end + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | +| `id` | *::String* | :heavy_check_mark: | The ID of the project to copy. | +| `body` | [Models::Operations::DuplicateProjectRequestBody](../../models/operations/duplicateprojectrequestbody.md) | :heavy_check_mark: | N/A | + +### Response + +**[T.nilable(Models::Operations::DuplicateProjectResponse)](../../models/operations/duplicateprojectresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------------------------- | ------------------------------------- | ------------------------------------- | +| Models::Errors::BadRequestError | 400 | application/json | +| Models::Errors::AuthenticationError | 401 | application/json | +| Models::Errors::PermissionDeniedError | 403 | application/json | +| Models::Errors::NotFoundError | 404 | application/json | +| Models::Errors::RateLimitError | 429 | application/json | +| Errors::APIError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/queue/README.md b/docs/sdks/queue/README.md new file mode 100644 index 00000000..16a04aab --- /dev/null +++ b/docs/sdks/queue/README.md @@ -0,0 +1,97 @@ +# Queue + +## Overview + +### Available Operations + +* [retrieve](#retrieve) - Get a queue +* [get_stats](#get_stats) - Get queue statistics + +## retrieve + +Get a queue + +### Example Usage + + +```ruby +require 'moderation_api' + +Models = ::ModerationApi::Models +s = ::ModerationApi::ModerationApi.new( + secret_key: '' +) +res = s.queue.retrieve(id: '') + +unless res.object.nil? + # handle response +end + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `id` | *::String* | :heavy_check_mark: | The queue ID | + +### Response + +**[T.nilable(Models::Operations::GetQueueResponse)](../../models/operations/getqueueresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------------------------- | ------------------------------------- | ------------------------------------- | +| Models::Errors::BadRequestError | 400 | application/json | +| Models::Errors::AuthenticationError | 401 | application/json | +| Models::Errors::PermissionDeniedError | 403 | application/json | +| Models::Errors::NotFoundError | 404 | application/json | +| Models::Errors::RateLimitError | 429 | application/json | +| Models::Errors::InternalServerError | 500 | application/json | +| Errors::APIError | 4XX, 5XX | \*/\* | + +## get_stats + +Get detailed statistics about a moderation queue including review times, action counts, and trends + +### Example Usage + + +```ruby +require 'moderation_api' + +Models = ::ModerationApi::Models +s = ::ModerationApi::ModerationApi.new( + secret_key: '' +) +res = s.queue.get_stats(id: '', within_days: 30) + +unless res.object.nil? + # handle response +end + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------- | ---------------------- | ---------------------- | ---------------------- | +| `id` | *::String* | :heavy_check_mark: | The queue ID | +| `within_days` | *T.nilable(::Integer)* | :heavy_minus_sign: | N/A | + +### Response + +**[T.nilable(Models::Operations::GetQueueStatsResponse)](../../models/operations/getqueuestatsresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------------------------- | ------------------------------------- | ------------------------------------- | +| Models::Errors::BadRequestError | 400 | application/json | +| Models::Errors::AuthenticationError | 401 | application/json | +| Models::Errors::PermissionDeniedError | 403 | application/json | +| Models::Errors::NotFoundError | 404 | application/json | +| Models::Errors::RateLimitError | 429 | application/json | +| Models::Errors::InternalServerError | 500 | application/json | +| Errors::APIError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/webhooks/README.md b/docs/sdks/webhooks/README.md new file mode 100644 index 00000000..e1f6561d --- /dev/null +++ b/docs/sdks/webhooks/README.md @@ -0,0 +1,227 @@ +# Webhooks + +## Overview + +### Available Operations + +* [list](#list) - List webhooks +* [create](#create) - Create a webhook +* [retrieve](#retrieve) - Get a webhook +* [update](#update) - Update a webhook +* [delete](#delete) - Delete a webhook + +## list + +List the webhooks of the project. The list is paginated. + +### Example Usage + + +```ruby +require 'moderation_api' + +Models = ::ModerationApi::Models +s = ::ModerationApi::ModerationApi.new( + secret_key: '' +) +res = s.webhooks.list(page: 1, page_size: 20) + +unless res.object.nil? + # handle response +end + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------- | ---------------------- | ---------------------- | ---------------------- | +| `page` | *T.nilable(::Integer)* | :heavy_minus_sign: | N/A | +| `page_size` | *T.nilable(::Integer)* | :heavy_minus_sign: | N/A | + +### Response + +**[T.nilable(Models::Operations::ListWebhooksResponse)](../../models/operations/listwebhooksresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ----------------------------------- | ----------------------------------- | ----------------------------------- | +| Models::Errors::AuthenticationError | 401 | application/json | +| Models::Errors::RateLimitError | 429 | application/json | +| Errors::APIError | 4XX, 5XX | \*/\* | + +## create + +Create a webhook subscribed to one or more event types. Deliveries use the v2 envelope and are signed with the project signing secret (see the signing secret endpoint). + +### Example Usage + + +```ruby +require 'moderation_api' + +Models = ::ModerationApi::Models +s = ::ModerationApi::ModerationApi.new( + secret_key: '' +) + +req = Models::Operations::CreateWebhookRequest.new( + name: 'Moderation events', + url: 'https://example.com/webhooks/moderation', + event_types: [ + Models::Operations::CreateWebhookEventTypeRequest::QUEUE_ITEM_REJECTED, + Models::Operations::CreateWebhookEventTypeRequest::AUTHOR_BLOCKED, + ] +) +res = s.webhooks.create(request: req) + +unless res.object.nil? + # handle response +end + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | +| `request` | [Models::Operations::CreateWebhookRequest](../../models/operations/createwebhookrequest.md) | :heavy_check_mark: | The request object to use for the request. | + +### Response + +**[T.nilable(Models::Operations::CreateWebhookResponse)](../../models/operations/createwebhookresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ----------------------------------- | ----------------------------------- | ----------------------------------- | +| Models::Errors::BadRequestError | 400 | application/json | +| Models::Errors::AuthenticationError | 401 | application/json | +| Models::Errors::RateLimitError | 429 | application/json | +| Errors::APIError | 4XX, 5XX | \*/\* | + +## retrieve + +Get a webhook by ID. + +### Example Usage + + +```ruby +require 'moderation_api' + +Models = ::ModerationApi::Models +s = ::ModerationApi::ModerationApi.new( + secret_key: '' +) +res = s.webhooks.retrieve(id: '') + +unless res.object.nil? + # handle response +end + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------- | ----------------------------- | ----------------------------- | ----------------------------- | +| `id` | *::String* | :heavy_check_mark: | The ID of the webhook to get. | + +### Response + +**[T.nilable(Models::Operations::GetWebhookResponse)](../../models/operations/getwebhookresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ----------------------------------- | ----------------------------------- | ----------------------------------- | +| Models::Errors::AuthenticationError | 401 | application/json | +| Models::Errors::NotFoundError | 404 | application/json | +| Models::Errors::RateLimitError | 429 | application/json | +| Errors::APIError | 4XX, 5XX | \*/\* | + +## update + +Update a webhook. Legacy v1 webhooks are read-only: delete them and create a new webhook instead. + +### Example Usage + + +```ruby +require 'moderation_api' + +Models = ::ModerationApi::Models +s = ::ModerationApi::ModerationApi.new( + secret_key: '' +) +res = s.webhooks.update(id: '', body: Models::Operations::UpdateWebhookRequestBody.new) + +unless res.object.nil? + # handle response +end + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | +| `id` | *::String* | :heavy_check_mark: | The ID of the webhook to update. | +| `body` | [Models::Operations::UpdateWebhookRequestBody](../../models/operations/updatewebhookrequestbody.md) | :heavy_check_mark: | N/A | + +### Response + +**[T.nilable(Models::Operations::UpdateWebhookResponse)](../../models/operations/updatewebhookresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ----------------------------------- | ----------------------------------- | ----------------------------------- | +| Models::Errors::BadRequestError | 400 | application/json | +| Models::Errors::AuthenticationError | 401 | application/json | +| Models::Errors::NotFoundError | 404 | application/json | +| Models::Errors::RateLimitError | 429 | application/json | +| Errors::APIError | 4XX, 5XX | \*/\* | + +## delete + +Delete a webhook. + +### Example Usage + + +```ruby +require 'moderation_api' + +Models = ::ModerationApi::Models +s = ::ModerationApi::ModerationApi.new( + secret_key: '' +) +res = s.webhooks.delete(id: '') + +unless res.object.nil? + # handle response +end + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------- | -------------------------------- | -------------------------------- | -------------------------------- | +| `id` | *::String* | :heavy_check_mark: | The ID of the webhook to delete. | + +### Response + +**[T.nilable(Models::Operations::DeleteWebhookResponse)](../../models/operations/deletewebhookresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ----------------------------------- | ----------------------------------- | ----------------------------------- | +| Models::Errors::AuthenticationError | 401 | application/json | +| Models::Errors::NotFoundError | 404 | application/json | +| Models::Errors::RateLimitError | 429 | application/json | +| Errors::APIError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/webhooksecret/README.md b/docs/sdks/webhooksecret/README.md new file mode 100644 index 00000000..10c749a6 --- /dev/null +++ b/docs/sdks/webhooksecret/README.md @@ -0,0 +1,41 @@ +# WebhookSecret + +## Overview + +### Available Operations + +* [retrieve](#retrieve) - Get the webhook signing secret + +## retrieve + +Get the signing secret used to sign webhook deliveries for this project, creating one if none exists yet. Verify deliveries by comparing the `modapi-signature` header to HMAC-SHA256(raw request body, secret) hex-encoded. + +### Example Usage + + +```ruby +require 'moderation_api' + +Models = ::ModerationApi::Models +s = ::ModerationApi::ModerationApi.new( + secret_key: '' +) +res = s.webhook_secret.retrieve + +unless res.object.nil? + # handle response +end + +``` + +### Response + +**[T.nilable(Models::Operations::GetWebhookSecretResponse)](../../models/operations/getwebhooksecretresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ----------------------------------- | ----------------------------------- | ----------------------------------- | +| Models::Errors::AuthenticationError | 401 | application/json | +| Models::Errors::RateLimitError | 429 | application/json | +| Errors::APIError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/wordlist/README.md b/docs/sdks/wordlist/README.md new file mode 100644 index 00000000..3ab97d7e --- /dev/null +++ b/docs/sdks/wordlist/README.md @@ -0,0 +1,186 @@ +# Wordlist + +## Overview + +### Available Operations + +* [list](#list) - List wordlists +* [retrieve](#retrieve) - Get wordlist +* [update](#update) - Update wordlist +* [get_embedding_status](#get_embedding_status) - Get embedding status + +## list + +List the wordlists of the organization. The list is paginated. + +### Example Usage + + +```ruby +require 'moderation_api' + +Models = ::ModerationApi::Models +s = ::ModerationApi::ModerationApi.new( + secret_key: '' +) +res = s.wordlist.list(page: 1, page_size: 20) + +unless res.object.nil? + # handle response +end + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------- | ---------------------- | ---------------------- | ---------------------- | +| `page` | *T.nilable(::Integer)* | :heavy_minus_sign: | N/A | +| `page_size` | *T.nilable(::Integer)* | :heavy_minus_sign: | N/A | + +### Response + +**[T.nilable(Models::Operations::ListWordlistsResponse)](../../models/operations/listwordlistsresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------------------------- | ------------------------------------- | ------------------------------------- | +| Models::Errors::BadRequestError | 400 | application/json | +| Models::Errors::AuthenticationError | 401 | application/json | +| Models::Errors::PermissionDeniedError | 403 | application/json | +| Models::Errors::NotFoundError | 404 | application/json | +| Models::Errors::RateLimitError | 429 | application/json | +| Models::Errors::InternalServerError | 500 | application/json | +| Errors::APIError | 4XX, 5XX | \*/\* | + +## retrieve + +Get a specific wordlist by ID + +### Example Usage + + +```ruby +require 'moderation_api' + +Models = ::ModerationApi::Models +s = ::ModerationApi::ModerationApi.new( + secret_key: '' +) +res = s.wordlist.retrieve(id: '') + +unless res.object.nil? + # handle response +end + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------- | ------------------------- | ------------------------- | ------------------------- | +| `id` | *::String* | :heavy_check_mark: | ID of the wordlist to get | + +### Response + +**[T.nilable(Models::Operations::GetWordlistResponse)](../../models/operations/getwordlistresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------------------------- | ------------------------------------- | ------------------------------------- | +| Models::Errors::BadRequestError | 400 | application/json | +| Models::Errors::AuthenticationError | 401 | application/json | +| Models::Errors::PermissionDeniedError | 403 | application/json | +| Models::Errors::NotFoundError | 404 | application/json | +| Models::Errors::RateLimitError | 429 | application/json | +| Models::Errors::InternalServerError | 500 | application/json | +| Errors::APIError | 4XX, 5XX | \*/\* | + +## update + +Update a wordlist + +### Example Usage + + +```ruby +require 'moderation_api' + +Models = ::ModerationApi::Models +s = ::ModerationApi::ModerationApi.new( + secret_key: '' +) +res = s.wordlist.update(id: '', body: Models::Operations::UpdateWordlistRequestBody.new) + +unless res.object.nil? + # handle response +end + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | +| `id` | *::String* | :heavy_check_mark: | ID of the wordlist to update | +| `body` | [Models::Operations::UpdateWordlistRequestBody](../../models/operations/updatewordlistrequestbody.md) | :heavy_check_mark: | N/A | + +### Response + +**[T.nilable(Models::Operations::UpdateWordlistResponse)](../../models/operations/updatewordlistresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ----------------------------------- | ----------------------------------- | ----------------------------------- | +| Models::Errors::BadRequestError | 400 | application/json | +| Models::Errors::AuthenticationError | 401 | application/json | +| Models::Errors::NotFoundError | 404 | application/json | +| Models::Errors::RateLimitError | 429 | application/json | +| Errors::APIError | 4XX, 5XX | \*/\* | + +## get_embedding_status + +Get the current embedding progress status for a wordlist + +### Example Usage + + +```ruby +require 'moderation_api' + +Models = ::ModerationApi::Models +s = ::ModerationApi::ModerationApi.new( + secret_key: '' +) +res = s.wordlist.get_embedding_status(id: '') + +unless res.object.nil? + # handle response +end + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ | +| `id` | *::String* | :heavy_check_mark: | ID of the wordlist to check embedding status for | + +### Response + +**[T.nilable(Models::Operations::GetWordlistEmbeddingStatusResponse)](../../models/operations/getwordlistembeddingstatusresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------------------------- | ------------------------------------- | ------------------------------------- | +| Models::Errors::BadRequestError | 400 | application/json | +| Models::Errors::AuthenticationError | 401 | application/json | +| Models::Errors::PermissionDeniedError | 403 | application/json | +| Models::Errors::NotFoundError | 404 | application/json | +| Models::Errors::RateLimitError | 429 | application/json | +| Models::Errors::InternalServerError | 500 | application/json | +| Errors::APIError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/words/README.md b/docs/sdks/words/README.md new file mode 100644 index 00000000..05b9cd7b --- /dev/null +++ b/docs/sdks/words/README.md @@ -0,0 +1,103 @@ +# Wordlist.Words + +## Overview + +### Available Operations + +* [add](#add) - Add words to wordlist +* [remove](#remove) - Remove words from wordlist + +## add + +Add words to an existing wordlist + +### Example Usage + + +```ruby +require 'moderation_api' + +Models = ::ModerationApi::Models +s = ::ModerationApi::ModerationApi.new( + secret_key: '' +) +res = s.wordlist.words.add(id: '', body: Models::Operations::AddWordlistWordsRequestBody.new( + words: [ + 'free money', + 'click here', + ] +)) + +unless res.object.nil? + # handle response +end + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | +| `id` | *::String* | :heavy_check_mark: | ID of the wordlist to add words to | +| `body` | [Models::Operations::AddWordlistWordsRequestBody](../../models/operations/addwordlistwordsrequestbody.md) | :heavy_check_mark: | N/A | + +### Response + +**[T.nilable(Models::Operations::AddWordlistWordsResponse)](../../models/operations/addwordlistwordsresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ----------------------------------- | ----------------------------------- | ----------------------------------- | +| Models::Errors::BadRequestError | 400 | application/json | +| Models::Errors::AuthenticationError | 401 | application/json | +| Models::Errors::NotFoundError | 404 | application/json | +| Models::Errors::RateLimitError | 429 | application/json | +| Errors::APIError | 4XX, 5XX | \*/\* | + +## remove + +Remove words from an existing wordlist + +### Example Usage + + +```ruby +require 'moderation_api' + +Models = ::ModerationApi::Models +s = ::ModerationApi::ModerationApi.new( + secret_key: '' +) +res = s.wordlist.words.remove(id: '', words: [ + '', + '', + '', +]) + +unless res.object.nil? + # handle response +end + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | +| `id` | *::String* | :heavy_check_mark: | ID of the wordlist to remove words from | +| `words` | T::Array<*::String*> | :heavy_check_mark: | Array of words to remove from the wordlist | + +### Response + +**[T.nilable(Models::Operations::RemoveWordlistWordsResponse)](../../models/operations/removewordlistwordsresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ----------------------------------- | ----------------------------------- | ----------------------------------- | +| Models::Errors::BadRequestError | 400 | application/json | +| Models::Errors::AuthenticationError | 401 | application/json | +| Models::Errors::NotFoundError | 404 | application/json | +| Models::Errors::RateLimitError | 429 | application/json | +| Errors::APIError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/examples/.keep b/examples/.keep deleted file mode 100644 index d8c73e93..00000000 --- a/examples/.keep +++ /dev/null @@ -1,4 +0,0 @@ -File generated from our OpenAPI spec by Stainless. - -This directory can be used to store example files demonstrating usage of this SDK. -It is ignored by Stainless code generation and its content (other than this keep file) won't be touched. \ No newline at end of file diff --git a/lib/crystalline.rb b/lib/crystalline.rb new file mode 100644 index 00000000..fac143e5 --- /dev/null +++ b/lib/crystalline.rb @@ -0,0 +1,13 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: false +# frozen_string_literal: true + +module Crystalline + autoload :MetadataFields, 'crystalline/metadata_fields' +end + + +require_relative 'crystalline/utils' +require_relative 'crystalline/module' +require_relative 'crystalline/types' diff --git a/lib/crystalline/enum.rbi b/lib/crystalline/enum.rbi new file mode 100644 index 00000000..1d178b58 --- /dev/null +++ b/lib/crystalline/enum.rbi @@ -0,0 +1,17 @@ +# typed: true + +module Crystalline + module Enum + mixes_in_class_methods(ClassMethods) + + module ClassMethods + def enums(&blk); end + def open!; end + def open?; end + def deserialize(val); end + end + + def serialize; end + def known?; end + end +end diff --git a/lib/crystalline/metadata_fields.rb b/lib/crystalline/metadata_fields.rb new file mode 100644 index 00000000..d12d9cc8 --- /dev/null +++ b/lib/crystalline/metadata_fields.rb @@ -0,0 +1,265 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: false +# frozen_string_literal: true + +module Crystalline + module MetadataFields + + class Field + attr_accessor :name, :type, :metadata + + def initialize(name, type, metadata) + @name = name + @type = type + @metadata = metadata + end + end + + module ClassMethods + + def fields + @__fields__ = [] if @__fields__.nil? + + @__fields__ + end + + def field(field_name, type, metadata = {}) + attr_accessor field_name + + fields << Field.new(field_name, type, metadata) + end + + def field_augmented? + true + end + + def unmarshal_single(field_type, value, format_metadata = nil) + decoder = format_metadata.fetch(:decoder, nil) + + # Delegate complex Crystalline types to unmarshal_json + if field_type.is_a?(Crystalline::DiscriminatedUnion) || + Crystalline::Utils.arr?(field_type) || + Crystalline::Utils.hash?(field_type) || + Crystalline::Utils.union?(field_type) + return Crystalline.unmarshal_json(value, field_type) + elsif field_type.instance_of?(Class) && field_type.include?(::Crystalline::MetadataFields) + return field_type.from_dict(value) + elsif field_type.to_s == 'Date' + return Date.parse(value) + elsif field_type.to_s == 'DateTime' + return DateTime.parse(value) + elsif field_type.to_s == 'Object' + if value.is_a?(::String) + trimmed = value.lstrip + if trimmed.start_with?('{') || trimmed.start_with?('[') + # rubocop:disable Lint/SuppressedException + begin + value = JSON.parse(value) + rescue TypeError, JSON::ParserError + end + # rubocop:enable Lint/SuppressedException + end + end + return value + elsif field_type.to_s == 'Float' + return value.to_f + + end + if decoder.nil? + value + else + decoder.call(value) + end + end + + def from_dict(d) + to_build = {} + + # Collect lookup keys for regular fields so we can identify additional properties later + known_keys = {} + additional_props_fields = [] + fields.each do |field| + format_metadata = field.metadata.fetch(:format_json, {}) + if format_metadata.fetch(:additional_properties, false) + additional_props_fields << field + else + lookup = format_metadata.fetch(:letter_case, nil).call + known_keys[lookup] = true + end + end + + # Process regular fields + (fields - additional_props_fields).each do |field| + key = field.name + format_metadata = field.metadata.fetch(:format_json, {}) + field_type = field.type + + lookup = format_metadata.fetch(:letter_case, nil).call + value = d[lookup] + if ::Crystalline::Utils.nilable? field_type + if value == 'null' + to_build[key] = nil + next + end + field_type = ::Crystalline::Utils.nilable_of(field_type) + end + + # If field is not nilable, and the value is not in the dict, raise a KeyError + raise KeyError, "key #{lookup} not found in hash" if value.nil? && !::Crystalline::Utils.nilable?(field.type) + # If field is nilable, and the value is not in the dict, just move to the next field + next if value.nil? + + if field_type.is_a?(Crystalline::DiscriminatedUnion) + to_build[key] = field_type.parse(value) + elsif Crystalline::Utils.arr? field_type + inner_type = Crystalline::Utils.arr_of(field_type) + unmarshalled_array = value.map { |f| unmarshal_single(inner_type, f, format_metadata) } + to_build[key] = unmarshalled_array + elsif Crystalline::Utils.hash? field_type + val_type = Crystalline::Utils.hash_of(field_type) + + # rubocop:disable Style/HashTransformValues + unmarshalled_hash = value.map { |k, v| [k, unmarshal_single(val_type, v, format_metadata)] }.to_h + # rubocop:enable Style/HashTransformValues + to_build[key] = unmarshalled_hash + elsif Crystalline::Utils.union? field_type + discriminator = field.metadata.fetch(:discriminator, nil) + discriminator_mapping = field.metadata.fetch(:discriminator_mapping, nil) + if !discriminator.nil? + discriminator_value = value.fetch(discriminator) + if !discriminator_mapping.nil? + # Use explicit mapping from discriminator value to type + type_to_deserialize = discriminator_mapping[discriminator_value] + else + # Fallback: try to match discriminator value against type name + type_to_deserialize = Crystalline::Utils.get_union_types(field_type).find { |t| t.name.split('::').last == discriminator_value } + end + to_build[key] = Crystalline.unmarshal_json(value, type_to_deserialize) + else + union_types = Crystalline::Utils.get_union_types(field_type) + union_types = union_types.sort_by { |klass| Crystalline.non_nilable_attr_count(klass) } + + if Crystalline.union_strategy == :populated_fields + to_build[key] = Crystalline.unmarshal_union_populated_fields(value, union_types) + else + union_types.each do |union_type| + begin + to_build[key] = Crystalline.unmarshal_json(value, union_type) + rescue TypeError + next + rescue NoMethodError + next + rescue KeyError + next + end + break + end + end + end + elsif field_type.instance_of?(Class) && field_type.include?(::Crystalline::MetadataFields) + to_build[key] = Crystalline.unmarshal_json(value, field_type) + else + to_build[key] = unmarshal_single(field_type, value, format_metadata) + end + end + + # Process additional properties fields: collect remaining keys from the dict + additional_props_fields.each do |field| + key = field.name + format_metadata = field.metadata.fetch(:format_json, {}) + field_type = field.type + + remaining = d.reject { |k, _| known_keys.key?(k) } + if remaining.empty? + next if ::Crystalline::Utils.nilable?(field.type) + + raise KeyError, 'no additional properties found in hash' + end + + inner_field_type = field_type + inner_field_type = ::Crystalline::Utils.nilable_of(inner_field_type) if ::Crystalline::Utils.nilable?(inner_field_type) + if Crystalline::Utils.hash?(inner_field_type) + val_type = Crystalline::Utils.hash_of(inner_field_type) + # rubocop:disable Style/HashTransformValues + to_build[key] = remaining.map { |k, v| [k, unmarshal_single(val_type, v, format_metadata)] }.to_h + # rubocop:enable Style/HashTransformValues + else + to_build[key] = remaining + end + end + + new(**to_build) + end + end + + def initialize + instance = allocate + fields.each { |mod| instance.singleton_class.include(mod) } + instance.send(:initialize) + end + + def self.included(base) + base.extend(ClassMethods) + end + + def fields + self.class.fields + end + + def field(field_name) + fields.each do |f| + return f if f.name == field_name + end + end + + def marshal_single(field) + if field.class.include? ::Crystalline::MetadataFields + field.to_dict + else + if ::Crystalline.needs_string_conversion field + ::Crystalline.json_encode field + else + field + end + end + end + + def to_dict + result = {} + fields.sort_by(&:name).each do |field| + format_json_meta = field.metadata[:format_json] + required = !format_json_meta.nil? && format_json_meta.include?(:required) + is_additional_props = !format_json_meta.nil? && format_json_meta.fetch(:additional_properties, false) + + if !format_json_meta.nil? && format_json_meta.include?(:letter_case) + key = format_json_meta[:letter_case].call(field.name) + else + key = field.name + end + + f = send(field.name) + next if f.nil? && !required + result[key] = nil if f.nil? && required + + # Flatten additional properties into the parent object + if is_additional_props && f.is_a?(::Hash) + f.each { |k, v| result[k] = marshal_single(v) } + elsif f.is_a? ::Array + result[key] = f.map { |o| marshal_single(o) } + elsif f.is_a? ::Hash + result[key] = f.transform_values { |v| marshal_single(v) } + else + result[key] = marshal_single(f) + end + end + result + end + + def to_json(*args) + JSON.generate(to_dict, *args) + end + end + + +end diff --git a/lib/crystalline/module.rb b/lib/crystalline/module.rb new file mode 100644 index 00000000..27e44456 --- /dev/null +++ b/lib/crystalline/module.rb @@ -0,0 +1,188 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: false +# frozen_string_literal: true + +module Crystalline + @union_strategy = :populated_fields + + class << self + attr_accessor :union_strategy + end + + def self.to_dict(complex) + if complex.is_a?(::Array) + complex.map { |v| Crystalline.to_dict(v) } + elsif complex.is_a?(::Hash) + complex.transform_values { |v| Crystalline.to_dict(v) } + elsif complex.respond_to?(:class) && complex.class.include?(::Crystalline::MetadataFields) + complex.to_dict + else + json_encode(complex, primitives: false) + end + end + + def self.needs_string_conversion(val) + val.class.respond_to?(:enums) || val.is_a?(DateTime) || val.nil? + end + + def self.to_json(complex) + JSON.dump(to_dict(complex)) + end + + def self.unmarshal_json(data, type) + if Crystalline::Utils.nilable?(type) + type = Crystalline::Utils.nilable_of(type) + end + + if type.is_a?(Crystalline::DiscriminatedUnion) + type.parse(data) + elsif type.instance_of?(Class) && type.include?(::Crystalline::MetadataFields) + type.from_dict(data) + elsif Crystalline::Utils.union?(type) + union_types = Crystalline::Utils.get_union_types(type) + union_types = union_types.sort_by { |klass| Crystalline.non_nilable_attr_count(klass) } + + if Crystalline.union_strategy == :populated_fields + Crystalline.unmarshal_union_populated_fields(data, union_types) + else + Crystalline.unmarshal_union_left_to_right(data, union_types) + end + elsif Crystalline::Utils.arr?(type) + data.map { |v| Crystalline.unmarshal_json(v, Crystalline::Utils.arr_of(type)) } + elsif Crystalline::Utils.hash?(type) + data.transform_values { |v| Crystalline.unmarshal_json(v, Crystalline::Utils.hash_of(type)) } + elsif Crystalline::Utils.nilable?(type) && data == "null" + nil + elsif Crystalline::Utils.boolean?(type) + Crystalline::Utils.to_boolean(data) + elsif type.is_a?(Class) && type < T::Enum + type.deserialize(data) + elsif type.is_a?(Class) && type.respond_to?(:enums) && type.respond_to?(:deserialize) + type.deserialize(data) + else + data + end + end + + def self.json_encode(val, primitives: true) + if val.class.respond_to?(:enums) + val.serialize + elsif val.is_a?(DateTime) + val.strftime("%Y-%m-%dT%H:%M:%S.%NZ").sub(/(\.\d*[1-9])0+Z\z/, "\\1Z").sub(/\.0+Z\z/, "Z") + elsif val.nil? + nil + elsif primitives + val.to_s + else + val + end + end + + def self.unmarshal_union_left_to_right(data, union_types) + union_types.each do |union_type| + return Crystalline.unmarshal_json(data, union_type) + rescue TypeError + next + rescue NoMethodError + next + rescue KeyError + next + end + + nil + end + + def self.unmarshal_union_populated_fields(data, union_types) + best_value = nil + best_matched = -1 + best_inexact = 0 + best_unmatched = 0 + + union_types.each do |union_type| + value = Crystalline.unmarshal_json(data, union_type) + matched, inexact, unmatched = count_matched_fields(value, data) + + if best_value.nil? || + matched > best_matched || + (matched == best_matched && inexact < best_inexact) || + (matched == best_matched && inexact == best_inexact && unmatched < best_unmatched) + best_value = value + best_matched = matched + best_inexact = inexact + best_unmatched = unmatched + end + + rescue TypeError + next + rescue NoMethodError + next + rescue KeyError + next + end + + best_value + end + + def self.count_matched_fields(value, raw_data) + matched = 0 + inexact = 0 + unmatched = 0 + + if value.is_a?(Crystalline::Unknown) + return [0, 0, 0] + elsif value.class.include?(::Crystalline::MetadataFields) + value.fields.each do |field| + format_metadata = field.metadata.fetch(:format_json, {}) + lookup = format_metadata.fetch(:letter_case, nil)&.call + field_val = value.send(field.name) + + if raw_data.is_a?(::Hash) && lookup && raw_data.key?(lookup) + if field_val.class.include?(::Crystalline::MetadataFields) && raw_data[lookup].is_a?(::Hash) + nested_matched, nested_inexact, nested_unmatched = count_matched_fields(field_val, raw_data[lookup]) + matched += nested_matched + inexact += nested_inexact + unmatched += nested_unmatched + else + matched += 1 + if field_val.respond_to?(:known?) && !field_val.known? + inexact += 1 + end + end + elsif !::Crystalline::Utils.nilable?(field.type) + unmatched += 1 + end + end + elsif value.is_a?(::Array) + matched = value.length + elsif value.is_a?(::Hash) + matched = value.length + else + matched = 1 + end + + [matched, inexact, unmatched] + end + + def self.non_nilable_attr_count(klass) + # somewhat sane sort ordering for Union deserialization. + # All Crystalline objects return the number of non-nilable fields + # All non-string primitives return 2 + # All arrays and hashes return 1 + # Strings return 0 (since any data can deserialize to a string, it should be our last attempt) + if klass.respond_to?(:fields) + return -1 * + klass.fields.count do |field| + !::Crystalline::Utils.nilable?(field.type) + end + else + if klass == String + return 0 + elsif klass.is_a?(T::Types::TypedArray) || klass.is_a?(T::Types::TypedHash) + return 1 + end + + return 2 + end + end +end diff --git a/lib/crystalline/types.rb b/lib/crystalline/types.rb new file mode 100644 index 00000000..1ff9d1c8 --- /dev/null +++ b/lib/crystalline/types.rb @@ -0,0 +1,170 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: false +# frozen_string_literal: true + +module Crystalline + class Array + attr_accessor :inner_type + + def initialize(inner_type) + @inner_type = inner_type + end + end + + class Hash + attr_accessor :key_type, :value_type + + def initialize(key_type, value_type) + @key_type = key_type + @value_type = value_type + end + end + + class Union + attr_accessor :types + + def initialize(*types) + @types = types + end + end + + class Nilable + attr_accessor :inner_type + + def initialize(inner_type) + @inner_type = inner_type + end + end + + class Boolean + end + + # Wraps an unrecognized payload from an open discriminated union. + # Produced when the discriminator value is missing, unknown, or schema validation fails. + class Unknown + attr_reader :raw + + def initialize(raw:) + @raw = raw + end + + def unknown? + true + end + end + + # Forward-compatible discriminated union parser. + # Known discriminator values are deserialized to their mapped types. + # Unknown or invalid payloads are captured as Crystalline::Unknown. + class DiscriminatedUnion + attr_reader :discriminator, :variants + + def initialize(discriminator, variants) + @discriminator = discriminator + @variants = variants + end + + def parse(payload) + unless payload.is_a?(::Hash) + return Unknown.new(raw: payload) + end + + disc_value = payload[@discriminator] + unless disc_value.is_a?(::String) + return Unknown.new(raw: payload) + end + + variant_type = @variants[disc_value] + unless variant_type + return Unknown.new(raw: payload) + end + + begin + Crystalline.unmarshal_json(payload, variant_type) + rescue StandardError + Unknown.new(raw: payload) + end + end + end + + def self.unknown?(value) + value.is_a?(Unknown) + end + + module Enum + def self.included(base) + base.extend(ClassMethods) + end + + def initialize(val) + if self.class.instance_methods(false).include?(:initialize) + super(val) + else + @val = val + end + end + + module ClassMethods + def enums(&blk) + @mapping = {} + + yield + constants(false).each do |const_name| + instance = const_get(const_name, false) + unless instance.is_a? self + raise 'Enum constants must be instances of the Enum class (e.g. `Foo = new`)' + end + @mapping[instance.serialize] = instance + end + end + + def open! + @open = true + end + + def open? + @open == true + end + + def deserialize(val) + if @mapping.include? val + @mapping[val] + elsif open? + new(val) + else + raise "Invalid value for enum: #{val}" + end + end + end + + def serialize + @val + end + + def to_s + serialize.to_s + end + + def inspect + "#<#{self.class} #{serialize.inspect}>" + end + + def known? + self.class.instance_variable_get(:@mapping)&.value?(self) || false + end + + def ==(other) + other = other.serialize if other.is_a?(self.class) + @val == other + end + + def eql?(other) + self == other + end + + def hash + @val.hash + end + end +end diff --git a/lib/crystalline/utils.rb b/lib/crystalline/utils.rb new file mode 100644 index 00000000..2ed83f43 --- /dev/null +++ b/lib/crystalline/utils.rb @@ -0,0 +1,69 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: false +# frozen_string_literal: true + +module Crystalline + module Utils + def self.arr?(t) + if t.instance_of? Crystalline::Array + return true + end + false + end + + def self.arr_of(t) + t.inner_type + end + + def self.hash?(t) + if t.instance_of? Crystalline::Hash + return true + end + false + end + + def self.hash_of(t) + t.value_type + end + + def self.nilable?(t) + if t.instance_of? Crystalline::Nilable + return true + end + if t.instance_of? Crystalline::Union + return t.types.any? { |tt| tt.instance_of? Crystalline::Nilable } + end + false + end + + def self.nilable_of(t) + + if nilable? t + return t.inner_type + end + nil + end + + def self.union?(t) + return t.instance_of? Crystalline::Union + end + + def self.get_union_types(t) + t.types + end + + def self.boolean?(t) + t.instance_of? Crystalline::Boolean + end + + def self.to_boolean(value) + case value + when true, false + value + else + raise TypeError, "Cannot convert #{value.inspect} to boolean. The value is of type #{value.class}" + end + end + end +end diff --git a/lib/moderation_api.rb b/lib/moderation_api.rb index 4b4f4b13..d3e4c44a 100644 --- a/lib/moderation_api.rb +++ b/lib/moderation_api.rb @@ -1,135 +1,37 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true # frozen_string_literal: true -# Standard libraries. -# rubocop:disable Lint/RedundantRequireStatement -require "English" -require "base64" -require "cgi" -require "date" -require "erb" -require "etc" -require "json" -require "net/http" -require "openssl" -require "pathname" -require "rbconfig" -require "securerandom" -require "set" -require "stringio" -require "time" -require "uri" -# rubocop:enable Lint/RedundantRequireStatement +module ModerationApi + autoload :ModerationApi, "moderation_api/moderationapi" + autoload :Authors, "moderation_api/authors" + autoload :Queue, "moderation_api/queue" + autoload :Items, "moderation_api/items" + autoload :Actions, "moderation_api/actions" + autoload :Webhooks, "moderation_api/webhooks" + autoload :WebhookSecret, "moderation_api/webhooksecret" + autoload :Account, "moderation_api/account" + autoload :Wordlist, "moderation_api/wordlist" + autoload :Words, "moderation_api/words" + autoload :Content, "moderation_api/content" + autoload :Projects, "moderation_api/projects" + autoload :Channels, "moderation_api/channels" -# We already ship the preferred sorbet manifests in the package itself. -# `tapioca` currently does not offer us a way to opt out of unnecessary compilation. -if Object.const_defined?(:Tapioca) && - caller.chain([$PROGRAM_NAME]).chain(ARGV).any?(/tapioca/) && - ARGV.none?(/dsl/) - return + module Models + autoload :Components, "moderation_api/models/components" + autoload :Operations, "moderation_api/models/operations" + autoload :Errors, "moderation_api/models/errors" + autoload :Callbacks, "moderation_api/models/callbacks" + end end -# Gems. -require "connection_pool" - -# Package files. -require_relative "moderation_api/version" -require_relative "moderation_api/internal/util" -require_relative "moderation_api/internal/type/converter" -require_relative "moderation_api/internal/type/unknown" -require_relative "moderation_api/internal/type/boolean" -require_relative "moderation_api/internal/type/file_input" -require_relative "moderation_api/internal/type/enum" -require_relative "moderation_api/internal/type/union" -require_relative "moderation_api/internal/type/array_of" -require_relative "moderation_api/internal/type/hash_of" -require_relative "moderation_api/internal/type/base_model" -require_relative "moderation_api/internal/type/base_page" -require_relative "moderation_api/internal/type/request_parameters" -require_relative "moderation_api/internal" -require_relative "moderation_api/request_options" -require_relative "moderation_api/file_part" -require_relative "moderation_api/errors" -require_relative "moderation_api/internal/transport/base_client" -require_relative "moderation_api/internal/transport/pooled_net_requester" -require_relative "moderation_api/client" -require_relative "moderation_api/models/account_list_params" -require_relative "moderation_api/models/account_list_response" -require_relative "moderation_api/models/action_create_params" -require_relative "moderation_api/models/action_create_response" -require_relative "moderation_api/models/action_delete_params" -require_relative "moderation_api/models/action_delete_response" -require_relative "moderation_api/models/action_list_params" -require_relative "moderation_api/models/action_list_response" -require_relative "moderation_api/models/action_retrieve_params" -require_relative "moderation_api/models/action_retrieve_response" -require_relative "moderation_api/models/actions/execute_execute_by_id_params" -require_relative "moderation_api/models/actions/execute_execute_by_id_response" -require_relative "moderation_api/models/actions/execute_execute_params" -require_relative "moderation_api/models/actions/execute_execute_response" -require_relative "moderation_api/models/action_update_params" -require_relative "moderation_api/models/action_update_response" -require_relative "moderation_api/models/auth_create_params" -require_relative "moderation_api/models/auth_create_response" -require_relative "moderation_api/models/author_create_params" -require_relative "moderation_api/models/author_create_response" -require_relative "moderation_api/models/author_delete_params" -require_relative "moderation_api/models/author_delete_response" -require_relative "moderation_api/models/author_list_params" -require_relative "moderation_api/models/author_list_response" -require_relative "moderation_api/models/author_retrieve_params" -require_relative "moderation_api/models/author_retrieve_response" -require_relative "moderation_api/models/author_update_params" -require_relative "moderation_api/models/author_update_response" -require_relative "moderation_api/models/auth_retrieve_params" -require_relative "moderation_api/models/auth_retrieve_response" -require_relative "moderation_api/models/content_stream_params" -require_relative "moderation_api/models/content_submit_params" -require_relative "moderation_api/models/content_submit_response" -require_relative "moderation_api/models/queue/item_list_params" -require_relative "moderation_api/models/queue/item_list_response" -require_relative "moderation_api/models/queue/item_resolve_params" -require_relative "moderation_api/models/queue/item_resolve_response" -require_relative "moderation_api/models/queue/item_unresolve_params" -require_relative "moderation_api/models/queue/item_unresolve_response" -require_relative "moderation_api/models/queue_get_stats_params" -require_relative "moderation_api/models/queue_get_stats_response" -require_relative "moderation_api/models/queue_retrieve_params" -require_relative "moderation_api/models/queue_retrieve_response" -require_relative "moderation_api/models/webhook_create_params" -require_relative "moderation_api/models/webhook_create_response" -require_relative "moderation_api/models/webhook_delete_params" -require_relative "moderation_api/models/webhook_delete_response" -require_relative "moderation_api/models/webhook_event" -require_relative "moderation_api/models/webhook_list_params" -require_relative "moderation_api/models/webhook_list_response" -require_relative "moderation_api/models/webhook_retrieve_params" -require_relative "moderation_api/models/webhook_retrieve_response" -require_relative "moderation_api/models/webhook_secret_retrieve_params" -require_relative "moderation_api/models/webhook_secret_retrieve_response" -require_relative "moderation_api/models/webhook_update_params" -require_relative "moderation_api/models/webhook_update_response" -require_relative "moderation_api/models/wordlist/word_add_params" -require_relative "moderation_api/models/wordlist/word_add_response" -require_relative "moderation_api/models/wordlist/word_remove_params" -require_relative "moderation_api/models/wordlist/word_remove_response" -require_relative "moderation_api/models/wordlist_get_embedding_status_params" -require_relative "moderation_api/models/wordlist_get_embedding_status_response" -require_relative "moderation_api/models/wordlist_list_params" -require_relative "moderation_api/models/wordlist_list_response" -require_relative "moderation_api/models/wordlist_retrieve_params" -require_relative "moderation_api/models/wordlist_retrieve_response" -require_relative "moderation_api/models/wordlist_update_params" -require_relative "moderation_api/models/wordlist_update_response" -require_relative "moderation_api/models" -require_relative "moderation_api/resources/account" -require_relative "moderation_api/resources/actions" -require_relative "moderation_api/resources/actions/execute" -require_relative "moderation_api/resources/auth" -require_relative "moderation_api/resources/authors" -require_relative "moderation_api/resources/content" -require_relative "moderation_api/resources/queue" -require_relative "moderation_api/resources/queue/items" -require_relative "moderation_api/resources/webhooks" -require_relative "moderation_api/resources/webhook_secret" -require_relative "moderation_api/resources/wordlist" -require_relative "moderation_api/resources/wordlist/words" +require_relative "moderation_api/utils/utils" +require_relative "moderation_api/utils/request_bodies" +require_relative "moderation_api/utils/query_params" +require_relative "moderation_api/utils/forms" +require_relative "moderation_api/utils/headers" +require_relative "moderation_api/utils/url" +require_relative "moderation_api/utils/security" +require_relative "crystalline" +require_relative "moderation_api/sdkconfiguration" diff --git a/lib/moderation_api/account.rb b/lib/moderation_api/account.rb new file mode 100644 index 00000000..ed9163f4 --- /dev/null +++ b/lib/moderation_api/account.rb @@ -0,0 +1,221 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +require "faraday" +require "faraday/multipart" +require "faraday/retry" +require "sorbet-runtime" + +require_relative "sdk_hooks/hooks" +require_relative "utils/retries" + +module ModerationApi + extend T::Sig + + class Account + extend T::Sig + + sig { params(sdk_config: SDKConfiguration).void } + def initialize(sdk_config) + @sdk_configuration = sdk_config + end + + sig { params(base_url: String, url_variables: T.nilable(T::Hash[Symbol, T.any(String, T::Enum)])).returns(String) } + def get_url(base_url:, url_variables: nil) + sd_base_url, sd_options = @sdk_configuration.get_server_details + + if base_url.nil? + base_url = sd_base_url + end + + if url_variables.nil? + url_variables = sd_options + end + + return Utils.template_url(base_url, url_variables) + end + + sig { + params(timeout_ms: T.nilable(Integer), http_headers: T.nilable(T::Hash[T.any(String, Symbol), String])).returns( + Models::Operations::GetAccountResponse + ) + } + def retrieve(timeout_ms: nil, http_headers: nil) + # retrieve - Get account details + # Get account details + url, params = @sdk_configuration.get_server_details + base_url = Utils.template_url(url, params) + url = "#{base_url}/account" + headers = {} + headers = T.cast(headers, T::Hash[String, String]) + headers["Accept"] = "application/json" + headers["user-agent"] = @sdk_configuration.user_agent + + security = @sdk_configuration.security_source&.call + + timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil? + timeout ||= @sdk_configuration.timeout + + connection = @sdk_configuration.client + + hook_ctx = SDKHooks::HookContext.new( + config: @sdk_configuration, + base_url: base_url, + oauth2_scopes: nil, + operation_id: "getAccount", + security_source: @sdk_configuration.security_source + ) + + error = T.let(nil, T.nilable(StandardError)) + http_response = T.let(nil, T.nilable(Faraday::Response)) + + begin + http_response = T.must(connection).get(url) do |req| + req.headers.merge!(headers) + req.options.timeout = timeout unless timeout.nil? + Utils.configure_request_security(req, security) + http_headers&.each do |key, value| + req.headers[key.to_s] = value + end + + @sdk_configuration.hooks.before_request( + hook_ctx: SDKHooks::BeforeRequestHookContext.new( + hook_ctx: hook_ctx + ), + request: req + ) + end + + rescue StandardError => e + error = e + ensure + if http_response.nil? || Utils.error_status?(http_response.status) + http_response = @sdk_configuration.hooks.after_error( + error: error, + hook_ctx: SDKHooks::AfterErrorHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + else + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + end + + if http_response.nil? + raise error if !error.nil? + raise "no response" + end + end + + content_type = http_response.headers.fetch("Content-Type", "application/octet-stream") + if Utils.match_status_code(http_response.status, ["200"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Operations::GetAccountResponseBody) + response = Models::Operations::GetAccountResponse.new( + status_code: http_response.status, + content_type: content_type, + raw_response: http_response, + object: T.unsafe(obj) + ) + + return response + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["401"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::AuthenticationError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["429"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::RateLimitError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["4XX"]) + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "API error occurred" + ) + elsif Utils.match_status_code(http_response.status, ["5XX"]) + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "API error occurred" + ) + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown status code received" + ) + + end + end + end +end diff --git a/lib/moderation_api/actions.rb b/lib/moderation_api/actions.rb new file mode 100644 index 00000000..1f750836 --- /dev/null +++ b/lib/moderation_api/actions.rb @@ -0,0 +1,1584 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +require "faraday" +require "faraday/multipart" +require "faraday/retry" +require "sorbet-runtime" +require "janeway" + +require_relative "sdk_hooks/hooks" +require_relative "utils/retries" + +module ModerationApi + extend T::Sig + + class Actions + extend T::Sig + + sig { params(sdk_config: SDKConfiguration).void } + def initialize(sdk_config) + @sdk_configuration = sdk_config + end + + sig { params(base_url: String, url_variables: T.nilable(T::Hash[Symbol, T.any(String, T::Enum)])).returns(String) } + def get_url(base_url:, url_variables: nil) + sd_base_url, sd_options = @sdk_configuration.get_server_details + + if base_url.nil? + base_url = sd_base_url + end + + if url_variables.nil? + url_variables = sd_options + end + + return Utils.template_url(base_url, url_variables) + end + + sig { + params( + queue_id: T.nilable(::String), + page: T.nilable(::Integer), + page_size: T.nilable(::Integer), + timeout_ms: T.nilable(Integer), + http_headers: T.nilable(T::Hash[T.any(String, Symbol), String]) + ) + .returns(Models::Operations::ListActionsResponse) + } + def list(queue_id: nil, page: nil, page_size: nil, timeout_ms: nil, http_headers: nil) + # list - List moderation actions + # List the moderation actions of the project. The list is paginated. + request = Models::Operations::ListActionsRequest.new( + queue_id: queue_id, + page: page, + page_size: page_size + ) + url, params = @sdk_configuration.get_server_details + base_url = Utils.template_url(url, params) + url = "#{base_url}/actions" + headers = {} + headers = T.cast(headers, T::Hash[String, String]) + query_params = Utils.get_query_params(Models::Operations::ListActionsRequest, request, nil) + headers["Accept"] = "application/json" + headers["user-agent"] = @sdk_configuration.user_agent + + security = @sdk_configuration.security_source&.call + + timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil? + timeout ||= @sdk_configuration.timeout + + connection = @sdk_configuration.client + + hook_ctx = SDKHooks::HookContext.new( + config: @sdk_configuration, + base_url: base_url, + oauth2_scopes: nil, + operation_id: "listActions", + security_source: @sdk_configuration.security_source + ) + + error = T.let(nil, T.nilable(StandardError)) + http_response = T.let(nil, T.nilable(Faraday::Response)) + + begin + http_response = T.must(connection).get(url) do |req| + req.headers.merge!(headers) + req.options.timeout = timeout unless timeout.nil? + req.params = query_params + Utils.configure_request_security(req, security) + http_headers&.each do |key, value| + req.headers[key.to_s] = value + end + + @sdk_configuration.hooks.before_request( + hook_ctx: SDKHooks::BeforeRequestHookContext.new( + hook_ctx: hook_ctx + ), + request: req + ) + end + + rescue StandardError => e + error = e + ensure + if http_response.nil? || Utils.error_status?(http_response.status) + http_response = @sdk_configuration.hooks.after_error( + error: error, + hook_ctx: SDKHooks::AfterErrorHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + else + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + end + + if http_response.nil? + raise error if !error.nil? + raise "no response" + end + end + + content_type = http_response.headers.fetch("Content-Type", "application/octet-stream") + if Utils.match_status_code(http_response.status, ["200"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Operations::ListActionsResponseBody) + response = Models::Operations::ListActionsResponse.new( + status_code: http_response.status, + content_type: content_type, + raw_response: http_response, + object: T.unsafe(obj) + ) + sdk = self + + response.next_page = proc do + request_page = T.must(!request.page.nil? ? request.page : 1) + next_page = request_page + 1 + num_pages = Janeway.enum_for("$.pagination.totalPages", JSON.parse(response_data)).search + if num_pages.nil? || num_pages[0] <= request_page + next nil + end + + if !response_data + next nil + end + + results = Janeway.enum_for("$.data", JSON.parse(response_data)).search + if results.is_a?(Array) + results = results[0] + end + + if results.count.zero? + next nil + end + + request_limit = !request.page_size.nil? ? request.page_size : 20 + if results.count < request_limit + next nil + end + + sdk.list( + queue_id: request.queue_id, + page: next_page, + page_size: request.page_size, + http_headers: http_headers + ) + end + + return response + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["400"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::BadRequestError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["401"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::AuthenticationError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["403"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::PermissionDeniedError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["404"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::NotFoundError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["429"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::RateLimitError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["500"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::InternalServerError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["4XX"]) + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "API error occurred" + ) + elsif Utils.match_status_code(http_response.status, ["5XX"]) + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "API error occurred" + ) + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown status code received" + ) + + end + end + + sig { + params( + request: Models::Operations::CreateActionRequest, + timeout_ms: T.nilable(Integer), + http_headers: T.nilable(T::Hash[T.any(String, Symbol), String]) + ) + .returns(Models::Operations::CreateActionResponse) + } + def create(request:, timeout_ms: nil, http_headers: nil) + # create - Create an action + # Create an action. + url, params = @sdk_configuration.get_server_details + base_url = Utils.template_url(url, params) + url = "#{base_url}/actions" + headers = {} + headers = T.cast(headers, T::Hash[String, String]) + req_content_type, data, form = Utils.serialize_request_body(request, false, false, :request, :json) + headers["content-type"] = req_content_type + raise StandardError, "request body is required" if data.nil? && form.nil? + + if form && !form.empty? + body = Utils.encode_form(form) + elsif Utils.match_content_type(req_content_type, "application/x-www-form-urlencoded") + body = URI.encode_www_form(T.cast(data, T::Hash[Symbol, Object])) + else + body = data + end + + headers["Accept"] = "application/json" + headers["user-agent"] = @sdk_configuration.user_agent + + security = @sdk_configuration.security_source&.call + + timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil? + timeout ||= @sdk_configuration.timeout + + connection = @sdk_configuration.client + + hook_ctx = SDKHooks::HookContext.new( + config: @sdk_configuration, + base_url: base_url, + oauth2_scopes: nil, + operation_id: "createAction", + security_source: @sdk_configuration.security_source + ) + + error = T.let(nil, T.nilable(StandardError)) + http_response = T.let(nil, T.nilable(Faraday::Response)) + + begin + http_response = T.must(connection).post(url) do |req| + req.body = body + req.headers.merge!(headers) + req.options.timeout = timeout unless timeout.nil? + Utils.configure_request_security(req, security) + http_headers&.each do |key, value| + req.headers[key.to_s] = value + end + + @sdk_configuration.hooks.before_request( + hook_ctx: SDKHooks::BeforeRequestHookContext.new( + hook_ctx: hook_ctx + ), + request: req + ) + end + + rescue StandardError => e + error = e + ensure + if http_response.nil? || Utils.error_status?(http_response.status) + http_response = @sdk_configuration.hooks.after_error( + error: error, + hook_ctx: SDKHooks::AfterErrorHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + else + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + end + + if http_response.nil? + raise error if !error.nil? + raise "no response" + end + end + + content_type = http_response.headers.fetch("Content-Type", "application/octet-stream") + if Utils.match_status_code(http_response.status, ["200"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Operations::CreateActionResponseBody) + response = Models::Operations::CreateActionResponse.new( + status_code: http_response.status, + content_type: content_type, + raw_response: http_response, + object: T.unsafe(obj) + ) + + return response + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["400"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::BadRequestError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["401"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::AuthenticationError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["409"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::ConflictError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["429"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::RateLimitError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["4XX"]) + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "API error occurred" + ) + elsif Utils.match_status_code(http_response.status, ["5XX"]) + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "API error occurred" + ) + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown status code received" + ) + + end + end + + sig { + params( + id: ::String, + timeout_ms: T.nilable(Integer), + http_headers: T.nilable(T::Hash[T.any(String, Symbol), String]) + ) + .returns(Models::Operations::GetActionResponse) + } + def retrieve(id:, timeout_ms: nil, http_headers: nil) + # retrieve - Get an action + # Get an action by ID. + request = Models::Operations::GetActionRequest.new( + id: id + ) + url, params = @sdk_configuration.get_server_details + base_url = Utils.template_url(url, params) + url = Utils.generate_url( + Models::Operations::GetActionRequest, + base_url, + "/actions/{id}", + request + ) + headers = {} + headers = T.cast(headers, T::Hash[String, String]) + headers["Accept"] = "application/json" + headers["user-agent"] = @sdk_configuration.user_agent + + security = @sdk_configuration.security_source&.call + + timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil? + timeout ||= @sdk_configuration.timeout + + connection = @sdk_configuration.client + + hook_ctx = SDKHooks::HookContext.new( + config: @sdk_configuration, + base_url: base_url, + oauth2_scopes: nil, + operation_id: "getAction", + security_source: @sdk_configuration.security_source + ) + + error = T.let(nil, T.nilable(StandardError)) + http_response = T.let(nil, T.nilable(Faraday::Response)) + + begin + http_response = T.must(connection).get(url) do |req| + req.headers.merge!(headers) + req.options.timeout = timeout unless timeout.nil? + Utils.configure_request_security(req, security) + http_headers&.each do |key, value| + req.headers[key.to_s] = value + end + + @sdk_configuration.hooks.before_request( + hook_ctx: SDKHooks::BeforeRequestHookContext.new( + hook_ctx: hook_ctx + ), + request: req + ) + end + + rescue StandardError => e + error = e + ensure + if http_response.nil? || Utils.error_status?(http_response.status) + http_response = @sdk_configuration.hooks.after_error( + error: error, + hook_ctx: SDKHooks::AfterErrorHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + else + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + end + + if http_response.nil? + raise error if !error.nil? + raise "no response" + end + end + + content_type = http_response.headers.fetch("Content-Type", "application/octet-stream") + if Utils.match_status_code(http_response.status, ["200"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Operations::GetActionResponseBody) + response = Models::Operations::GetActionResponse.new( + status_code: http_response.status, + content_type: content_type, + raw_response: http_response, + object: T.unsafe(obj) + ) + + return response + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["400"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::BadRequestError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["401"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::AuthenticationError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["404"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::NotFoundError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["429"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::RateLimitError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["4XX"]) + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "API error occurred" + ) + elsif Utils.match_status_code(http_response.status, ["5XX"]) + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "API error occurred" + ) + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown status code received" + ) + + end + end + + sig { + params( + body: Models::Operations::UpdateActionRequestBody, + id: ::String, + timeout_ms: T.nilable(Integer), + http_headers: T.nilable(T::Hash[T.any(String, Symbol), String]) + ) + .returns(Models::Operations::UpdateActionResponse) + } + def update(body:, id:, timeout_ms: nil, http_headers: nil) + # update - Update an action + # Update an action. + request = Models::Operations::UpdateActionRequest.new( + id: id, + body: body + ) + url, params = @sdk_configuration.get_server_details + base_url = Utils.template_url(url, params) + url = Utils.generate_url( + Models::Operations::UpdateActionRequest, + base_url, + "/actions/{id}", + request + ) + headers = {} + headers = T.cast(headers, T::Hash[String, String]) + req_content_type, data, form = Utils.serialize_request_body(request, false, false, :body, :json) + headers["content-type"] = req_content_type + raise StandardError, "request body is required" if data.nil? && form.nil? + + if form && !form.empty? + body = Utils.encode_form(form) + elsif Utils.match_content_type(req_content_type, "application/x-www-form-urlencoded") + body = URI.encode_www_form(T.cast(data, T::Hash[Symbol, Object])) + else + body = data + end + + headers["Accept"] = "application/json" + headers["user-agent"] = @sdk_configuration.user_agent + + security = @sdk_configuration.security_source&.call + + timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil? + timeout ||= @sdk_configuration.timeout + + connection = @sdk_configuration.client + + hook_ctx = SDKHooks::HookContext.new( + config: @sdk_configuration, + base_url: base_url, + oauth2_scopes: nil, + operation_id: "updateAction", + security_source: @sdk_configuration.security_source + ) + + error = T.let(nil, T.nilable(StandardError)) + http_response = T.let(nil, T.nilable(Faraday::Response)) + + begin + http_response = T.must(connection).put(url) do |req| + req.body = body + req.headers.merge!(headers) + req.options.timeout = timeout unless timeout.nil? + Utils.configure_request_security(req, security) + http_headers&.each do |key, value| + req.headers[key.to_s] = value + end + + @sdk_configuration.hooks.before_request( + hook_ctx: SDKHooks::BeforeRequestHookContext.new( + hook_ctx: hook_ctx + ), + request: req + ) + end + + rescue StandardError => e + error = e + ensure + if http_response.nil? || Utils.error_status?(http_response.status) + http_response = @sdk_configuration.hooks.after_error( + error: error, + hook_ctx: SDKHooks::AfterErrorHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + else + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + end + + if http_response.nil? + raise error if !error.nil? + raise "no response" + end + end + + content_type = http_response.headers.fetch("Content-Type", "application/octet-stream") + if Utils.match_status_code(http_response.status, ["200"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Operations::UpdateActionResponseBody) + response = Models::Operations::UpdateActionResponse.new( + status_code: http_response.status, + content_type: content_type, + raw_response: http_response, + object: T.unsafe(obj) + ) + + return response + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["400"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::BadRequestError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["401"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::AuthenticationError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["404"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::NotFoundError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["409"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::ConflictError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["429"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::RateLimitError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["4XX"]) + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "API error occurred" + ) + elsif Utils.match_status_code(http_response.status, ["5XX"]) + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "API error occurred" + ) + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown status code received" + ) + + end + end + + sig { + params( + id: ::String, + timeout_ms: T.nilable(Integer), + http_headers: T.nilable(T::Hash[T.any(String, Symbol), String]) + ) + .returns(Models::Operations::DeleteActionResponse) + } + def delete(id:, timeout_ms: nil, http_headers: nil) + # delete - Delete an action + # Delete an action and all of its webhooks. + request = Models::Operations::DeleteActionRequest.new( + id: id + ) + url, params = @sdk_configuration.get_server_details + base_url = Utils.template_url(url, params) + url = Utils.generate_url( + Models::Operations::DeleteActionRequest, + base_url, + "/actions/{id}", + request + ) + headers = {} + headers = T.cast(headers, T::Hash[String, String]) + headers["Accept"] = "application/json" + headers["user-agent"] = @sdk_configuration.user_agent + + security = @sdk_configuration.security_source&.call + + timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil? + timeout ||= @sdk_configuration.timeout + + connection = @sdk_configuration.client + + hook_ctx = SDKHooks::HookContext.new( + config: @sdk_configuration, + base_url: base_url, + oauth2_scopes: nil, + operation_id: "deleteAction", + security_source: @sdk_configuration.security_source + ) + + error = T.let(nil, T.nilable(StandardError)) + http_response = T.let(nil, T.nilable(Faraday::Response)) + + begin + http_response = T.must(connection).delete(url) do |req| + req.headers.merge!(headers) + req.options.timeout = timeout unless timeout.nil? + Utils.configure_request_security(req, security) + http_headers&.each do |key, value| + req.headers[key.to_s] = value + end + + @sdk_configuration.hooks.before_request( + hook_ctx: SDKHooks::BeforeRequestHookContext.new( + hook_ctx: hook_ctx + ), + request: req + ) + end + + rescue StandardError => e + error = e + ensure + if http_response.nil? || Utils.error_status?(http_response.status) + http_response = @sdk_configuration.hooks.after_error( + error: error, + hook_ctx: SDKHooks::AfterErrorHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + else + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + end + + if http_response.nil? + raise error if !error.nil? + raise "no response" + end + end + + content_type = http_response.headers.fetch("Content-Type", "application/octet-stream") + if Utils.match_status_code(http_response.status, ["200"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Operations::DeleteActionResponseBody) + response = Models::Operations::DeleteActionResponse.new( + status_code: http_response.status, + content_type: content_type, + raw_response: http_response, + object: T.unsafe(obj) + ) + + return response + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["400"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::BadRequestError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["401"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::AuthenticationError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["404"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::NotFoundError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["429"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::RateLimitError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["4XX"]) + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "API error occurred" + ) + elsif Utils.match_status_code(http_response.status, ["5XX"]) + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "API error occurred" + ) + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown status code received" + ) + + end + end + + sig { + params( + request: Models::Operations::ExecuteActionRequest, + timeout_ms: T.nilable(Integer), + http_headers: T.nilable(T::Hash[T.any(String, Symbol), String]) + ) + .returns(Models::Operations::ExecuteActionResponse) + } + def execute(request:, timeout_ms: nil, http_headers: nil) + # execute - Execute moderation action + # Execute a moderation action on one or more content items. + url, params = @sdk_configuration.get_server_details + base_url = Utils.template_url(url, params) + url = "#{base_url}/actions/execute" + headers = {} + headers = T.cast(headers, T::Hash[String, String]) + req_content_type, data, form = Utils.serialize_request_body(request, false, false, :request, :json) + headers["content-type"] = req_content_type + raise StandardError, "request body is required" if data.nil? && form.nil? + + if form && !form.empty? + body = Utils.encode_form(form) + elsif Utils.match_content_type(req_content_type, "application/x-www-form-urlencoded") + body = URI.encode_www_form(T.cast(data, T::Hash[Symbol, Object])) + else + body = data + end + + headers["Accept"] = "application/json" + headers["user-agent"] = @sdk_configuration.user_agent + + security = @sdk_configuration.security_source&.call + + timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil? + timeout ||= @sdk_configuration.timeout + + connection = @sdk_configuration.client + + hook_ctx = SDKHooks::HookContext.new( + config: @sdk_configuration, + base_url: base_url, + oauth2_scopes: nil, + operation_id: "executeAction", + security_source: @sdk_configuration.security_source + ) + + error = T.let(nil, T.nilable(StandardError)) + http_response = T.let(nil, T.nilable(Faraday::Response)) + + begin + http_response = T.must(connection).post(url) do |req| + req.body = body + req.headers.merge!(headers) + req.options.timeout = timeout unless timeout.nil? + Utils.configure_request_security(req, security) + http_headers&.each do |key, value| + req.headers[key.to_s] = value + end + + @sdk_configuration.hooks.before_request( + hook_ctx: SDKHooks::BeforeRequestHookContext.new( + hook_ctx: hook_ctx + ), + request: req + ) + end + + rescue StandardError => e + error = e + ensure + if http_response.nil? || Utils.error_status?(http_response.status) + http_response = @sdk_configuration.hooks.after_error( + error: error, + hook_ctx: SDKHooks::AfterErrorHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + else + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + end + + if http_response.nil? + raise error if !error.nil? + raise "no response" + end + end + + content_type = http_response.headers.fetch("Content-Type", "application/octet-stream") + if Utils.match_status_code(http_response.status, ["200"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Operations::ExecuteActionResponseBody) + response = Models::Operations::ExecuteActionResponse.new( + status_code: http_response.status, + content_type: content_type, + raw_response: http_response, + object: T.unsafe(obj) + ) + + return response + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["400"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::BadRequestError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["401"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::AuthenticationError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["404"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::NotFoundError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["429"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::RateLimitError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["4XX"]) + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "API error occurred" + ) + elsif Utils.match_status_code(http_response.status, ["5XX"]) + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "API error occurred" + ) + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown status code received" + ) + + end + end + end +end diff --git a/lib/moderation_api/authors.rb b/lib/moderation_api/authors.rb new file mode 100644 index 00000000..73eb5e8c --- /dev/null +++ b/lib/moderation_api/authors.rb @@ -0,0 +1,1474 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +require "faraday" +require "faraday/multipart" +require "faraday/retry" +require "sorbet-runtime" +require "janeway" + +require_relative "sdk_hooks/hooks" +require_relative "utils/retries" + +module ModerationApi + extend T::Sig + + class Authors + extend T::Sig + + sig { params(sdk_config: SDKConfiguration).void } + def initialize(sdk_config) + @sdk_configuration = sdk_config + end + + sig { params(base_url: String, url_variables: T.nilable(T::Hash[Symbol, T.any(String, T::Enum)])).returns(String) } + def get_url(base_url:, url_variables: nil) + sd_base_url, sd_options = @sdk_configuration.get_server_details + + if base_url.nil? + base_url = sd_base_url + end + + if url_variables.nil? + url_variables = sd_options + end + + return Utils.template_url(base_url, url_variables) + end + + sig { + params( + request: Models::Operations::ListAuthorsRequest, + timeout_ms: T.nilable(Integer), + http_headers: T.nilable(T::Hash[T.any(String, Symbol), String]) + ) + .returns(Models::Operations::ListAuthorsResponse) + } + def list(request:, timeout_ms: nil, http_headers: nil) + # list - List authors + # List authors with their activity metrics and reputation. The list is paginated. + url, params = @sdk_configuration.get_server_details + base_url = Utils.template_url(url, params) + url = "#{base_url}/authors" + headers = {} + headers = T.cast(headers, T::Hash[String, String]) + query_params = Utils.get_query_params(Models::Operations::ListAuthorsRequest, request, nil) + headers["Accept"] = "application/json" + headers["user-agent"] = @sdk_configuration.user_agent + + security = @sdk_configuration.security_source&.call + + timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil? + timeout ||= @sdk_configuration.timeout + + connection = @sdk_configuration.client + + hook_ctx = SDKHooks::HookContext.new( + config: @sdk_configuration, + base_url: base_url, + oauth2_scopes: nil, + operation_id: "listAuthors", + security_source: @sdk_configuration.security_source + ) + + error = T.let(nil, T.nilable(StandardError)) + http_response = T.let(nil, T.nilable(Faraday::Response)) + + begin + http_response = T.must(connection).get(url) do |req| + req.headers.merge!(headers) + req.options.timeout = timeout unless timeout.nil? + req.params = query_params + Utils.configure_request_security(req, security) + http_headers&.each do |key, value| + req.headers[key.to_s] = value + end + + @sdk_configuration.hooks.before_request( + hook_ctx: SDKHooks::BeforeRequestHookContext.new( + hook_ctx: hook_ctx + ), + request: req + ) + end + + rescue StandardError => e + error = e + ensure + if http_response.nil? || Utils.error_status?(http_response.status) + http_response = @sdk_configuration.hooks.after_error( + error: error, + hook_ctx: SDKHooks::AfterErrorHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + else + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + end + + if http_response.nil? + raise error if !error.nil? + raise "no response" + end + end + + content_type = http_response.headers.fetch("Content-Type", "application/octet-stream") + if Utils.match_status_code(http_response.status, ["200"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Operations::ListAuthorsResponseBody) + response = Models::Operations::ListAuthorsResponse.new( + status_code: http_response.status, + content_type: content_type, + raw_response: http_response, + object: T.unsafe(obj) + ) + sdk = self + + response.next_page = proc do + request_page = T.must(!request.page.nil? ? request.page : 1) + next_page = request_page + 1 + num_pages = Janeway.enum_for("$.pagination.totalPages", JSON.parse(response_data)).search + if num_pages.nil? || num_pages[0] <= request_page + next nil + end + + if !response_data + next nil + end + + results = Janeway.enum_for("$.data", JSON.parse(response_data)).search + if results.is_a?(Array) + results = results[0] + end + + if results.count.zero? + next nil + end + + request_limit = !request.page_size.nil? ? request.page_size : 20 + if results.count < request_limit + next nil + end + + sdk.list( + request: Models::Operations::ListAuthorsRequest.new( + page: next_page, + page_size: request.page_size, + sort_by: request.sort_by, + sort_direction: request.sort_direction, + member_since_date: request.member_since_date, + last_active_date: request.last_active_date, + content_types: request.content_types + ), + http_headers: http_headers + ) + end + + return response + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["400"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::BadRequestError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["401"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::AuthenticationError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["403"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::PermissionDeniedError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["404"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::NotFoundError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["429"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::RateLimitError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["500"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::InternalServerError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["4XX"]) + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "API error occurred" + ) + elsif Utils.match_status_code(http_response.status, ["5XX"]) + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "API error occurred" + ) + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown status code received" + ) + + end + end + + sig { + params( + request: Models::Operations::CreateAuthorRequest, + timeout_ms: T.nilable(Integer), + http_headers: T.nilable(T::Hash[T.any(String, Symbol), String]) + ) + .returns(Models::Operations::CreateAuthorResponse) + } + def create(request:, timeout_ms: nil, http_headers: nil) + # create - Create a new author + # Create a new author. Typically not needed as authors are created automatically when content is moderated. + url, params = @sdk_configuration.get_server_details + base_url = Utils.template_url(url, params) + url = "#{base_url}/authors" + headers = {} + headers = T.cast(headers, T::Hash[String, String]) + req_content_type, data, form = Utils.serialize_request_body(request, false, false, :request, :json) + headers["content-type"] = req_content_type + raise StandardError, "request body is required" if data.nil? && form.nil? + + if form && !form.empty? + body = Utils.encode_form(form) + elsif Utils.match_content_type(req_content_type, "application/x-www-form-urlencoded") + body = URI.encode_www_form(T.cast(data, T::Hash[Symbol, Object])) + else + body = data + end + + headers["Accept"] = "application/json" + headers["user-agent"] = @sdk_configuration.user_agent + + security = @sdk_configuration.security_source&.call + + timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil? + timeout ||= @sdk_configuration.timeout + + connection = @sdk_configuration.client + + hook_ctx = SDKHooks::HookContext.new( + config: @sdk_configuration, + base_url: base_url, + oauth2_scopes: nil, + operation_id: "createAuthor", + security_source: @sdk_configuration.security_source + ) + + error = T.let(nil, T.nilable(StandardError)) + http_response = T.let(nil, T.nilable(Faraday::Response)) + + begin + http_response = T.must(connection).post(url) do |req| + req.body = body + req.headers.merge!(headers) + req.options.timeout = timeout unless timeout.nil? + Utils.configure_request_security(req, security) + http_headers&.each do |key, value| + req.headers[key.to_s] = value + end + + @sdk_configuration.hooks.before_request( + hook_ctx: SDKHooks::BeforeRequestHookContext.new( + hook_ctx: hook_ctx + ), + request: req + ) + end + + rescue StandardError => e + error = e + ensure + if http_response.nil? || Utils.error_status?(http_response.status) + http_response = @sdk_configuration.hooks.after_error( + error: error, + hook_ctx: SDKHooks::AfterErrorHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + else + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + end + + if http_response.nil? + raise error if !error.nil? + raise "no response" + end + end + + content_type = http_response.headers.fetch("Content-Type", "application/octet-stream") + if Utils.match_status_code(http_response.status, ["200"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Components::PublicAuthor) + response = Models::Operations::CreateAuthorResponse.new( + status_code: http_response.status, + content_type: content_type, + raw_response: http_response, + public_author: T.unsafe(obj) + ) + + return response + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["400"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::BadRequestError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["401"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::AuthenticationError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["403"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::PermissionDeniedError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["429"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::RateLimitError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["500"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::InternalServerError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["4XX"]) + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "API error occurred" + ) + elsif Utils.match_status_code(http_response.status, ["5XX"]) + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "API error occurred" + ) + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown status code received" + ) + + end + end + + sig { + params( + id: ::String, + timeout_ms: T.nilable(Integer), + http_headers: T.nilable(T::Hash[T.any(String, Symbol), String]) + ) + .returns(Models::Operations::GetAuthorResponse) + } + def retrieve(id:, timeout_ms: nil, http_headers: nil) + # retrieve - Get author details + # Get detailed information about a specific author including historical data and analysis + request = Models::Operations::GetAuthorRequest.new( + id: id + ) + url, params = @sdk_configuration.get_server_details + base_url = Utils.template_url(url, params) + url = Utils.generate_url( + Models::Operations::GetAuthorRequest, + base_url, + "/authors/{id}", + request + ) + headers = {} + headers = T.cast(headers, T::Hash[String, String]) + headers["Accept"] = "application/json" + headers["user-agent"] = @sdk_configuration.user_agent + + security = @sdk_configuration.security_source&.call + + timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil? + timeout ||= @sdk_configuration.timeout + + connection = @sdk_configuration.client + + hook_ctx = SDKHooks::HookContext.new( + config: @sdk_configuration, + base_url: base_url, + oauth2_scopes: nil, + operation_id: "getAuthor", + security_source: @sdk_configuration.security_source + ) + + error = T.let(nil, T.nilable(StandardError)) + http_response = T.let(nil, T.nilable(Faraday::Response)) + + begin + http_response = T.must(connection).get(url) do |req| + req.headers.merge!(headers) + req.options.timeout = timeout unless timeout.nil? + Utils.configure_request_security(req, security) + http_headers&.each do |key, value| + req.headers[key.to_s] = value + end + + @sdk_configuration.hooks.before_request( + hook_ctx: SDKHooks::BeforeRequestHookContext.new( + hook_ctx: hook_ctx + ), + request: req + ) + end + + rescue StandardError => e + error = e + ensure + if http_response.nil? || Utils.error_status?(http_response.status) + http_response = @sdk_configuration.hooks.after_error( + error: error, + hook_ctx: SDKHooks::AfterErrorHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + else + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + end + + if http_response.nil? + raise error if !error.nil? + raise "no response" + end + end + + content_type = http_response.headers.fetch("Content-Type", "application/octet-stream") + if Utils.match_status_code(http_response.status, ["200"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Components::PublicAuthor) + response = Models::Operations::GetAuthorResponse.new( + status_code: http_response.status, + content_type: content_type, + raw_response: http_response, + public_author: T.unsafe(obj) + ) + + return response + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["400"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::BadRequestError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["401"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::AuthenticationError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["403"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::PermissionDeniedError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["404"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::NotFoundError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["429"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::RateLimitError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["500"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::InternalServerError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["4XX"]) + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "API error occurred" + ) + elsif Utils.match_status_code(http_response.status, ["5XX"]) + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "API error occurred" + ) + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown status code received" + ) + + end + end + + sig { + params( + body: Models::Operations::UpdateAuthorRequestBody, + id: ::String, + timeout_ms: T.nilable(Integer), + http_headers: T.nilable(T::Hash[T.any(String, Symbol), String]) + ) + .returns(Models::Operations::UpdateAuthorResponse) + } + def update(body:, id:, timeout_ms: nil, http_headers: nil) + # update - Update author details + # Update the details of a specific author + request = Models::Operations::UpdateAuthorRequest.new( + id: id, + body: body + ) + url, params = @sdk_configuration.get_server_details + base_url = Utils.template_url(url, params) + url = Utils.generate_url( + Models::Operations::UpdateAuthorRequest, + base_url, + "/authors/{id}", + request + ) + headers = {} + headers = T.cast(headers, T::Hash[String, String]) + req_content_type, data, form = Utils.serialize_request_body(request, false, false, :body, :json) + headers["content-type"] = req_content_type + raise StandardError, "request body is required" if data.nil? && form.nil? + + if form && !form.empty? + body = Utils.encode_form(form) + elsif Utils.match_content_type(req_content_type, "application/x-www-form-urlencoded") + body = URI.encode_www_form(T.cast(data, T::Hash[Symbol, Object])) + else + body = data + end + + headers["Accept"] = "application/json" + headers["user-agent"] = @sdk_configuration.user_agent + + security = @sdk_configuration.security_source&.call + + timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil? + timeout ||= @sdk_configuration.timeout + + connection = @sdk_configuration.client + + hook_ctx = SDKHooks::HookContext.new( + config: @sdk_configuration, + base_url: base_url, + oauth2_scopes: nil, + operation_id: "updateAuthor", + security_source: @sdk_configuration.security_source + ) + + error = T.let(nil, T.nilable(StandardError)) + http_response = T.let(nil, T.nilable(Faraday::Response)) + + begin + http_response = T.must(connection).put(url) do |req| + req.body = body + req.headers.merge!(headers) + req.options.timeout = timeout unless timeout.nil? + Utils.configure_request_security(req, security) + http_headers&.each do |key, value| + req.headers[key.to_s] = value + end + + @sdk_configuration.hooks.before_request( + hook_ctx: SDKHooks::BeforeRequestHookContext.new( + hook_ctx: hook_ctx + ), + request: req + ) + end + + rescue StandardError => e + error = e + ensure + if http_response.nil? || Utils.error_status?(http_response.status) + http_response = @sdk_configuration.hooks.after_error( + error: error, + hook_ctx: SDKHooks::AfterErrorHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + else + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + end + + if http_response.nil? + raise error if !error.nil? + raise "no response" + end + end + + content_type = http_response.headers.fetch("Content-Type", "application/octet-stream") + if Utils.match_status_code(http_response.status, ["200"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Components::PublicAuthor) + response = Models::Operations::UpdateAuthorResponse.new( + status_code: http_response.status, + content_type: content_type, + raw_response: http_response, + public_author: T.unsafe(obj) + ) + + return response + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["400"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::BadRequestError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["401"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::AuthenticationError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["403"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::PermissionDeniedError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["404"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::NotFoundError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["429"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::RateLimitError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["500"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::InternalServerError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["4XX"]) + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "API error occurred" + ) + elsif Utils.match_status_code(http_response.status, ["5XX"]) + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "API error occurred" + ) + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown status code received" + ) + + end + end + + sig { + params( + id: ::String, + timeout_ms: T.nilable(Integer), + http_headers: T.nilable(T::Hash[T.any(String, Symbol), String]) + ) + .returns(Models::Operations::DeleteAuthorResponse) + } + def delete(id:, timeout_ms: nil, http_headers: nil) + # delete - Delete an author + # Delete a specific author. This resets the author: status, blocks, trust level, metrics and action history are removed. The author is created again with a clean record the next time content is moderated for the same ID. + request = Models::Operations::DeleteAuthorRequest.new( + id: id + ) + url, params = @sdk_configuration.get_server_details + base_url = Utils.template_url(url, params) + url = Utils.generate_url( + Models::Operations::DeleteAuthorRequest, + base_url, + "/authors/{id}", + request + ) + headers = {} + headers = T.cast(headers, T::Hash[String, String]) + headers["Accept"] = "application/json" + headers["user-agent"] = @sdk_configuration.user_agent + + security = @sdk_configuration.security_source&.call + + timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil? + timeout ||= @sdk_configuration.timeout + + connection = @sdk_configuration.client + + hook_ctx = SDKHooks::HookContext.new( + config: @sdk_configuration, + base_url: base_url, + oauth2_scopes: nil, + operation_id: "deleteAuthor", + security_source: @sdk_configuration.security_source + ) + + error = T.let(nil, T.nilable(StandardError)) + http_response = T.let(nil, T.nilable(Faraday::Response)) + + begin + http_response = T.must(connection).delete(url) do |req| + req.headers.merge!(headers) + req.options.timeout = timeout unless timeout.nil? + Utils.configure_request_security(req, security) + http_headers&.each do |key, value| + req.headers[key.to_s] = value + end + + @sdk_configuration.hooks.before_request( + hook_ctx: SDKHooks::BeforeRequestHookContext.new( + hook_ctx: hook_ctx + ), + request: req + ) + end + + rescue StandardError => e + error = e + ensure + if http_response.nil? || Utils.error_status?(http_response.status) + http_response = @sdk_configuration.hooks.after_error( + error: error, + hook_ctx: SDKHooks::AfterErrorHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + else + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + end + + if http_response.nil? + raise error if !error.nil? + raise "no response" + end + end + + content_type = http_response.headers.fetch("Content-Type", "application/octet-stream") + if Utils.match_status_code(http_response.status, ["200"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Operations::DeleteAuthorResponseBody) + response = Models::Operations::DeleteAuthorResponse.new( + status_code: http_response.status, + content_type: content_type, + raw_response: http_response, + object: T.unsafe(obj) + ) + + return response + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["400"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::BadRequestError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["401"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::AuthenticationError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["403"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::PermissionDeniedError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["404"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::NotFoundError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["429"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::RateLimitError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["500"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::InternalServerError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["4XX"]) + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "API error occurred" + ) + elsif Utils.match_status_code(http_response.status, ["5XX"]) + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "API error occurred" + ) + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown status code received" + ) + + end + end + end +end diff --git a/lib/moderation_api/channels.rb b/lib/moderation_api/channels.rb new file mode 100644 index 00000000..fe72569a --- /dev/null +++ b/lib/moderation_api/channels.rb @@ -0,0 +1,1631 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +require "faraday" +require "faraday/multipart" +require "faraday/retry" +require "sorbet-runtime" +require "janeway" + +require_relative "sdk_hooks/hooks" +require_relative "utils/retries" + +module ModerationApi + extend T::Sig + + class Channels + extend T::Sig + + sig { params(sdk_config: SDKConfiguration).void } + def initialize(sdk_config) + @sdk_configuration = sdk_config + end + + sig { params(base_url: String, url_variables: T.nilable(T::Hash[Symbol, T.any(String, T::Enum)])).returns(String) } + def get_url(base_url:, url_variables: nil) + sd_base_url, sd_options = @sdk_configuration.get_server_details + + if base_url.nil? + base_url = sd_base_url + end + + if url_variables.nil? + url_variables = sd_options + end + + return Utils.template_url(base_url, url_variables) + end + + sig { + params( + project_id: ::String, + page: T.nilable(::Integer), + page_size: T.nilable(::Integer), + timeout_ms: T.nilable(Integer), + http_headers: T.nilable(T::Hash[T.any(String, Symbol), String]) + ) + .returns(Models::Operations::ListChannelsResponse) + } + def list(project_id:, page: nil, page_size: nil, timeout_ms: nil, http_headers: nil) + # list - List channels + # List the channels in a project. The list is paginated. Needs the `channels:read` permission. + request = Models::Operations::ListChannelsRequest.new( + project_id: project_id, + page: page, + page_size: page_size + ) + url, params = @sdk_configuration.get_server_details + base_url = Utils.template_url(url, params) + url = Utils.generate_url( + Models::Operations::ListChannelsRequest, + base_url, + "/projects/{projectId}/channels", + request + ) + headers = {} + headers = T.cast(headers, T::Hash[String, String]) + query_params = Utils.get_query_params(Models::Operations::ListChannelsRequest, request, nil) + headers["Accept"] = "application/json" + headers["user-agent"] = @sdk_configuration.user_agent + + security = @sdk_configuration.security_source&.call + + timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil? + timeout ||= @sdk_configuration.timeout + + connection = @sdk_configuration.client + + hook_ctx = SDKHooks::HookContext.new( + config: @sdk_configuration, + base_url: base_url, + oauth2_scopes: nil, + operation_id: "listChannels", + security_source: @sdk_configuration.security_source + ) + + error = T.let(nil, T.nilable(StandardError)) + http_response = T.let(nil, T.nilable(Faraday::Response)) + + begin + http_response = T.must(connection).get(url) do |req| + req.headers.merge!(headers) + req.options.timeout = timeout unless timeout.nil? + req.params = query_params + Utils.configure_request_security(req, security) + http_headers&.each do |key, value| + req.headers[key.to_s] = value + end + + @sdk_configuration.hooks.before_request( + hook_ctx: SDKHooks::BeforeRequestHookContext.new( + hook_ctx: hook_ctx + ), + request: req + ) + end + + rescue StandardError => e + error = e + ensure + if http_response.nil? || Utils.error_status?(http_response.status) + http_response = @sdk_configuration.hooks.after_error( + error: error, + hook_ctx: SDKHooks::AfterErrorHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + else + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + end + + if http_response.nil? + raise error if !error.nil? + raise "no response" + end + end + + content_type = http_response.headers.fetch("Content-Type", "application/octet-stream") + if Utils.match_status_code(http_response.status, ["200"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Operations::ListChannelsResponseBody) + response = Models::Operations::ListChannelsResponse.new( + status_code: http_response.status, + content_type: content_type, + raw_response: http_response, + object: T.unsafe(obj) + ) + sdk = self + + response.next_page = proc do + request_page = T.must(!request.page.nil? ? request.page : 1) + next_page = request_page + 1 + num_pages = Janeway.enum_for("$.pagination.totalPages", JSON.parse(response_data)).search + if num_pages.nil? || num_pages[0] <= request_page + next nil + end + + if !response_data + next nil + end + + results = Janeway.enum_for("$.data", JSON.parse(response_data)).search + if results.is_a?(Array) + results = results[0] + end + + if results.count.zero? + next nil + end + + request_limit = !request.page_size.nil? ? request.page_size : 20 + if results.count < request_limit + next nil + end + + sdk.list( + project_id: request.project_id, + page: next_page, + page_size: request.page_size, + http_headers: http_headers + ) + end + + return response + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["401"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::AuthenticationError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["403"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::PermissionDeniedError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["404"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::NotFoundError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["429"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::RateLimitError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["4XX"]) + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "API error occurred" + ) + elsif Utils.match_status_code(http_response.status, ["5XX"]) + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "API error occurred" + ) + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown status code received" + ) + + end + end + + sig { + params( + body: Models::Operations::CreateChannelRequestBody, + project_id: ::String, + timeout_ms: T.nilable(Integer), + http_headers: T.nilable(T::Hash[T.any(String, Symbol), String]) + ) + .returns(Models::Operations::CreateChannelResponse) + } + def create(body:, project_id:, timeout_ms: nil, http_headers: nil) + # create - Create a channel + # Create a channel in a project, with the default rules. The project's first channel becomes its default. Needs the `channels:write` permission. + request = Models::Operations::CreateChannelRequest.new( + project_id: project_id, + body: body + ) + url, params = @sdk_configuration.get_server_details + base_url = Utils.template_url(url, params) + url = Utils.generate_url( + Models::Operations::CreateChannelRequest, + base_url, + "/projects/{projectId}/channels", + request + ) + headers = {} + headers = T.cast(headers, T::Hash[String, String]) + req_content_type, data, form = Utils.serialize_request_body(request, false, false, :body, :json) + headers["content-type"] = req_content_type + raise StandardError, "request body is required" if data.nil? && form.nil? + + if form && !form.empty? + body = Utils.encode_form(form) + elsif Utils.match_content_type(req_content_type, "application/x-www-form-urlencoded") + body = URI.encode_www_form(T.cast(data, T::Hash[Symbol, Object])) + else + body = data + end + + headers["Accept"] = "application/json" + headers["user-agent"] = @sdk_configuration.user_agent + + security = @sdk_configuration.security_source&.call + + timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil? + timeout ||= @sdk_configuration.timeout + + connection = @sdk_configuration.client + + hook_ctx = SDKHooks::HookContext.new( + config: @sdk_configuration, + base_url: base_url, + oauth2_scopes: nil, + operation_id: "createChannel", + security_source: @sdk_configuration.security_source + ) + + error = T.let(nil, T.nilable(StandardError)) + http_response = T.let(nil, T.nilable(Faraday::Response)) + + begin + http_response = T.must(connection).post(url) do |req| + req.body = body + req.headers.merge!(headers) + req.options.timeout = timeout unless timeout.nil? + Utils.configure_request_security(req, security) + http_headers&.each do |key, value| + req.headers[key.to_s] = value + end + + @sdk_configuration.hooks.before_request( + hook_ctx: SDKHooks::BeforeRequestHookContext.new( + hook_ctx: hook_ctx + ), + request: req + ) + end + + rescue StandardError => e + error = e + ensure + if http_response.nil? || Utils.error_status?(http_response.status) + http_response = @sdk_configuration.hooks.after_error( + error: error, + hook_ctx: SDKHooks::AfterErrorHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + else + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + end + + if http_response.nil? + raise error if !error.nil? + raise "no response" + end + end + + content_type = http_response.headers.fetch("Content-Type", "application/octet-stream") + if Utils.match_status_code(http_response.status, ["200"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Components::Channel) + response = Models::Operations::CreateChannelResponse.new( + status_code: http_response.status, + content_type: content_type, + raw_response: http_response, + channel: T.unsafe(obj) + ) + + return response + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["400"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::BadRequestError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["401"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::AuthenticationError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["403"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::PermissionDeniedError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["404"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::NotFoundError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["429"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::RateLimitError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["4XX"]) + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "API error occurred" + ) + elsif Utils.match_status_code(http_response.status, ["5XX"]) + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "API error occurred" + ) + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown status code received" + ) + + end + end + + sig { + params( + id: ::String, + timeout_ms: T.nilable(Integer), + http_headers: T.nilable(T::Hash[T.any(String, Symbol), String]) + ) + .returns(Models::Operations::GetChannelResponse) + } + def retrieve(id:, timeout_ms: nil, http_headers: nil) + # retrieve - Get a channel + # Get a channel by ID. Needs the `channels:read` permission. + request = Models::Operations::GetChannelRequest.new( + id: id + ) + url, params = @sdk_configuration.get_server_details + base_url = Utils.template_url(url, params) + url = Utils.generate_url( + Models::Operations::GetChannelRequest, + base_url, + "/channels/{id}", + request + ) + headers = {} + headers = T.cast(headers, T::Hash[String, String]) + headers["Accept"] = "application/json" + headers["user-agent"] = @sdk_configuration.user_agent + + security = @sdk_configuration.security_source&.call + + timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil? + timeout ||= @sdk_configuration.timeout + + connection = @sdk_configuration.client + + hook_ctx = SDKHooks::HookContext.new( + config: @sdk_configuration, + base_url: base_url, + oauth2_scopes: nil, + operation_id: "getChannel", + security_source: @sdk_configuration.security_source + ) + + error = T.let(nil, T.nilable(StandardError)) + http_response = T.let(nil, T.nilable(Faraday::Response)) + + begin + http_response = T.must(connection).get(url) do |req| + req.headers.merge!(headers) + req.options.timeout = timeout unless timeout.nil? + Utils.configure_request_security(req, security) + http_headers&.each do |key, value| + req.headers[key.to_s] = value + end + + @sdk_configuration.hooks.before_request( + hook_ctx: SDKHooks::BeforeRequestHookContext.new( + hook_ctx: hook_ctx + ), + request: req + ) + end + + rescue StandardError => e + error = e + ensure + if http_response.nil? || Utils.error_status?(http_response.status) + http_response = @sdk_configuration.hooks.after_error( + error: error, + hook_ctx: SDKHooks::AfterErrorHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + else + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + end + + if http_response.nil? + raise error if !error.nil? + raise "no response" + end + end + + content_type = http_response.headers.fetch("Content-Type", "application/octet-stream") + if Utils.match_status_code(http_response.status, ["200"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Components::Channel) + response = Models::Operations::GetChannelResponse.new( + status_code: http_response.status, + content_type: content_type, + raw_response: http_response, + channel: T.unsafe(obj) + ) + + return response + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["401"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::AuthenticationError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["403"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::PermissionDeniedError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["404"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::NotFoundError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["429"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::RateLimitError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["4XX"]) + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "API error occurred" + ) + elsif Utils.match_status_code(http_response.status, ["5XX"]) + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "API error occurred" + ) + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown status code received" + ) + + end + end + + sig { + params( + body: Models::Operations::UpdateChannelRequestBody, + id: ::String, + timeout_ms: T.nilable(Integer), + http_headers: T.nilable(T::Hash[T.any(String, Symbol), String]) + ) + .returns(Models::Operations::UpdateChannelResponse) + } + def update(body:, id:, timeout_ms: nil, http_headers: nil) + # update - Update a channel + # Update a channel. Fields you leave out keep their value. Needs the `channels:write` permission. + request = Models::Operations::UpdateChannelRequest.new( + id: id, + body: body + ) + url, params = @sdk_configuration.get_server_details + base_url = Utils.template_url(url, params) + url = Utils.generate_url( + Models::Operations::UpdateChannelRequest, + base_url, + "/channels/{id}", + request + ) + headers = {} + headers = T.cast(headers, T::Hash[String, String]) + req_content_type, data, form = Utils.serialize_request_body(request, false, false, :body, :json) + headers["content-type"] = req_content_type + raise StandardError, "request body is required" if data.nil? && form.nil? + + if form && !form.empty? + body = Utils.encode_form(form) + elsif Utils.match_content_type(req_content_type, "application/x-www-form-urlencoded") + body = URI.encode_www_form(T.cast(data, T::Hash[Symbol, Object])) + else + body = data + end + + headers["Accept"] = "application/json" + headers["user-agent"] = @sdk_configuration.user_agent + + security = @sdk_configuration.security_source&.call + + timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil? + timeout ||= @sdk_configuration.timeout + + connection = @sdk_configuration.client + + hook_ctx = SDKHooks::HookContext.new( + config: @sdk_configuration, + base_url: base_url, + oauth2_scopes: nil, + operation_id: "updateChannel", + security_source: @sdk_configuration.security_source + ) + + error = T.let(nil, T.nilable(StandardError)) + http_response = T.let(nil, T.nilable(Faraday::Response)) + + begin + http_response = T.must(connection).put(url) do |req| + req.body = body + req.headers.merge!(headers) + req.options.timeout = timeout unless timeout.nil? + Utils.configure_request_security(req, security) + http_headers&.each do |key, value| + req.headers[key.to_s] = value + end + + @sdk_configuration.hooks.before_request( + hook_ctx: SDKHooks::BeforeRequestHookContext.new( + hook_ctx: hook_ctx + ), + request: req + ) + end + + rescue StandardError => e + error = e + ensure + if http_response.nil? || Utils.error_status?(http_response.status) + http_response = @sdk_configuration.hooks.after_error( + error: error, + hook_ctx: SDKHooks::AfterErrorHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + else + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + end + + if http_response.nil? + raise error if !error.nil? + raise "no response" + end + end + + content_type = http_response.headers.fetch("Content-Type", "application/octet-stream") + if Utils.match_status_code(http_response.status, ["200"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Components::Channel) + response = Models::Operations::UpdateChannelResponse.new( + status_code: http_response.status, + content_type: content_type, + raw_response: http_response, + channel: T.unsafe(obj) + ) + + return response + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["400"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::BadRequestError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["401"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::AuthenticationError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["403"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::PermissionDeniedError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["404"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::NotFoundError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["429"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::RateLimitError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["4XX"]) + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "API error occurred" + ) + elsif Utils.match_status_code(http_response.status, ["5XX"]) + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "API error occurred" + ) + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown status code received" + ) + + end + end + + sig { + params( + id: ::String, + timeout_ms: T.nilable(Integer), + http_headers: T.nilable(T::Hash[T.any(String, Symbol), String]) + ) + .returns(Models::Operations::DeleteChannelResponse) + } + def delete(id:, timeout_ms: nil, http_headers: nil) + # delete - Delete a channel + # Delete a channel. Its key is freed for a new channel. When it was the default, the oldest remaining channel becomes the default. A channel that still moderates a Slack workspace must be disconnected first. Needs the `channels:write` permission. + request = Models::Operations::DeleteChannelRequest.new( + id: id + ) + url, params = @sdk_configuration.get_server_details + base_url = Utils.template_url(url, params) + url = Utils.generate_url( + Models::Operations::DeleteChannelRequest, + base_url, + "/channels/{id}", + request + ) + headers = {} + headers = T.cast(headers, T::Hash[String, String]) + headers["Accept"] = "application/json" + headers["user-agent"] = @sdk_configuration.user_agent + + security = @sdk_configuration.security_source&.call + + timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil? + timeout ||= @sdk_configuration.timeout + + connection = @sdk_configuration.client + + hook_ctx = SDKHooks::HookContext.new( + config: @sdk_configuration, + base_url: base_url, + oauth2_scopes: nil, + operation_id: "deleteChannel", + security_source: @sdk_configuration.security_source + ) + + error = T.let(nil, T.nilable(StandardError)) + http_response = T.let(nil, T.nilable(Faraday::Response)) + + begin + http_response = T.must(connection).delete(url) do |req| + req.headers.merge!(headers) + req.options.timeout = timeout unless timeout.nil? + Utils.configure_request_security(req, security) + http_headers&.each do |key, value| + req.headers[key.to_s] = value + end + + @sdk_configuration.hooks.before_request( + hook_ctx: SDKHooks::BeforeRequestHookContext.new( + hook_ctx: hook_ctx + ), + request: req + ) + end + + rescue StandardError => e + error = e + ensure + if http_response.nil? || Utils.error_status?(http_response.status) + http_response = @sdk_configuration.hooks.after_error( + error: error, + hook_ctx: SDKHooks::AfterErrorHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + else + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + end + + if http_response.nil? + raise error if !error.nil? + raise "no response" + end + end + + content_type = http_response.headers.fetch("Content-Type", "application/octet-stream") + if Utils.match_status_code(http_response.status, ["200"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Operations::DeleteChannelResponseBody) + response = Models::Operations::DeleteChannelResponse.new( + status_code: http_response.status, + content_type: content_type, + raw_response: http_response, + object: T.unsafe(obj) + ) + + return response + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["400"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::BadRequestError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["401"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::AuthenticationError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["403"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::PermissionDeniedError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["404"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::NotFoundError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["429"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::RateLimitError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["4XX"]) + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "API error occurred" + ) + elsif Utils.match_status_code(http_response.status, ["5XX"]) + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "API error occurred" + ) + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown status code received" + ) + + end + end + + sig { + params( + body: Models::Operations::DuplicateChannelRequestBody, + id: ::String, + timeout_ms: T.nilable(Integer), + http_headers: T.nilable(T::Hash[T.any(String, Symbol), String]) + ) + .returns(Models::Operations::DuplicateChannelResponse) + } + def duplicate(body:, id:, timeout_ms: nil, http_headers: nil) + # duplicate - Duplicate a channel + # Copy a channel in its project, with every setting, policy, rule and wordlist. Integrations (Discord, Slack, WordPress) are not copied. Needs the `channels:write` permission. + request = Models::Operations::DuplicateChannelRequest.new( + id: id, + body: body + ) + url, params = @sdk_configuration.get_server_details + base_url = Utils.template_url(url, params) + url = Utils.generate_url( + Models::Operations::DuplicateChannelRequest, + base_url, + "/channels/{id}/duplicate", + request + ) + headers = {} + headers = T.cast(headers, T::Hash[String, String]) + req_content_type, data, form = Utils.serialize_request_body(request, false, false, :body, :json) + headers["content-type"] = req_content_type + raise StandardError, "request body is required" if data.nil? && form.nil? + + if form && !form.empty? + body = Utils.encode_form(form) + elsif Utils.match_content_type(req_content_type, "application/x-www-form-urlencoded") + body = URI.encode_www_form(T.cast(data, T::Hash[Symbol, Object])) + else + body = data + end + + headers["Accept"] = "application/json" + headers["user-agent"] = @sdk_configuration.user_agent + + security = @sdk_configuration.security_source&.call + + timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil? + timeout ||= @sdk_configuration.timeout + + connection = @sdk_configuration.client + + hook_ctx = SDKHooks::HookContext.new( + config: @sdk_configuration, + base_url: base_url, + oauth2_scopes: nil, + operation_id: "duplicateChannel", + security_source: @sdk_configuration.security_source + ) + + error = T.let(nil, T.nilable(StandardError)) + http_response = T.let(nil, T.nilable(Faraday::Response)) + + begin + http_response = T.must(connection).post(url) do |req| + req.body = body + req.headers.merge!(headers) + req.options.timeout = timeout unless timeout.nil? + Utils.configure_request_security(req, security) + http_headers&.each do |key, value| + req.headers[key.to_s] = value + end + + @sdk_configuration.hooks.before_request( + hook_ctx: SDKHooks::BeforeRequestHookContext.new( + hook_ctx: hook_ctx + ), + request: req + ) + end + + rescue StandardError => e + error = e + ensure + if http_response.nil? || Utils.error_status?(http_response.status) + http_response = @sdk_configuration.hooks.after_error( + error: error, + hook_ctx: SDKHooks::AfterErrorHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + else + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + end + + if http_response.nil? + raise error if !error.nil? + raise "no response" + end + end + + content_type = http_response.headers.fetch("Content-Type", "application/octet-stream") + if Utils.match_status_code(http_response.status, ["200"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Components::Channel) + response = Models::Operations::DuplicateChannelResponse.new( + status_code: http_response.status, + content_type: content_type, + raw_response: http_response, + channel: T.unsafe(obj) + ) + + return response + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["400"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::BadRequestError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["401"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::AuthenticationError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["403"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::PermissionDeniedError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["404"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::NotFoundError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["429"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::RateLimitError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["4XX"]) + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "API error occurred" + ) + elsif Utils.match_status_code(http_response.status, ["5XX"]) + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "API error occurred" + ) + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown status code received" + ) + + end + end + end +end diff --git a/lib/moderation_api/client.rb b/lib/moderation_api/client.rb deleted file mode 100644 index b4fffa2b..00000000 --- a/lib/moderation_api/client.rb +++ /dev/null @@ -1,127 +0,0 @@ -# frozen_string_literal: true - -module ModerationAPI - class Client < ModerationAPI::Internal::Transport::BaseClient - # Default max number of retries to attempt after a failed retryable request. - DEFAULT_MAX_RETRIES = 2 - - # Default per-request timeout. - DEFAULT_TIMEOUT_IN_SECONDS = 60.0 - - # Default initial retry delay in seconds. - # Overall delay is calculated using exponential backoff + jitter. - DEFAULT_INITIAL_RETRY_DELAY = 0.5 - - # Default max retry delay in seconds. - DEFAULT_MAX_RETRY_DELAY = 8.0 - - # @return [String] - attr_reader :secret_key - - # @return [ModerationAPI::Resources::Authors] - attr_reader :authors - - # @return [ModerationAPI::Resources::Queue] - attr_reader :queue - - # @return [ModerationAPI::Resources::Actions] - attr_reader :actions - - # @return [ModerationAPI::Resources::Content] - attr_reader :content - - # @return [ModerationAPI::Resources::Account] - attr_reader :account - - # @return [ModerationAPI::Resources::Auth] - attr_reader :auth - - # @return [ModerationAPI::Resources::Wordlist] - attr_reader :wordlist - - # @return [ModerationAPI::Resources::Webhooks] - attr_reader :webhooks - - # @return [ModerationAPI::Resources::WebhookSecret] - attr_reader :webhook_secret - - # @api private - # - # @return [Hash{String=>String}] - private def auth_headers - return {} if @secret_key.nil? - - {"authorization" => "Bearer #{@secret_key}"} - end - - # @api private - # - # @return [Boolean] - def base_url_overridden? = @base_url_overridden - - # Creates and returns a new client for interacting with the API. - # - # @param secret_key [String, nil] Defaults to `ENV["MODAPI_SECRET_KEY"]` - # - # @param base_url [String, nil] Override the default base URL for the API, e.g., - # `"https://api.example.com/v2/"`. Defaults to `ENV["MODERATION_API_BASE_URL"]` - # - # @param max_retries [Integer] Max number of retries to attempt after a failed retryable request. - # - # @param timeout [Float] - # - # @param initial_retry_delay [Float] - # - # @param max_retry_delay [Float] - def initialize( - secret_key: ENV["MODAPI_SECRET_KEY"], - base_url: ENV["MODERATION_API_BASE_URL"], - max_retries: self.class::DEFAULT_MAX_RETRIES, - timeout: self.class::DEFAULT_TIMEOUT_IN_SECONDS, - initial_retry_delay: self.class::DEFAULT_INITIAL_RETRY_DELAY, - max_retry_delay: self.class::DEFAULT_MAX_RETRY_DELAY - ) - @base_url_overridden = !base_url.nil? - - base_url ||= "https://api.moderationapi.com/v1" - - if secret_key.nil? - raise ArgumentError.new("secret_key is required, and can be set via environ: \"MODAPI_SECRET_KEY\"") - end - - headers = {} - custom_headers_env = ENV["MODERATION_API_CUSTOM_HEADERS"] - unless custom_headers_env.nil? - parsed = {} - custom_headers_env.split("\n").each do |line| - colon = line.index(":") - unless colon.nil? - parsed[line[0...colon].strip] = line[(colon + 1)..].strip - end - end - headers = parsed.merge(headers) - end - - @secret_key = secret_key.to_s - - super( - base_url: base_url, - timeout: timeout, - max_retries: max_retries, - initial_retry_delay: initial_retry_delay, - max_retry_delay: max_retry_delay, - headers: headers - ) - - @authors = ModerationAPI::Resources::Authors.new(client: self) - @queue = ModerationAPI::Resources::Queue.new(client: self) - @actions = ModerationAPI::Resources::Actions.new(client: self) - @content = ModerationAPI::Resources::Content.new(client: self) - @account = ModerationAPI::Resources::Account.new(client: self) - @auth = ModerationAPI::Resources::Auth.new(client: self) - @wordlist = ModerationAPI::Resources::Wordlist.new(client: self) - @webhooks = ModerationAPI::Resources::Webhooks.new(client: self) - @webhook_secret = ModerationAPI::Resources::WebhookSecret.new(client: self) - end - end -end diff --git a/lib/moderation_api/content.rb b/lib/moderation_api/content.rb new file mode 100644 index 00000000..66e1c5da --- /dev/null +++ b/lib/moderation_api/content.rb @@ -0,0 +1,302 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +require "faraday" +require "faraday/multipart" +require "faraday/retry" +require "sorbet-runtime" + +require_relative "sdk_hooks/hooks" +require_relative "utils/retries" + +module ModerationApi + extend T::Sig + + class Content + extend T::Sig + + sig { params(sdk_config: SDKConfiguration).void } + def initialize(sdk_config) + @sdk_configuration = sdk_config + end + + sig { params(base_url: String, url_variables: T.nilable(T::Hash[Symbol, T.any(String, T::Enum)])).returns(String) } + def get_url(base_url:, url_variables: nil) + sd_base_url, sd_options = @sdk_configuration.get_server_details + + if base_url.nil? + base_url = sd_base_url + end + + if url_variables.nil? + url_variables = sd_options + end + + return Utils.template_url(base_url, url_variables) + end + + sig { + params( + request: Models::Operations::SubmitContentRequest, + timeout_ms: T.nilable(Integer), + http_headers: T.nilable(T::Hash[T.any(String, Symbol), String]) + ) + .returns(Models::Operations::SubmitContentResponse) + } + def submit(request:, timeout_ms: nil, http_headers: nil) + + url, params = @sdk_configuration.get_server_details + base_url = Utils.template_url(url, params) + url = "#{base_url}/moderate" + headers = {} + headers = T.cast(headers, T::Hash[String, String]) + req_content_type, data, form = Utils.serialize_request_body(request, false, false, :request, :json) + headers["content-type"] = req_content_type + raise StandardError, "request body is required" if data.nil? && form.nil? + + if form && !form.empty? + body = Utils.encode_form(form) + elsif Utils.match_content_type(req_content_type, "application/x-www-form-urlencoded") + body = URI.encode_www_form(T.cast(data, T::Hash[Symbol, Object])) + else + body = data + end + + headers["Accept"] = "application/json" + headers["user-agent"] = @sdk_configuration.user_agent + + security = @sdk_configuration.security_source&.call + + timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil? + timeout ||= @sdk_configuration.timeout + + connection = @sdk_configuration.client + + hook_ctx = SDKHooks::HookContext.new( + config: @sdk_configuration, + base_url: base_url, + oauth2_scopes: nil, + operation_id: "submitContent", + security_source: @sdk_configuration.security_source + ) + + error = T.let(nil, T.nilable(StandardError)) + http_response = T.let(nil, T.nilable(Faraday::Response)) + + begin + http_response = T.must(connection).post(url) do |req| + req.body = body + req.headers.merge!(headers) + req.options.timeout = timeout unless timeout.nil? + Utils.configure_request_security(req, security) + http_headers&.each do |key, value| + req.headers[key.to_s] = value + end + + @sdk_configuration.hooks.before_request( + hook_ctx: SDKHooks::BeforeRequestHookContext.new( + hook_ctx: hook_ctx + ), + request: req + ) + end + + rescue StandardError => e + error = e + ensure + if http_response.nil? || Utils.error_status?(http_response.status) + http_response = @sdk_configuration.hooks.after_error( + error: error, + hook_ctx: SDKHooks::AfterErrorHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + else + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + end + + if http_response.nil? + raise error if !error.nil? + raise "no response" + end + end + + content_type = http_response.headers.fetch("Content-Type", "application/octet-stream") + if Utils.match_status_code(http_response.status, ["200"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Operations::SubmitContentResponseBody) + response = Models::Operations::SubmitContentResponse.new( + status_code: http_response.status, + content_type: content_type, + raw_response: http_response, + object: T.unsafe(obj) + ) + + return response + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["400"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::BadRequestError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["401"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::AuthenticationError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["403"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::PermissionDeniedError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["429"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::RateLimitError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["500"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::InternalServerError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["4XX"]) + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "API error occurred" + ) + elsif Utils.match_status_code(http_response.status, ["5XX"]) + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "API error occurred" + ) + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown status code received" + ) + + end + end + end +end diff --git a/lib/moderation_api/errors.rb b/lib/moderation_api/errors.rb deleted file mode 100644 index 07739783..00000000 --- a/lib/moderation_api/errors.rb +++ /dev/null @@ -1,228 +0,0 @@ -# frozen_string_literal: true - -module ModerationAPI - module Errors - class Error < StandardError - # @!attribute cause - # - # @return [StandardError, nil] - end - - class ConversionError < ModerationAPI::Errors::Error - # @return [StandardError, nil] - def cause = @cause.nil? ? super : @cause - - # @api private - # - # @param on [Class] - # @param method [Symbol] - # @param target [Object] - # @param value [Object] - # @param cause [StandardError, nil] - def initialize(on:, method:, target:, value:, cause: nil) - cls = on.name.split("::").last - - message = [ - "Failed to parse #{cls}.#{method} from #{value.class} to #{target.inspect}.", - "To get the unparsed API response, use #{cls}[#{method.inspect}].", - cause && "Cause: #{cause.message}" - ].filter(&:itself).join(" ") - - @cause = cause - super(message) - end - end - - class APIError < ModerationAPI::Errors::Error - # @return [URI::Generic] - attr_accessor :url - - # @return [Integer, nil] - attr_accessor :status - - # @return [Hash{String=>String}, nil] - attr_accessor :headers - - # @return [Object, nil] - attr_accessor :body - - # @api private - # - # @param url [URI::Generic] - # @param status [Integer, nil] - # @param headers [Hash{String=>String}, nil] - # @param body [Object, nil] - # @param request [nil] - # @param response [nil] - # @param message [String, nil] - def initialize(url:, status: nil, headers: nil, body: nil, request: nil, response: nil, message: nil) - @url = url - @status = status - @headers = headers - @body = body - @request = request - @response = response - super(message) - end - end - - class APIConnectionError < ModerationAPI::Errors::APIError - # @!attribute status - # - # @return [nil] - - # @!attribute body - # - # @return [nil] - - # @api private - # - # @param url [URI::Generic] - # @param status [nil] - # @param headers [Hash{String=>String}, nil] - # @param body [nil] - # @param request [nil] - # @param response [nil] - # @param message [String, nil] - def initialize( - url:, - status: nil, - headers: nil, - body: nil, - request: nil, - response: nil, - message: "Connection error." - ) - super - end - end - - class APITimeoutError < ModerationAPI::Errors::APIConnectionError - # @api private - # - # @param url [URI::Generic] - # @param status [nil] - # @param headers [Hash{String=>String}, nil] - # @param body [nil] - # @param request [nil] - # @param response [nil] - # @param message [String, nil] - def initialize( - url:, - status: nil, - headers: nil, - body: nil, - request: nil, - response: nil, - message: "Request timed out." - ) - super - end - end - - class APIStatusError < ModerationAPI::Errors::APIError - # @api private - # - # @param url [URI::Generic] - # @param status [Integer] - # @param headers [Hash{String=>String}, nil] - # @param body [Object, nil] - # @param request [nil] - # @param response [nil] - # @param message [String, nil] - # - # @return [self] - def self.for(url:, status:, headers:, body:, request:, response:, message: nil) - kwargs = - { - url: url, - status: status, - headers: headers, - body: body, - request: request, - response: response, - message: message - } - - case status - in 400 - ModerationAPI::Errors::BadRequestError.new(**kwargs) - in 401 - ModerationAPI::Errors::AuthenticationError.new(**kwargs) - in 403 - ModerationAPI::Errors::PermissionDeniedError.new(**kwargs) - in 404 - ModerationAPI::Errors::NotFoundError.new(**kwargs) - in 409 - ModerationAPI::Errors::ConflictError.new(**kwargs) - in 422 - ModerationAPI::Errors::UnprocessableEntityError.new(**kwargs) - in 429 - ModerationAPI::Errors::RateLimitError.new(**kwargs) - in (500..) - ModerationAPI::Errors::InternalServerError.new(**kwargs) - else - ModerationAPI::Errors::APIStatusError.new(**kwargs) - end - end - - # @!parse - # # @return [Integer] - # attr_accessor :status - - # @api private - # - # @param url [URI::Generic] - # @param status [Integer] - # @param headers [Hash{String=>String}, nil] - # @param body [Object, nil] - # @param request [nil] - # @param response [nil] - # @param message [String, nil] - def initialize(url:, status:, headers:, body:, request:, response:, message: nil) - message ||= {url: url.to_s, status: status, body: body} - super( - url: url, - status: status, - headers: headers, - body: body, - request: request, - response: response, - message: message&.to_s - ) - end - end - - class BadRequestError < ModerationAPI::Errors::APIStatusError - HTTP_STATUS = 400 - end - - class AuthenticationError < ModerationAPI::Errors::APIStatusError - HTTP_STATUS = 401 - end - - class PermissionDeniedError < ModerationAPI::Errors::APIStatusError - HTTP_STATUS = 403 - end - - class NotFoundError < ModerationAPI::Errors::APIStatusError - HTTP_STATUS = 404 - end - - class ConflictError < ModerationAPI::Errors::APIStatusError - HTTP_STATUS = 409 - end - - class UnprocessableEntityError < ModerationAPI::Errors::APIStatusError - HTTP_STATUS = 422 - end - - class RateLimitError < ModerationAPI::Errors::APIStatusError - HTTP_STATUS = 429 - end - - class InternalServerError < ModerationAPI::Errors::APIStatusError - HTTP_STATUS = (500..) - end - end -end diff --git a/lib/moderation_api/file_part.rb b/lib/moderation_api/file_part.rb deleted file mode 100644 index a1d056b4..00000000 --- a/lib/moderation_api/file_part.rb +++ /dev/null @@ -1,58 +0,0 @@ -# frozen_string_literal: true - -module ModerationAPI - class FilePart - # @return [Pathname, StringIO, IO, String] - attr_reader :content - - # @return [String, nil] - attr_reader :content_type - - # @return [String, nil] - attr_reader :filename - - # @api private - # - # @return [String] - private def read - case content - in Pathname - content.read(binmode: true) - in StringIO - content.string - in IO - content.read - in String - content - end - end - - # @param a [Object] - # - # @return [String] - def to_json(*a) = read.to_json(*a) - - # @param a [Object] - # - # @return [String] - def to_yaml(*a) = read.to_yaml(*a) - - # @param content [Pathname, StringIO, IO, String] - # @param filename [Pathname, String, nil] - # @param content_type [String, nil] - def initialize(content, filename: nil, content_type: nil) - @content_type = content_type - @filename = - case [filename, (@content = content)] - in [String | Pathname, _] - ::File.basename(filename) - in [nil, Pathname] - content.basename.to_path - in [nil, IO] - content.to_path - else - filename - end - end - end -end diff --git a/lib/moderation_api/internal.rb b/lib/moderation_api/internal.rb deleted file mode 100644 index 34e85e75..00000000 --- a/lib/moderation_api/internal.rb +++ /dev/null @@ -1,20 +0,0 @@ -# frozen_string_literal: true - -module ModerationAPI - module Internal - extend ModerationAPI::Internal::Util::SorbetRuntimeSupport - - OMIT = - Object.new.tap do - _1.define_singleton_method(:inspect) { "#<#{ModerationAPI::Internal}::OMIT>" } - end - .freeze - - define_sorbet_constant!(:AnyHash) do - T.type_alias { T::Hash[Symbol, T.anything] } - end - define_sorbet_constant!(:FileInput) do - T.type_alias { T.any(Pathname, StringIO, IO, String, ModerationAPI::FilePart) } - end - end -end diff --git a/lib/moderation_api/internal/transport/base_client.rb b/lib/moderation_api/internal/transport/base_client.rb deleted file mode 100644 index 772fa2d1..00000000 --- a/lib/moderation_api/internal/transport/base_client.rb +++ /dev/null @@ -1,582 +0,0 @@ -# frozen_string_literal: true - -module ModerationAPI - module Internal - module Transport - # @api private - # - # @abstract - class BaseClient - extend ModerationAPI::Internal::Util::SorbetRuntimeSupport - - # from whatwg fetch spec - MAX_REDIRECTS = 20 - - # rubocop:disable Style/MutableConstant - PLATFORM_HEADERS = - { - "x-stainless-arch" => ModerationAPI::Internal::Util.arch, - "x-stainless-lang" => "ruby", - "x-stainless-os" => ModerationAPI::Internal::Util.os, - "x-stainless-package-version" => ModerationAPI::VERSION, - "x-stainless-runtime" => ::RUBY_ENGINE, - "x-stainless-runtime-version" => ::RUBY_ENGINE_VERSION - } - # rubocop:enable Style/MutableConstant - - class << self - # @api private - # - # @param req [Hash{Symbol=>Object}] - # - # @raise [ArgumentError] - def validate!(req) - keys = [:method, :path, :query, :headers, :body, :unwrap, :page, :stream, :model, :options] - case req - in Hash - req.each_key do |k| - unless keys.include?(k) - raise ArgumentError.new("Request `req` keys must be one of #{keys}, got #{k.inspect}") - end - end - else - raise ArgumentError.new("Request `req` must be a Hash or RequestOptions, got #{req.inspect}") - end - end - - # @api private - # - # @param status [Integer] - # @param headers [Hash{String=>String}] - # - # @return [Boolean] - def should_retry?(status, headers:) - coerced = ModerationAPI::Internal::Util.coerce_boolean(headers["x-should-retry"]) - case [coerced, status] - in [true | false, _] - coerced - in [_, 408 | 409 | 429 | (500..)] - # retry on: - # 408: timeouts - # 409: locks - # 429: rate limits - # 500+: unknown errors - true - else - false - end - end - - # @api private - # - # @param request [Hash{Symbol=>Object}] . - # - # @option request [Symbol] :method - # - # @option request [URI::Generic] :url - # - # @option request [Hash{String=>String}] :headers - # - # @option request [Object] :body - # - # @option request [Integer] :max_retries - # - # @option request [Float] :timeout - # - # @param status [Integer] - # - # @param response_headers [Hash{String=>String}] - # - # @return [Hash{Symbol=>Object}] - def follow_redirect(request, status:, response_headers:) - method, url, headers = request.fetch_values(:method, :url, :headers) - location = - Kernel.then do - URI.join(url, response_headers["location"]) - rescue ArgumentError - message = "Server responded with status #{status} but no valid location header." - raise ModerationAPI::Errors::APIConnectionError.new( - url: url, - response: response_headers, - message: message - ) - end - - request = {**request, url: location} - - case [url.scheme, location.scheme] - in ["https", "http"] - message = "Tried to redirect to a insecure URL" - raise ModerationAPI::Errors::APIConnectionError.new( - url: url, - response: response_headers, - message: message - ) - else - nil - end - - # from whatwg fetch spec - case [status, method] - in [301 | 302, :post] | [303, _] - drop = %w[content-encoding content-language content-length content-location content-type] - request = { - **request, - method: method == :head ? :head : :get, - headers: headers.except(*drop), - body: nil - } - else - end - - # from undici - if ModerationAPI::Internal::Util.uri_origin(url) != ModerationAPI::Internal::Util.uri_origin(location) - drop = %w[authorization cookie host proxy-authorization] - request = {**request, headers: request.fetch(:headers).except(*drop)} - end - - request - end - - # @api private - # - # @param status [Integer, ModerationAPI::Errors::APIConnectionError] - # @param stream [Enumerable, nil] - def reap_connection!(status, stream:) - case status - in (..199) | (300..499) - stream&.each { next } - in ModerationAPI::Errors::APIConnectionError | (500..) - ModerationAPI::Internal::Util.close_fused!(stream) - else - end - end - end - - # @return [URI::Generic] - attr_reader :base_url - - # @return [Float] - attr_reader :timeout - - # @return [Integer] - attr_reader :max_retries - - # @return [Float] - attr_reader :initial_retry_delay - - # @return [Float] - attr_reader :max_retry_delay - - # @return [Hash{String=>String}] - attr_reader :headers - - # @return [String, nil] - attr_reader :idempotency_header - - # @api private - # @return [ModerationAPI::Internal::Transport::PooledNetRequester] - attr_reader :requester - - # @api private - # - # @param base_url [String] - # @param timeout [Float] - # @param max_retries [Integer] - # @param initial_retry_delay [Float] - # @param max_retry_delay [Float] - # @param headers [Hash{String=>String, Integer, Array, nil}] - # @param idempotency_header [String, nil] - def initialize( - base_url:, - timeout: 0.0, - max_retries: 0, - initial_retry_delay: 0.0, - max_retry_delay: 0.0, - headers: {}, - idempotency_header: nil - ) - @requester = ModerationAPI::Internal::Transport::PooledNetRequester.new - @headers = ModerationAPI::Internal::Util.normalized_headers( - self.class::PLATFORM_HEADERS, - { - "accept" => "application/json", - "content-type" => "application/json", - "user-agent" => user_agent - }, - headers - ) - @base_url_components = ModerationAPI::Internal::Util.parse_uri(base_url) - @base_url = ModerationAPI::Internal::Util.unparse_uri(@base_url_components) - @idempotency_header = idempotency_header&.to_s&.downcase - @timeout = timeout - @max_retries = max_retries - @initial_retry_delay = initial_retry_delay - @max_retry_delay = max_retry_delay - end - - # @api private - # - # @return [Hash{String=>String}] - private def auth_headers = {} - - # @api private - # - # @return [String] - private def user_agent = "#{self.class.name}/Ruby #{ModerationAPI::VERSION}" - - # @api private - # - # @return [String] - private def generate_idempotency_key = "stainless-ruby-retry-#{SecureRandom.uuid}" - - # @api private - # - # @param req [Hash{Symbol=>Object}] . - # - # @option req [Symbol] :method - # - # @option req [String, Array] :path - # - # @option req [Hash{String=>Array, String, nil}, nil] :query - # - # @option req [Hash{String=>String, Integer, Array, nil}, nil] :headers - # - # @option req [Object, nil] :body - # - # @option req [Symbol, Integer, Array, Proc, nil] :unwrap - # - # @option req [Class, nil] :page - # - # @option req [Class, nil] :stream - # - # @option req [ModerationAPI::Internal::Type::Converter, Class, nil] :model - # - # @param opts [Hash{Symbol=>Object}] . - # - # @option opts [String, nil] :idempotency_key - # - # @option opts [Hash{String=>Array, String, nil}, nil] :extra_query - # - # @option opts [Hash{String=>String, nil}, nil] :extra_headers - # - # @option opts [Object, nil] :extra_body - # - # @option opts [Integer, nil] :max_retries - # - # @option opts [Float, nil] :timeout - # - # @return [Hash{Symbol=>Object}] - private def build_request(req, opts) - method, uninterpolated_path = req.fetch_values(:method, :path) - - path = ModerationAPI::Internal::Util.interpolate_path(uninterpolated_path) - - query = ModerationAPI::Internal::Util.deep_merge(req[:query].to_h, opts[:extra_query].to_h) - - headers = ModerationAPI::Internal::Util.normalized_headers( - @headers, - auth_headers, - req[:headers].to_h, - opts[:extra_headers].to_h - ) - - if @idempotency_header && - !headers.key?(@idempotency_header) && - (!Net::HTTP::IDEMPOTENT_METHODS_.include?(method.to_s.upcase) || opts.key?(:idempotency_key)) - headers[@idempotency_header] = opts.fetch(:idempotency_key) { generate_idempotency_key } - end - - unless headers.key?("x-stainless-retry-count") - headers["x-stainless-retry-count"] = "0" - end - - timeout = opts.fetch(:timeout, @timeout).to_f.clamp(0..) - unless headers.key?("x-stainless-timeout") || timeout.zero? - headers["x-stainless-timeout"] = timeout.to_s - end - - headers.reject! { |_, v| v.to_s.empty? } - - body = - case method - in :get | :head | :options | :trace - nil - else - ModerationAPI::Internal::Util.deep_merge(*[req[:body], opts[:extra_body]].compact) - end - - # Generated methods always pass `req[:body]` for operations that define a - # request body, so only elide the content-type header when the operation - # has no body at all, not when an optional body param was omitted. - headers.delete("content-type") if body.nil? && !req.key?(:body) - - url = ModerationAPI::Internal::Util.join_parsed_uri( - @base_url_components, - {**req, path: path, query: query} - ) - headers, encoded = ModerationAPI::Internal::Util.encode_content(headers, body) - { - method: method, - url: url, - headers: headers, - body: encoded, - max_retries: opts.fetch(:max_retries, @max_retries), - timeout: timeout - } - end - - # @api private - # - # @param headers [Hash{String=>String}] - # @param retry_count [Integer] - # - # @return [Float] - private def retry_delay(headers, retry_count:) - # Non-standard extension - span = Float(headers["retry-after-ms"], exception: false)&.then { _1 / 1000 } - return span if span - - retry_header = headers["retry-after"] - return span if (span = Float(retry_header, exception: false)) - - span = retry_header&.then do - Time.httpdate(_1) - Time.now - rescue ArgumentError - nil - end - return span if span - - scale = retry_count**2 - jitter = 1 - (0.25 * rand) - (@initial_retry_delay * scale * jitter).clamp(0, @max_retry_delay) - end - - # @api private - # - # @param request [Hash{Symbol=>Object}] . - # - # @option request [Symbol] :method - # - # @option request [URI::Generic] :url - # - # @option request [Hash{String=>String}] :headers - # - # @option request [Object] :body - # - # @option request [Integer] :max_retries - # - # @option request [Float] :timeout - # - # @param redirect_count [Integer] - # - # @param retry_count [Integer] - # - # @param send_retry_header [Boolean] - # - # @raise [ModerationAPI::Errors::APIError] - # @return [Array(Integer, Net::HTTPResponse, Enumerable)] - def send_request(request, redirect_count:, retry_count:, send_retry_header:) - url, headers, max_retries, timeout = request.fetch_values(:url, :headers, :max_retries, :timeout) - input = {**request.except(:timeout), deadline: ModerationAPI::Internal::Util.monotonic_secs + timeout} - - if send_retry_header - headers["x-stainless-retry-count"] = retry_count.to_s - end - - begin - status, response, stream = @requester.execute(input) - rescue ModerationAPI::Errors::APIConnectionError => e - status = e - end - headers = ModerationAPI::Internal::Util.normalized_headers(response&.each_header&.to_h) - - case status - in ..299 - [status, response, stream] - in 300..399 if redirect_count >= self.class::MAX_REDIRECTS - self.class.reap_connection!(status, stream: stream) - - message = "Failed to complete the request within #{self.class::MAX_REDIRECTS} redirects." - raise ModerationAPI::Errors::APIConnectionError.new( - url: url, - response: response, - message: message - ) - in 300..399 - self.class.reap_connection!(status, stream: stream) - - request = self.class.follow_redirect(request, status: status, response_headers: headers) - send_request( - request, - redirect_count: redirect_count + 1, - retry_count: retry_count, - send_retry_header: send_retry_header - ) - in ModerationAPI::Errors::APIConnectionError if retry_count >= max_retries - raise status - in (400..) if retry_count >= max_retries || !self.class.should_retry?(status, headers: headers) - decoded = Kernel.then do - ModerationAPI::Internal::Util.decode_content(headers, stream: stream, suppress_error: true) - ensure - self.class.reap_connection!(status, stream: stream) - end - - raise ModerationAPI::Errors::APIStatusError.for( - url: url, - status: status, - headers: headers, - body: decoded, - request: nil, - response: response - ) - in (400..) | ModerationAPI::Errors::APIConnectionError - self.class.reap_connection!(status, stream: stream) - - delay = retry_delay(response || {}, retry_count: retry_count) - sleep(delay) - - send_request( - request, - redirect_count: redirect_count, - retry_count: retry_count + 1, - send_retry_header: send_retry_header - ) - end - end - - # Execute the request specified by `req`. This is the method that all resource - # methods call into. - # - # @overload request(method, path, query: {}, headers: {}, body: nil, unwrap: nil, page: nil, stream: nil, model: ModerationAPI::Internal::Type::Unknown, options: {}) - # - # @param method [Symbol] - # - # @param path [String, Array] - # - # @param query [Hash{String=>Array, String, nil}, nil] - # - # @param headers [Hash{String=>String, Integer, Array, nil}, nil] - # - # @param body [Object, nil] - # - # @param unwrap [Symbol, Integer, Array, Proc, nil] - # - # @param page [Class, nil] - # - # @param stream [Class, nil] - # - # @param model [ModerationAPI::Internal::Type::Converter, Class, nil] - # - # @param options [ModerationAPI::RequestOptions, Hash{Symbol=>Object}, nil] . - # - # @option options [String, nil] :idempotency_key - # - # @option options [Hash{String=>Array, String, nil}, nil] :extra_query - # - # @option options [Hash{String=>String, nil}, nil] :extra_headers - # - # @option options [Object, nil] :extra_body - # - # @option options [Integer, nil] :max_retries - # - # @option options [Float, nil] :timeout - # - # @raise [ModerationAPI::Errors::APIError] - # @return [Object] - def request(req) - self.class.validate!(req) - model = req.fetch(:model) { ModerationAPI::Internal::Type::Unknown } - opts = req[:options].to_h - unwrap = req[:unwrap] - ModerationAPI::RequestOptions.validate!(opts) - request = build_request(req.except(:options), opts) - url = request.fetch(:url) - - # Don't send the current retry count in the headers if the caller modified the header defaults. - send_retry_header = request.fetch(:headers)["x-stainless-retry-count"] == "0" - status, response, stream = send_request( - request, - redirect_count: 0, - retry_count: 0, - send_retry_header: send_retry_header - ) - - headers = ModerationAPI::Internal::Util.normalized_headers(response.each_header.to_h) - decoded = ModerationAPI::Internal::Util.decode_content(headers, stream: stream) - case req - in {stream: Class => st} - st.new( - model: model, - url: url, - status: status, - headers: headers, - response: response, - unwrap: unwrap, - stream: decoded - ) - in {page: Class => page} - page.new(client: self, req: req, headers: headers, page_data: decoded) - else - unwrapped = ModerationAPI::Internal::Util.dig(decoded, unwrap) - ModerationAPI::Internal::Type::Converter.coerce(model, unwrapped) - end - end - - # @api private - # - # @return [String] - def inspect - # rubocop:disable Layout/LineLength - "#<#{self.class.name}:0x#{object_id.to_s(16)} base_url=#{@base_url} max_retries=#{@max_retries} timeout=#{@timeout}>" - # rubocop:enable Layout/LineLength - end - - define_sorbet_constant!(:RequestComponents) do - T.type_alias do - { - method: Symbol, - path: T.any(String, T::Array[String]), - query: T.nilable(T::Hash[String, T.nilable(T.any(T::Array[String], String))]), - headers: T.nilable( - T::Hash[String, - T.nilable( - T.any( - String, - Integer, - T::Array[T.nilable(T.any(String, Integer))] - ) - )] - ), - body: T.nilable(T.anything), - unwrap: T.nilable( - T.any( - Symbol, - Integer, - T::Array[T.any(Symbol, Integer)], - T.proc.params(arg0: T.anything).returns(T.anything) - ) - ), - page: T.nilable(T::Class[ModerationAPI::Internal::Type::BasePage[ModerationAPI::Internal::Type::BaseModel]]), - stream: T.nilable(T::Class[T.anything]), - model: T.nilable(ModerationAPI::Internal::Type::Converter::Input), - options: T.nilable(ModerationAPI::RequestOptions::OrHash) - } - end - end - define_sorbet_constant!(:RequestInput) do - T.type_alias do - { - method: Symbol, - url: URI::Generic, - headers: T::Hash[String, String], - body: T.anything, - max_retries: Integer, - timeout: Float - } - end - end - end - end - end -end diff --git a/lib/moderation_api/internal/transport/pooled_net_requester.rb b/lib/moderation_api/internal/transport/pooled_net_requester.rb deleted file mode 100644 index fddc58fd..00000000 --- a/lib/moderation_api/internal/transport/pooled_net_requester.rb +++ /dev/null @@ -1,210 +0,0 @@ -# frozen_string_literal: true - -module ModerationAPI - module Internal - module Transport - # @api private - class PooledNetRequester - extend ModerationAPI::Internal::Util::SorbetRuntimeSupport - - # from the golang stdlib - # https://github.com/golang/go/blob/c8eced8580028328fde7c03cbfcb720ce15b2358/src/net/http/transport.go#L49 - KEEP_ALIVE_TIMEOUT = 30 - - DEFAULT_MAX_CONNECTIONS = [Etc.nprocessors, 99].max - - class << self - # @api private - # - # @param cert_store [OpenSSL::X509::Store] - # @param url [URI::Generic] - # - # @return [Net::HTTP] - def connect(cert_store:, url:) - port = - case [url.port, url.scheme] - in [Integer, _] - url.port - in [nil, "http" | "ws"] - Net::HTTP.http_default_port - in [nil, "https" | "wss"] - Net::HTTP.https_default_port - end - - Net::HTTP.new(url.host, port).tap do - _1.use_ssl = %w[https wss].include?(url.scheme) - _1.max_retries = 0 - - (_1.cert_store = cert_store) if _1.use_ssl? - end - end - - # @api private - # - # @param conn [Net::HTTP] - # @param deadline [Float] - def calibrate_socket_timeout(conn, deadline) - timeout = deadline - ModerationAPI::Internal::Util.monotonic_secs - conn.open_timeout = conn.read_timeout = conn.write_timeout = conn.continue_timeout = timeout - end - - # @api private - # - # @param request [Hash{Symbol=>Object}] . - # - # @option request [Symbol] :method - # - # @option request [URI::Generic] :url - # - # @option request [Hash{String=>String}] :headers - # - # @param blk [Proc] - # - # @yieldparam [String] - # @return [Array(Net::HTTPGenericRequest, Proc)] - def build_request(request, &blk) - method, url, headers, body = request.fetch_values(:method, :url, :headers, :body) - req = Net::HTTPGenericRequest.new( - method.to_s.upcase, - !body.nil?, - method != :head, - URI(url.to_s) # ensure we construct a URI class of the right scheme - ) - - headers.each { req[_1] = _2 } - - case body - in nil - req["content-length"] ||= 0 unless req["transfer-encoding"] - in String - req["content-length"] ||= body.bytesize.to_s unless req["transfer-encoding"] - req.body_stream = ModerationAPI::Internal::Util::ReadIOAdapter.new(body, &blk) - in StringIO - req["content-length"] ||= body.size.to_s unless req["transfer-encoding"] - req.body_stream = ModerationAPI::Internal::Util::ReadIOAdapter.new(body, &blk) - in Pathname | IO | Enumerator - req["transfer-encoding"] ||= "chunked" unless req["content-length"] - req.body_stream = ModerationAPI::Internal::Util::ReadIOAdapter.new(body, &blk) - end - - [req, req.body_stream&.method(:close)] - end - end - - # @api private - # - # @param url [URI::Generic] - # @param deadline [Float] - # @param blk [Proc] - # - # @raise [Timeout::Error] - # @yieldparam [Net::HTTP] - private def with_pool(url, deadline:, &blk) - origin = ModerationAPI::Internal::Util.uri_origin(url) - timeout = deadline - ModerationAPI::Internal::Util.monotonic_secs - pool = - @mutex.synchronize do - @pools[origin] ||= ConnectionPool.new(size: @size) do - self.class.connect(cert_store: @cert_store, url: url) - end - end - - pool.with(timeout: timeout, &blk) - end - - # @api private - # - # @param request [Hash{Symbol=>Object}] . - # - # @option request [Symbol] :method - # - # @option request [URI::Generic] :url - # - # @option request [Hash{String=>String}] :headers - # - # @option request [Object] :body - # - # @option request [Float] :deadline - # - # @return [Array(Integer, Net::HTTPResponse, Enumerable)] - def execute(request) - url, deadline = request.fetch_values(:url, :deadline) - - req = nil - finished = false - - # rubocop:disable Metrics/BlockLength - enum = Enumerator.new do |y| - next if finished - - with_pool(url, deadline: deadline) do |conn| - eof = false - closing = nil - ::Thread.handle_interrupt(Object => :never) do - ::Thread.handle_interrupt(Object => :immediate) do - req, closing = self.class.build_request(request) do - self.class.calibrate_socket_timeout(conn, deadline) - end - - self.class.calibrate_socket_timeout(conn, deadline) - unless conn.started? - conn.keep_alive_timeout = self.class::KEEP_ALIVE_TIMEOUT - conn.start - end - - self.class.calibrate_socket_timeout(conn, deadline) - ::Kernel.catch(:jump) do - conn.request(req) do |rsp| - y << [req, rsp] - ::Kernel.throw(:jump) if finished - - rsp.read_body do |bytes| - y << bytes.force_encoding(Encoding::BINARY) - ::Kernel.throw(:jump) if finished - - self.class.calibrate_socket_timeout(conn, deadline) - end - eof = true - end - end - end - ensure - begin - conn.finish if !eof && conn&.started? - ensure - closing&.call - end - end - end - rescue Timeout::Error - raise ModerationAPI::Errors::APITimeoutError.new(url: url, request: req) - rescue StandardError - raise ModerationAPI::Errors::APIConnectionError.new(url: url, request: req) - end - # rubocop:enable Metrics/BlockLength - - _, response = enum.next - body = ModerationAPI::Internal::Util.fused_enum(enum, external: true) do - finished = true - loop { enum.next } - end - [Integer(response.code), response, body] - end - - # @api private - # - # @param size [Integer] - def initialize(size: self.class::DEFAULT_MAX_CONNECTIONS) - @mutex = Mutex.new - @size = size - @cert_store = OpenSSL::X509::Store.new.tap(&:set_default_paths) - @pools = {} - end - - define_sorbet_constant!(:Request) do - T.type_alias { {method: Symbol, url: URI::Generic, headers: T::Hash[String, String], body: T.anything, deadline: Float} } - end - end - end - end -end diff --git a/lib/moderation_api/internal/type/array_of.rb b/lib/moderation_api/internal/type/array_of.rb deleted file mode 100644 index b7ba8180..00000000 --- a/lib/moderation_api/internal/type/array_of.rb +++ /dev/null @@ -1,168 +0,0 @@ -# frozen_string_literal: true - -module ModerationAPI - module Internal - module Type - # @api private - # - # @abstract - # - # @generic Elem - # - # Array of items of a given type. - class ArrayOf - include ModerationAPI::Internal::Type::Converter - include ModerationAPI::Internal::Util::SorbetRuntimeSupport - - private_class_method :new - - # @overload [](type_info, spec = {}) - # - # @param type_info [Hash{Symbol=>Object}, Proc, ModerationAPI::Internal::Type::Converter, Class] - # - # @param spec [Hash{Symbol=>Object}] . - # - # @option spec [NilClass, TrueClass, FalseClass, Integer, Float, Symbol] :const - # - # @option spec [Proc] :enum - # - # @option spec [Proc] :union - # - # @option spec [Boolean] :"nil?" - # - # @return [self] - def self.[](...) = new(...) - - # @api public - # - # @param other [Object] - # - # @return [Boolean] - def ===(other) = other.is_a?(Array) && other.all?(item_type) - - # @api public - # - # @param other [Object] - # - # @return [Boolean] - def ==(other) - # rubocop:disable Layout/LineLength - other.is_a?(ModerationAPI::Internal::Type::ArrayOf) && other.nilable? == nilable? && other.item_type == item_type - # rubocop:enable Layout/LineLength - end - - # @api public - # - # @return [Integer] - def hash = [self.class, item_type].hash - - # @api private - # - # @param value [Array, Object] - # - # @param state [Hash{Symbol=>Object}] . - # - # @option state [Boolean] :translate_names - # - # @option state [Boolean] :strictness - # - # @option state [Hash{Symbol=>Object}] :exactness - # - # @option state [Class] :error - # - # @option state [Integer] :branched - # - # @return [Array, Object] - def coerce(value, state:) - exactness = state.fetch(:exactness) - - unless value.is_a?(Array) - exactness[:no] += 1 - state[:error] = TypeError.new("#{value.class} can't be coerced into #{Array}") - return value - end - - target = item_type - exactness[:yes] += 1 - value - .map do |item| - case [nilable?, item] - in [true, nil] - exactness[:yes] += 1 - nil - else - ModerationAPI::Internal::Type::Converter.coerce(target, item, state: state) - end - end - end - - # @api private - # - # @param value [Array, Object] - # - # @param state [Hash{Symbol=>Object}] . - # - # @option state [Boolean] :can_retry - # - # @return [Array, Object] - def dump(value, state:) - target = item_type - if value.is_a?(Array) - value.map do - ModerationAPI::Internal::Type::Converter.dump(target, _1, state: state) - end - else - super - end - end - - # @api private - # - # @return [Object] - def to_sorbet_type - T::Array[ModerationAPI::Internal::Util::SorbetRuntimeSupport.to_sorbet_type(item_type)] - end - - # @api private - # - # @return [generic] - protected def item_type = @item_type_fn.call - - # @api private - # - # @return [Boolean] - protected def nilable? = @nilable - - # @api private - # - # @param type_info [Hash{Symbol=>Object}, Proc, ModerationAPI::Internal::Type::Converter, Class] - # - # @param spec [Hash{Symbol=>Object}] . - # - # @option spec [NilClass, TrueClass, FalseClass, Integer, Float, Symbol] :const - # - # @option spec [Proc] :enum - # - # @option spec [Proc] :union - # - # @option spec [Boolean] :"nil?" - def initialize(type_info, spec = {}) - @item_type_fn = ModerationAPI::Internal::Type::Converter.type_info(type_info || spec) - @meta = ModerationAPI::Internal::Type::Converter.meta_info(type_info, spec) - @nilable = spec.fetch(:nil?, false) - end - - # @api private - # - # @param depth [Integer] - # - # @return [String] - def inspect(depth: 0) - items = ModerationAPI::Internal::Type::Converter.inspect(item_type, depth: depth.succ) - - "#{self.class}[#{[items, nilable? ? 'nil' : nil].compact.join(' | ')}]" - end - end - end - end -end diff --git a/lib/moderation_api/internal/type/base_model.rb b/lib/moderation_api/internal/type/base_model.rb deleted file mode 100644 index 4ea260e4..00000000 --- a/lib/moderation_api/internal/type/base_model.rb +++ /dev/null @@ -1,534 +0,0 @@ -# frozen_string_literal: true - -module ModerationAPI - module Internal - module Type - # @abstract - class BaseModel - extend ModerationAPI::Internal::Type::Converter - extend ModerationAPI::Internal::Util::SorbetRuntimeSupport - - class << self - # @api private - # - # Assumes superclass fields are totally defined before fields are accessed / - # defined on subclasses. - # - # @param child [Class] - def inherited(child) - super - child.known_fields.replace(known_fields.dup) - end - - # @api private - # - # @return [Hash{Symbol=>Hash{Symbol=>Object}}] - def known_fields = @known_fields ||= {} - - # @api private - # - # @return [Hash{Symbol=>Hash{Symbol=>Object}}] - def fields - known_fields.transform_values do |field| - {**field.except(:type_fn), type: field.fetch(:type_fn).call} - end - end - - # @api private - # - # @param name_sym [Symbol] - # - # @param required [Boolean] - # - # @param type_info [Hash{Symbol=>Object}, Proc, ModerationAPI::Internal::Type::Converter, Class] - # - # @param spec [Hash{Symbol=>Object}] . - # - # @option spec [NilClass, TrueClass, FalseClass, Integer, Float, Symbol] :const - # - # @option spec [Proc] :enum - # - # @option spec [Proc] :union - # - # @option spec [Boolean] :"nil?" - private def add_field(name_sym, required:, type_info:, spec:) - meta = ModerationAPI::Internal::Type::Converter.meta_info(type_info, spec) - type_fn, info = - case type_info - in Proc | ModerationAPI::Internal::Type::Converter | Class - [ModerationAPI::Internal::Type::Converter.type_info({**spec, union: type_info}), spec] - in Hash - [ModerationAPI::Internal::Type::Converter.type_info(type_info), type_info] - end - - setter = :"#{name_sym}=" - api_name = info.fetch(:api_name, name_sym) - nilable = info.fetch(:nil?, false) - const = required && !nilable ? info.fetch(:const, ModerationAPI::Internal::OMIT) : ModerationAPI::Internal::OMIT - - [name_sym, setter].each { undef_method(_1) } if known_fields.key?(name_sym) - - known_fields[name_sym] = - { - mode: @mode, - api_name: api_name, - required: required, - nilable: nilable, - const: const, - type_fn: type_fn, - meta: meta - } - - define_method(setter) do |value| - target = type_fn.call - state = ModerationAPI::Internal::Type::Converter.new_coerce_state(translate_names: false) - coerced = ModerationAPI::Internal::Type::Converter.coerce(target, value, state: state) - status = @coerced.store(name_sym, state.fetch(:error) || true) - stored = - case [target, status] - in [ModerationAPI::Internal::Type::Converter | Symbol, true] - coerced - else - value - end - @data.store(name_sym, stored) - end - - # rubocop:disable Style/CaseEquality - # rubocop:disable Metrics/BlockLength - define_method(name_sym) do - target = type_fn.call - - case @coerced[name_sym] - in true | false if ModerationAPI::Internal::Type::Converter === target - @data.fetch(name_sym) - in ::StandardError => e - raise ModerationAPI::Errors::ConversionError.new( - on: self.class, - method: __method__, - target: target, - value: @data.fetch(name_sym), - cause: e - ) - else - Kernel.then do - value = @data.fetch(name_sym) { const == ModerationAPI::Internal::OMIT ? nil : const } - state = ModerationAPI::Internal::Type::Converter.new_coerce_state(translate_names: false) - if (nilable || !required) && value.nil? - nil - else - ModerationAPI::Internal::Type::Converter.coerce( - target, value, state: state - ) - end - rescue StandardError => e - raise ModerationAPI::Errors::ConversionError.new( - on: self.class, - method: __method__, - target: target, - value: value, - cause: e - ) - end - end - end - # rubocop:enable Metrics/BlockLength - # rubocop:enable Style/CaseEquality - end - - # @api private - # - # @param name_sym [Symbol] - # - # @param type_info [Hash{Symbol=>Object}, Proc, ModerationAPI::Internal::Type::Converter, Class] - # - # @param spec [Hash{Symbol=>Object}] . - # - # @option spec [NilClass, TrueClass, FalseClass, Integer, Float, Symbol] :const - # - # @option spec [Proc] :enum - # - # @option spec [Proc] :union - # - # @option spec [Boolean] :"nil?" - def required(name_sym, type_info, spec = {}) - add_field(name_sym, required: true, type_info: type_info, spec: spec) - end - - # @api private - # - # @param name_sym [Symbol] - # - # @param type_info [Hash{Symbol=>Object}, Proc, ModerationAPI::Internal::Type::Converter, Class] - # - # @param spec [Hash{Symbol=>Object}] . - # - # @option spec [NilClass, TrueClass, FalseClass, Integer, Float, Symbol] :const - # - # @option spec [Proc] :enum - # - # @option spec [Proc] :union - # - # @option spec [Boolean] :"nil?" - def optional(name_sym, type_info, spec = {}) - add_field(name_sym, required: false, type_info: type_info, spec: spec) - end - - # @api private - # - # `request_only` attributes not excluded from `.#coerce` when receiving responses - # even if well behaved servers should not send them - # - # @param blk [Proc] - private def request_only(&blk) - @mode = :dump - blk.call - ensure - @mode = nil - end - - # @api private - # - # `response_only` attributes are omitted from `.#dump` when making requests - # - # @param blk [Proc] - private def response_only(&blk) - @mode = :coerce - blk.call - ensure - @mode = nil - end - - # @api public - # - # @param other [Object] - # - # @return [Boolean] - def ==(other) - other.is_a?(Class) && other <= ModerationAPI::Internal::Type::BaseModel && other.fields == fields - end - - # @api public - # - # @return [Integer] - def hash = fields.hash - end - - # @api public - # - # @param other [Object] - # - # @return [Boolean] - def ==(other) = self.class == other.class && @data == other.to_h - - # @api public - # - # @return [Integer] - def hash = [self.class, @data].hash - - class << self - # @api private - # - # @param value [ModerationAPI::Internal::Type::BaseModel, Hash{Object=>Object}, Object] - # - # @param state [Hash{Symbol=>Object}] . - # - # @option state [Boolean] :translate_names - # - # @option state [Boolean] :strictness - # - # @option state [Hash{Symbol=>Object}] :exactness - # - # @option state [Class] :error - # - # @option state [Integer] :branched - # - # @return [self, Object] - def coerce(value, state:) - exactness = state.fetch(:exactness) - - if value.is_a?(self) - exactness[:yes] += 1 - return value - end - - unless (val = ModerationAPI::Internal::Util.coerce_hash(value)).is_a?(Hash) - exactness[:no] += 1 - state[:error] = TypeError.new("#{value.class} can't be coerced into #{Hash}") - return value - end - exactness[:yes] += 1 - - keys = val.keys.to_set - instance = new - data = instance.to_h - status = instance.instance_variable_get(:@coerced) - - # rubocop:disable Metrics/BlockLength - fields.each do |name, field| - mode, required, target = field.fetch_values(:mode, :required, :type) - api_name, nilable, const = field.fetch_values(:api_name, :nilable, :const) - src_name = state.fetch(:translate_names) ? api_name : name - - unless val.key?(src_name) - if required && mode != :dump && const == ModerationAPI::Internal::OMIT - exactness[nilable ? :maybe : :no] += 1 - else - exactness[:yes] += 1 - end - next - end - - item = val.fetch(src_name) - keys.delete(src_name) - - state[:error] = nil - converted = - if item.nil? && (nilable || !required) - exactness[nilable ? :yes : :maybe] += 1 - nil - else - coerced = ModerationAPI::Internal::Type::Converter.coerce(target, item, state: state) - case target - in ModerationAPI::Internal::Type::Converter | Symbol - coerced - else - item - end - end - - status.store(name, state.fetch(:error) || true) - data.store(name, converted) - end - # rubocop:enable Metrics/BlockLength - - keys.each { data.store(_1, val.fetch(_1)) } - instance - end - - # @api private - # - # @param value [self, Object] - # - # @param state [Hash{Symbol=>Object}] . - # - # @option state [Boolean] :can_retry - # - # @return [Hash{Object=>Object}, Object] - def dump(value, state:) - unless (coerced = ModerationAPI::Internal::Util.coerce_hash(value)).is_a?(Hash) - return super - end - - acc = {} - - coerced.each do |key, val| - name = key.is_a?(String) ? key.to_sym : key - case (field = known_fields[name]) - in nil - acc.store(name, super(val, state: state)) - else - api_name, mode, type_fn = field.fetch_values(:api_name, :mode, :type_fn) - case mode - in :coerce - next - else - target = type_fn.call - acc.store( - api_name, - ModerationAPI::Internal::Type::Converter.dump(target, val, state: state) - ) - end - end - end - - known_fields.each_value do |field| - api_name, mode, const = field.fetch_values(:api_name, :mode, :const) - next if mode == :coerce || acc.key?(api_name) || const == ModerationAPI::Internal::OMIT - acc.store(api_name, const) - end - - acc - end - - # @api private - # - # @return [Object] - def to_sorbet_type - self - end - end - - class << self - # @api private - # - # @param model [ModerationAPI::Internal::Type::BaseModel] - # @param convert [Boolean] - # - # @return [Hash{Symbol=>Object}] - def recursively_to_h(model, convert:) - rec = ->(x) do - case x - in ModerationAPI::Internal::Type::BaseModel - if convert - fields = x.class.known_fields - x.to_h.to_h do |key, val| - [key, rec.call(fields.key?(key) ? x.public_send(key) : val)] - rescue ModerationAPI::Errors::ConversionError - [key, rec.call(val)] - end - else - rec.call(x.to_h) - end - in Hash - x.transform_values(&rec) - in Array - x.map(&rec) - else - x - end - end - rec.call(model) - end - end - - # @api public - # - # Returns the raw value associated with the given key, if found. Otherwise, nil is - # returned. - # - # It is valid to lookup keys that are not in the API spec, for example to access - # undocumented features. This method does not parse response data into - # higher-level types. Lookup by anything other than a Symbol is an ArgumentError. - # - # @param key [Symbol] - # - # @return [Object, nil] - def [](key) - unless key.instance_of?(Symbol) - raise ArgumentError.new("Expected symbol key for lookup, got #{key.inspect}") - end - - @data[key] - end - - # @api public - # - # Returns a Hash of the data underlying this object. O(1) - # - # Keys are Symbols and values are the raw values from the response. The return - # value indicates which values were ever set on the object. i.e. there will be a - # key in this hash if they ever were, even if the set value was nil. - # - # This method is not recursive. The returned value is shared by the object, so it - # should not be mutated. - # - # @return [Hash{Symbol=>Object}] - def to_h = @data - - alias_method :to_hash, :to_h - - # @api public - # - # In addition to the behaviour of `#to_h`, this method will recursively call - # `#to_h` on nested models. - # - # @return [Hash{Symbol=>Object}] - def deep_to_h = self.class.recursively_to_h(@data, convert: false) - - # @param keys [Array, nil] - # - # @return [Hash{Symbol=>Object}] - # - # @example - # # `author_create_response` is a `ModerationAPI::Models::AuthorCreateResponse` - # author_create_response => { - # id: id, - # block: block, - # first_seen: first_seen - # } - def deconstruct_keys(keys) - (keys || self.class.known_fields.keys) - .filter_map do |k| - unless self.class.known_fields.key?(k) - next - end - - [k, public_send(k)] - end - .to_h - end - - # @api public - # - # @param a [Object] - # - # @return [String] - def to_json(*a) = ModerationAPI::Internal::Type::Converter.dump(self.class, self).to_json(*a) - - # @api public - # - # @param a [Object] - # - # @return [String] - def to_yaml(*a) = ModerationAPI::Internal::Type::Converter.dump(self.class, self).to_yaml(*a) - - # Create a new instance of a model. - # - # @param data [Hash{Symbol=>Object}, self] - def initialize(data = {}) - @data = {} - @coerced = {} - ModerationAPI::Internal::Util.coerce_hash!(data).each do - if self.class.known_fields.key?(_1) - public_send(:"#{_1}=", _2) - else - @data.store(_1, _2) - @coerced.store(_1, false) - end - end - end - - class << self - # @api private - # - # @param depth [Integer] - # - # @return [String] - def inspect(depth: 0) - return super() if depth.positive? - - depth = depth.succ - deferred = fields.transform_values do |field| - type, required, nilable = field.fetch_values(:type, :required, :nilable) - inspected = [ - ModerationAPI::Internal::Type::Converter.inspect(type, depth: depth), - !required || nilable ? "nil" : nil - ].compact.join(" | ") - -> { inspected }.tap { _1.define_singleton_method(:inspect) { call } } - end - - "#{name}[#{deferred.inspect}]" - end - end - - # @api public - # - # @return [String] - def to_s = deep_to_h.to_s - - # @api private - # - # @return [String] - def inspect - converted = self.class.recursively_to_h(self, convert: true) - "#<#{self.class}:0x#{object_id.to_s(16)} #{converted}>" - end - - define_sorbet_constant!(:KnownField) do - T.type_alias { {mode: T.nilable(Symbol), required: T::Boolean, nilable: T::Boolean} } - end - end - end - end -end diff --git a/lib/moderation_api/internal/type/base_page.rb b/lib/moderation_api/internal/type/base_page.rb deleted file mode 100644 index d42c19b9..00000000 --- a/lib/moderation_api/internal/type/base_page.rb +++ /dev/null @@ -1,55 +0,0 @@ -# frozen_string_literal: true - -module ModerationAPI - module Internal - module Type - # @api private - # - # @generic Elem - # - # This module provides a base implementation for paginated responses in the SDK. - module BasePage - # rubocop:disable Lint/UnusedMethodArgument - - # @api public - # - # @return [Boolean] - def next_page? = (raise NotImplementedError) - - # @api public - # - # @raise [ModerationAPI::Errors::APIError] - # @return [self] - def next_page = (raise NotImplementedError) - - # @api public - # - # @param blk [Proc] - # - # @yieldparam [generic] - # @return [void] - def auto_paging_each(&blk) = (raise NotImplementedError) - - # @return [Enumerable>] - def to_enum = super(:auto_paging_each) - - alias_method :enum_for, :to_enum - - # @api private - # - # @param client [ModerationAPI::Internal::Transport::BaseClient] - # @param req [Hash{Symbol=>Object}] - # @param headers [Hash{String=>String}] - # @param page_data [Object] - def initialize(client:, req:, headers:, page_data:) - @client = client - @req = req - @model = req.fetch(:model) - super() - end - - # rubocop:enable Lint/UnusedMethodArgument - end - end - end -end diff --git a/lib/moderation_api/internal/type/boolean.rb b/lib/moderation_api/internal/type/boolean.rb deleted file mode 100644 index 27b1368c..00000000 --- a/lib/moderation_api/internal/type/boolean.rb +++ /dev/null @@ -1,77 +0,0 @@ -# frozen_string_literal: true - -module ModerationAPI - module Internal - module Type - # @api private - # - # @abstract - # - # Ruby has no Boolean class; this is something for models to refer to. - class Boolean - extend ModerationAPI::Internal::Type::Converter - extend ModerationAPI::Internal::Util::SorbetRuntimeSupport - - private_class_method :new - - # @api public - # - # @param other [Object] - # - # @return [Boolean] - def self.===(other) = other == true || other == false - - # @api public - # - # @param other [Object] - # - # @return [Boolean] - def self.==(other) = other.is_a?(Class) && other <= ModerationAPI::Internal::Type::Boolean - - class << self - # @api private - # - # Coerce value to Boolean if possible, otherwise return the original value. - # - # @param value [Boolean, Object] - # - # @param state [Hash{Symbol=>Object}] . - # - # @option state [Boolean] :translate_names - # - # @option state [Boolean] :strictness - # - # @option state [Hash{Symbol=>Object}] :exactness - # - # @option state [Class] :error - # - # @option state [Integer] :branched - # - # @return [Boolean, Object] - def coerce(value, state:) - state.fetch(:exactness)[value == true || value == false ? :yes : :no] += 1 - value - end - - # @!method dump(value, state:) - # @api private - # - # @param value [Boolean, Object] - # - # @param state [Hash{Symbol=>Object}] . - # - # @option state [Boolean] :can_retry - # - # @return [Boolean, Object] - - # @api private - # - # @return [Object] - def to_sorbet_type - T::Boolean - end - end - end - end - end -end diff --git a/lib/moderation_api/internal/type/converter.rb b/lib/moderation_api/internal/type/converter.rb deleted file mode 100644 index 9b80f26e..00000000 --- a/lib/moderation_api/internal/type/converter.rb +++ /dev/null @@ -1,327 +0,0 @@ -# frozen_string_literal: true - -module ModerationAPI - module Internal - module Type - # @api private - module Converter - extend ModerationAPI::Internal::Util::SorbetRuntimeSupport - - # rubocop:disable Lint/UnusedMethodArgument - - # @api private - # - # @param value [Object] - # - # @param state [Hash{Symbol=>Object}] . - # - # @option state [Boolean] :translate_names - # - # @option state [Boolean] :strictness - # - # @option state [Hash{Symbol=>Object}] :exactness - # - # @option state [Class] :error - # - # @option state [Integer] :branched - # - # @return [Object] - def coerce(value, state:) = (raise NotImplementedError) - - # @api private - # - # @param value [Object] - # - # @param state [Hash{Symbol=>Object}] . - # - # @option state [Boolean] :can_retry - # - # @return [Object] - def dump(value, state:) - case value - in Array - value.map { ModerationAPI::Internal::Type::Unknown.dump(_1, state: state) } - in Hash - value.transform_values { ModerationAPI::Internal::Type::Unknown.dump(_1, state: state) } - in ModerationAPI::Internal::Type::BaseModel - value.class.dump(value, state: state) - in StringIO - value.string - in Pathname | IO - state[:can_retry] = false if value.is_a?(IO) - ModerationAPI::FilePart.new(value) - in ModerationAPI::FilePart - state[:can_retry] = false if value.content.is_a?(IO) - value - else - value - end - end - - # @api private - # - # @param depth [Integer] - # - # @return [String] - def inspect(depth: 0) - super() - end - - # rubocop:enable Lint/UnusedMethodArgument - - class << self - # @api private - # - # @param spec [Hash{Symbol=>Object}, Proc, ModerationAPI::Internal::Type::Converter, Class] . - # - # @option spec [NilClass, TrueClass, FalseClass, Integer, Float, Symbol] :const - # - # @option spec [Proc] :enum - # - # @option spec [Proc] :union - # - # @option spec [Boolean] :"nil?" - # - # @return [Proc] - def type_info(spec) - case spec - in Proc - spec - in Hash - type_info(spec.slice(:const, :enum, :union).first&.last) - in true | false - -> { ModerationAPI::Internal::Type::Boolean } - in ModerationAPI::Internal::Type::Converter | Class | Symbol - -> { spec } - in NilClass | Integer | Float - -> { spec.class } - end - end - - # @api private - # - # @param type_info [Hash{Symbol=>Object}, Proc, ModerationAPI::Internal::Type::Converter, Class] . - # - # @option type_info [NilClass, TrueClass, FalseClass, Integer, Float, Symbol] :const - # - # @option type_info [Proc] :enum - # - # @option type_info [Proc] :union - # - # @option type_info [Boolean] :"nil?" - # - # @param spec [Hash{Symbol=>Object}, Proc, ModerationAPI::Internal::Type::Converter, Class] . - # - # @option spec [NilClass, TrueClass, FalseClass, Integer, Float, Symbol] :const - # - # @option spec [Proc] :enum - # - # @option spec [Proc] :union - # - # @option spec [Boolean] :"nil?" - # - # @return [Hash{Symbol=>Object}] - def meta_info(type_info, spec) - [spec, type_info].grep(Hash).first.to_h.except(:const, :enum, :union, :nil?) - end - - # @api private - # - # @param translate_names [Boolean] - # - # @return [Hash{Symbol=>Object}] - def new_coerce_state(translate_names: true) - { - translate_names: translate_names, - strictness: true, - exactness: {yes: 0, no: 0, maybe: 0}, - error: nil, - branched: 0 - } - end - - # @api private - # - # Based on `target`, transform `value` into `target`, to the extent possible: - # - # 1. if the given `value` conforms to `target` already, return the given `value` - # 2. if it's possible and safe to convert the given `value` to `target`, then the - # converted value - # 3. otherwise, the given `value` unaltered - # - # The coercion process is subject to improvement between minor release versions. - # See https://docs.pydantic.dev/latest/concepts/unions/#smart-mode - # - # @param target [ModerationAPI::Internal::Type::Converter, Class] - # - # @param value [Object] - # - # @param state [Hash{Symbol=>Object}] The `strictness` is one of `true`, `false`. This informs the coercion strategy - # when we have to decide between multiple possible conversion targets: - # - # - `true`: the conversion must be exact, with minimum coercion. - # - `false`: the conversion can be approximate, with some coercion. - # - # The `exactness` is `Hash` with keys being one of `yes`, `no`, or `maybe`. For - # any given conversion attempt, the exactness will be updated based on how closely - # the value recursively matches the target type: - # - # - `yes`: the value can be converted to the target type with minimum coercion. - # - `maybe`: the value can be converted to the target type with some reasonable - # coercion. - # - `no`: the value cannot be converted to the target type. - # - # See implementation below for more details. - # - # @option state [Boolean] :translate_names - # - # @option state [Boolean] :strictness - # - # @option state [Hash{Symbol=>Object}] :exactness - # - # @option state [Class] :error - # - # @option state [Integer] :branched - # - # @return [Object] - def coerce(target, value, state: ModerationAPI::Internal::Type::Converter.new_coerce_state) - # rubocop:disable Metrics/BlockNesting - exactness = state.fetch(:exactness) - - case target - in ModerationAPI::Internal::Type::Converter - return target.coerce(value, state: state) - in Class - if value.is_a?(target) - exactness[:yes] += 1 - return value - end - - case target - in -> { _1 <= NilClass } - exactness[value.nil? ? :yes : :maybe] += 1 - return nil - in -> { _1 <= Integer } - case value - in Integer - exactness[:yes] += 1 - return value - else - Kernel.then do - return Integer(value).tap { exactness[:maybe] += 1 } - rescue ArgumentError, TypeError => e - state[:error] = e - end - end - in -> { _1 <= Float } - if value.is_a?(Numeric) - exactness[:yes] += 1 - return Float(value) - else - Kernel.then do - return Float(value).tap { exactness[:maybe] += 1 } - rescue ArgumentError, TypeError => e - state[:error] = e - end - end - in -> { _1 <= String } - case value - in String | Symbol | Numeric - exactness[value.is_a?(Numeric) ? :maybe : :yes] += 1 - return value.to_s - in StringIO - exactness[:yes] += 1 - return value.string - else - state[:error] = TypeError.new("#{value.class} can't be coerced into #{String}") - end - in -> { _1 <= Date || _1 <= Time } - Kernel.then do - return target.parse(value).tap { exactness[:yes] += 1 } - rescue ArgumentError, TypeError => e - state[:error] = e - end - in -> { _1 <= StringIO } if value.is_a?(String) - exactness[:yes] += 1 - return StringIO.new(value.b) - else - end - in Symbol - case value - in Symbol | String - if value.to_sym == target - exactness[:yes] += 1 - return target - else - exactness[:maybe] += 1 - return value - end - else - message = "cannot convert non-matching #{value.class} into #{target.inspect}" - state[:error] = ArgumentError.new(message) - end - else - end - - exactness[:no] += 1 - value - # rubocop:enable Metrics/BlockNesting - end - - # @api private - # - # @param target [ModerationAPI::Internal::Type::Converter, Class] - # - # @param value [Object] - # - # @param state [Hash{Symbol=>Object}] . - # - # @option state [Boolean] :can_retry - # - # @return [Object] - def dump(target, value, state: {can_retry: true}) - case target - in ModerationAPI::Internal::Type::Converter - target.dump(value, state: state) - else - ModerationAPI::Internal::Type::Unknown.dump(value, state: state) - end - end - - # @api private - # - # @param target [Object] - # @param depth [Integer] - # - # @return [String] - def inspect(target, depth:) - case target - in ModerationAPI::Internal::Type::Converter - target.inspect(depth: depth.succ) - else - target.inspect - end - end - end - - define_sorbet_constant!(:Input) do - T.type_alias { T.any(ModerationAPI::Internal::Type::Converter, T::Class[T.anything]) } - end - define_sorbet_constant!(:CoerceState) do - T.type_alias do - { - translate_names: T::Boolean, - strictness: T::Boolean, - exactness: {yes: Integer, no: Integer, maybe: Integer}, - error: T::Class[StandardError], - branched: Integer - } - end - end - define_sorbet_constant!(:DumpState) do - T.type_alias { {can_retry: T::Boolean} } - end - end - end - end -end diff --git a/lib/moderation_api/internal/type/enum.rb b/lib/moderation_api/internal/type/enum.rb deleted file mode 100644 index 8e832810..00000000 --- a/lib/moderation_api/internal/type/enum.rb +++ /dev/null @@ -1,131 +0,0 @@ -# frozen_string_literal: true - -module ModerationAPI - module Internal - module Type - # @api private - # - # A value from among a specified list of options. OpenAPI enum values map to Ruby - # values in the SDK as follows: - # - # 1. boolean => true | false - # 2. integer => Integer - # 3. float => Float - # 4. string => Symbol - # - # We can therefore convert string values to Symbols, but can't convert other - # values safely. - module Enum - include ModerationAPI::Internal::Type::Converter - include ModerationAPI::Internal::Util::SorbetRuntimeSupport - - # All of the valid Symbol values for this enum. - # - # @return [Array] - def values = constants.map { const_get(_1) } - - # @api public - # - # @param other [Object] - # - # @return [Boolean] - def ===(other) = values.include?(other) - - # @api public - # - # @param other [Object] - # - # @return [Boolean] - def ==(other) - # rubocop:disable Style/CaseEquality - ModerationAPI::Internal::Type::Enum === other && other.values.to_set == values.to_set - # rubocop:enable Style/CaseEquality - end - - # @api public - # - # @return [Integer] - def hash = values.to_set.hash - - # @api private - # - # Unlike with primitives, `Enum` additionally validates that the value is a member - # of the enum. - # - # @param value [String, Symbol, Object] - # - # @param state [Hash{Symbol=>Object}] . - # - # @option state [Boolean] :translate_names - # - # @option state [Boolean] :strictness - # - # @option state [Hash{Symbol=>Object}] :exactness - # - # @option state [Class] :error - # - # @option state [Integer] :branched - # - # @return [Symbol, Object] - def coerce(value, state:) - exactness = state.fetch(:exactness) - val = value.is_a?(String) ? value.to_sym : value - - if values.include?(val) - exactness[:yes] += 1 - val - elsif values.first&.class == val.class - exactness[:maybe] += 1 - value - else - exactness[:no] += 1 - state[:error] = TypeError.new("#{value.class} can't be coerced into #{self}") - value - end - end - - # @!method dump(value, state:) - # @api private - # - # @param value [Symbol, Object] - # - # @param state [Hash{Symbol=>Object}] . - # - # @option state [Boolean] :can_retry - # - # @return [Symbol, Object] - - # @api private - # - # @return [Object] - def to_sorbet_type - types = values.map { ModerationAPI::Internal::Util::SorbetRuntimeSupport.to_sorbet_type(_1) }.uniq - case types - in [] - T.noreturn - in [type] - type - else - T.any(*types) - end - end - - # @api private - # - # @param depth [Integer] - # - # @return [String] - def inspect(depth: 0) - if depth.positive? - return is_a?(Module) ? super() : self.class.name - end - - members = values.map { ModerationAPI::Internal::Type::Converter.inspect(_1, depth: depth.succ) } - prefix = is_a?(Module) ? name : self.class.name - - "#{prefix}[#{members.join(' | ')}]" - end - end - end - end -end diff --git a/lib/moderation_api/internal/type/file_input.rb b/lib/moderation_api/internal/type/file_input.rb deleted file mode 100644 index 8ed4a47a..00000000 --- a/lib/moderation_api/internal/type/file_input.rb +++ /dev/null @@ -1,111 +0,0 @@ -# frozen_string_literal: true - -module ModerationAPI - module Internal - module Type - # @api private - # - # @abstract - # - # Either `Pathname` or `StringIO`, or `IO`, or - # `ModerationAPI::Internal::Type::FileInput`. - # - # Note: when `IO` is used, all retries are disabled, since many IO` streams are - # not rewindable. - class FileInput - extend ModerationAPI::Internal::Type::Converter - - private_class_method :new - - # @api public - # - # @param other [Object] - # - # @return [Boolean] - def self.===(other) - case other - in Pathname | StringIO | IO | String | ModerationAPI::FilePart - true - else - false - end - end - - # @api public - # - # @param other [Object] - # - # @return [Boolean] - def self.==(other) = other.is_a?(Class) && other <= ModerationAPI::Internal::Type::FileInput - - class << self - # @api private - # - # @param value [StringIO, String, Object] - # - # @param state [Hash{Symbol=>Object}] . - # - # @option state [Boolean] :translate_names - # - # @option state [Boolean] :strictness - # - # @option state [Hash{Symbol=>Object}] :exactness - # - # @option state [Class] :error - # - # @option state [Integer] :branched - # - # @return [StringIO, Object] - def coerce(value, state:) - exactness = state.fetch(:exactness) - case value - in String - exactness[:yes] += 1 - StringIO.new(value) - in StringIO - exactness[:yes] += 1 - value - else - state[:error] = TypeError.new("#{value.class} can't be coerced into #{StringIO}") - exactness[:no] += 1 - value - end - end - - # @api private - # - # @param value [Pathname, StringIO, IO, String, Object] - # - # @param state [Hash{Symbol=>Object}] . - # - # @option state [Boolean] :can_retry - # - # @return [Pathname, StringIO, IO, String, Object] - def dump(value, state:) - case value - in StringIO | String - # https://datatracker.ietf.org/doc/html/rfc7578#section-4.2 - # while not required, a filename is recommended, and in practice many servers do expect this - ModerationAPI::FilePart.new(value, filename: "upload") - in IO - state[:can_retry] = false - value.to_path.nil? ? ModerationAPI::FilePart.new(value, filename: "upload") : value - in ModerationAPI::FilePart if value.content.is_a?(IO) - state[:can_retry] = false - value - else - value - end - end - - # @api private - # - # @return [Object] - def to_sorbet_type - T.any(Pathname, StringIO, IO, String, ModerationAPI::FilePart) - end - end - end - end - end -end diff --git a/lib/moderation_api/internal/type/hash_of.rb b/lib/moderation_api/internal/type/hash_of.rb deleted file mode 100644 index 4f9e7d4e..00000000 --- a/lib/moderation_api/internal/type/hash_of.rb +++ /dev/null @@ -1,188 +0,0 @@ -# frozen_string_literal: true - -module ModerationAPI - module Internal - module Type - # @api private - # - # @abstract - # - # @generic Elem - # - # Hash of items of a given type. - class HashOf - include ModerationAPI::Internal::Type::Converter - include ModerationAPI::Internal::Util::SorbetRuntimeSupport - - private_class_method :new - - # @overload [](type_info, spec = {}) - # - # @param type_info [Hash{Symbol=>Object}, Proc, ModerationAPI::Internal::Type::Converter, Class] - # - # @param spec [Hash{Symbol=>Object}] . - # - # @option spec [NilClass, TrueClass, FalseClass, Integer, Float, Symbol] :const - # - # @option spec [Proc] :enum - # - # @option spec [Proc] :union - # - # @option spec [Boolean] :"nil?" - # - # @return [self] - def self.[](...) = new(...) - - # @api public - # - # @param other [Object] - # - # @return [Boolean] - def ===(other) - type = item_type - case other - in Hash - other.all? do |key, val| - case [key, val] - in [Symbol | String, ^type] - true - else - false - end - end - else - false - end - end - - # @api public - # - # @param other [Object] - # - # @return [Boolean] - def ==(other) - # rubocop:disable Layout/LineLength - other.is_a?(ModerationAPI::Internal::Type::HashOf) && other.nilable? == nilable? && other.item_type == item_type - # rubocop:enable Layout/LineLength - end - - # @api public - # - # @return [Integer] - def hash = [self.class, item_type].hash - - # @api private - # - # @param value [Hash{Object=>Object}, Object] - # - # @param state [Hash{Symbol=>Object}] . - # - # @option state [Boolean] :translate_names - # - # @option state [Boolean] :strictness - # - # @option state [Hash{Symbol=>Object}] :exactness - # - # @option state [Class] :error - # - # @option state [Integer] :branched - # - # @return [Hash{Symbol=>Object}, Object] - def coerce(value, state:) - exactness = state.fetch(:exactness) - - unless value.is_a?(Hash) - exactness[:no] += 1 - state[:error] = TypeError.new("#{value.class} can't be coerced into #{Hash}") - return value - end - - target = item_type - exactness[:yes] += 1 - value - .to_h do |key, val| - k = key.is_a?(String) ? key.to_sym : key - v = - case [nilable?, val] - in [true, nil] - exactness[:yes] += 1 - nil - else - ModerationAPI::Internal::Type::Converter.coerce(target, val, state: state) - end - - exactness[:no] += 1 unless k.is_a?(Symbol) - [k, v] - end - end - - # @api private - # - # @param value [Hash{Object=>Object}, Object] - # - # @param state [Hash{Symbol=>Object}] . - # - # @option state [Boolean] :can_retry - # - # @return [Hash{Symbol=>Object}, Object] - def dump(value, state:) - target = item_type - if value.is_a?(Hash) - value.transform_values do - ModerationAPI::Internal::Type::Converter.dump(target, _1, state: state) - end - else - super - end - end - - # @api private - # - # @return [Object] - def to_sorbet_type - T::Hash[ModerationAPI::Internal::Util::SorbetRuntimeSupport.to_sorbet_type(item_type)] - end - - # @api private - # - # @return [generic] - protected def item_type = @item_type_fn.call - - # @api private - # - # @return [Boolean] - protected def nilable? = @nilable - - # @api private - # - # @param type_info [Hash{Symbol=>Object}, Proc, ModerationAPI::Internal::Type::Converter, Class] - # - # @param spec [Hash{Symbol=>Object}] . - # - # @option spec [NilClass, TrueClass, FalseClass, Integer, Float, Symbol] :const - # - # @option spec [Proc] :enum - # - # @option spec [Proc] :union - # - # @option spec [Boolean] :"nil?" - def initialize(type_info, spec = {}) - @item_type_fn = ModerationAPI::Internal::Type::Converter.type_info(type_info || spec) - @meta = ModerationAPI::Internal::Type::Converter.meta_info(type_info, spec) - @nilable = spec.fetch(:nil?, false) - end - - # @api private - # - # @param depth [Integer] - # - # @return [String] - def inspect(depth: 0) - items = ModerationAPI::Internal::Type::Converter.inspect(item_type, depth: depth.succ) - - "#{self.class}[#{[items, nilable? ? 'nil' : nil].compact.join(' | ')}]" - end - end - end - end -end diff --git a/lib/moderation_api/internal/type/request_parameters.rb b/lib/moderation_api/internal/type/request_parameters.rb deleted file mode 100644 index ce311c6c..00000000 --- a/lib/moderation_api/internal/type/request_parameters.rb +++ /dev/null @@ -1,42 +0,0 @@ -# frozen_string_literal: true - -module ModerationAPI - module Internal - module Type - # @api private - module RequestParameters - # @!attribute request_options - # Options to specify HTTP behaviour for this request. - # - # @return [ModerationAPI::RequestOptions, Hash{Symbol=>Object}] - - # @param mod [Module] - def self.included(mod) - raise ArgumentError.new(mod) unless mod <= ModerationAPI::Internal::Type::BaseModel - - mod.optional(:request_options, ModerationAPI::RequestOptions) - end - - # @api private - module Converter - # @api private - # - # @param params [Object] - # - # @return [Array(Object, Hash{Symbol=>Object})] - def dump_request(params) - state = {can_retry: true} - case (dumped = dump(params, state: state)) - in Hash - options = ModerationAPI::Internal::Util.coerce_hash!(dumped[:request_options]).to_h - request_options = state.fetch(:can_retry) ? options : {**options, max_retries: 0} - [dumped.except(:request_options), request_options] - else - [dumped, nil] - end - end - end - end - end - end -end diff --git a/lib/moderation_api/internal/type/union.rb b/lib/moderation_api/internal/type/union.rb deleted file mode 100644 index 39c4da9e..00000000 --- a/lib/moderation_api/internal/type/union.rb +++ /dev/null @@ -1,268 +0,0 @@ -# frozen_string_literal: true - -module ModerationAPI - module Internal - module Type - # @api private - # - # @example - # # `webhook_event` is a `ModerationAPI::WebhookEvent` - # case webhook_event - # when ModerationAPI::WebhookEvent::AuthorBlocked - # puts(webhook_event.id) - # when ModerationAPI::WebhookEvent::AuthorUnblocked - # puts(webhook_event.api_version) - # when ModerationAPI::WebhookEvent::AuthorSuspended - # puts(webhook_event.created) - # else - # puts(webhook_event) - # end - # - # @example - # case webhook_event - # in {type: :"author.blocked", id: id, api_version: api_version, created: created} - # puts(id) - # in {type: :"author.unblocked", id: id, api_version: api_version, created: created} - # puts(api_version) - # in {type: :"author.suspended", id: id, api_version: api_version, created: created} - # puts(created) - # else - # puts(webhook_event) - # end - module Union - include ModerationAPI::Internal::Type::Converter - include ModerationAPI::Internal::Util::SorbetRuntimeSupport - - # @api private - # - # All of the specified variant info for this union. - # - # @return [ArrayObject})>] - private def known_variants = (@known_variants ||= []) - - # @api private - # - # @return [ArrayObject})>] - protected def derefed_variants - known_variants.map { |key, variant_fn, meta| [key, variant_fn.call, meta] } - end - - # All of the specified variants for this union. - # - # @return [Array] - def variants = derefed_variants.map { _2 } - - # @api private - # - # @param property [Symbol] - private def discriminator(property) - case property - in Symbol - @discriminator = property - end - end - - # @api private - # - # @param key [Symbol, Hash{Symbol=>Object}, Proc, ModerationAPI::Internal::Type::Converter, Class] - # - # @param spec [Hash{Symbol=>Object}, Proc, ModerationAPI::Internal::Type::Converter, Class] . - # - # @option spec [NilClass, TrueClass, FalseClass, Integer, Float, Symbol] :const - # - # @option spec [Proc] :enum - # - # @option spec [Proc] :union - # - # @option spec [Boolean] :"nil?" - private def variant(key, spec = nil) - meta = ModerationAPI::Internal::Type::Converter.meta_info(nil, spec) - variant_info = - case key - in Symbol - [key, ModerationAPI::Internal::Type::Converter.type_info(spec), meta] - in Proc | ModerationAPI::Internal::Type::Converter | Class | Hash - [nil, ModerationAPI::Internal::Type::Converter.type_info(key), meta] - end - - known_variants << variant_info - end - - # @api private - # - # @param value [Object] - # - # @return [ModerationAPI::Internal::Type::Converter, Class, nil] - private def resolve_variant(value) - case [@discriminator, value] - in [_, ModerationAPI::Internal::Type::BaseModel] - value.class - in [Symbol, Hash] - key = value.fetch(@discriminator) do - value.fetch(@discriminator.to_s, ModerationAPI::Internal::OMIT) - end - - return nil if key == ModerationAPI::Internal::OMIT - - key = key.to_sym if key.is_a?(String) - _, found = known_variants.find { |k,| k == key } - found&.call - else - nil - end - end - - # rubocop:disable Style/HashEachMethods - # rubocop:disable Style/CaseEquality - - # @api public - # - # @param other [Object] - # - # @return [Boolean] - def ===(other) - known_variants.any? do |_, variant_fn| - variant_fn.call === other - end - end - - # @api public - # - # @param other [Object] - # - # @return [Boolean] - def ==(other) - ModerationAPI::Internal::Type::Union === other && other.derefed_variants == derefed_variants - end - - # @api public - # - # @return [Integer] - def hash = variants.hash - - # @api private - # - # Tries to efficiently coerce the given value to one of the known variants. - # - # If the value cannot match any of the known variants, the coercion is considered - # non-viable and returns the original value. - # - # @param value [Object] - # - # @param state [Hash{Symbol=>Object}] . - # - # @option state [Boolean] :translate_names - # - # @option state [Boolean] :strictness - # - # @option state [Hash{Symbol=>Object}] :exactness - # - # @option state [Class] :error - # - # @option state [Integer] :branched - # - # @return [Object] - def coerce(value, state:) - if (target = resolve_variant(value)) - return ModerationAPI::Internal::Type::Converter.coerce(target, value, state: state) - end - - strictness = state.fetch(:strictness) - exactness = state.fetch(:exactness) - - alternatives = [] - known_variants.each do |_, variant_fn| - target = variant_fn.call - exact = state[:exactness] = {yes: 0, no: 0, maybe: 0} - state[:branched] += 1 - - coerced = ModerationAPI::Internal::Type::Converter.coerce(target, value, state: state) - yes, no, maybe = exact.values - if (no + maybe).zero? || (!strictness && yes.positive?) - exact.each { exactness[_1] += _2 } - state[:exactness] = exactness - return coerced - elsif maybe.positive? - alternatives << [[-yes, -maybe, no], exact, coerced] - end - end - - case alternatives.sort_by!(&:first) - in [] - exactness[:no] += 1 - state[:error] = ArgumentError.new("no matching variant for #{value.inspect}") - value - in [[_, exact, coerced], *] - exact.each { exactness[_1] += _2 } - coerced - end - .tap { state[:exactness] = exactness } - ensure - state[:strictness] = strictness - end - - # @api private - # - # @param value [Object] - # - # @param state [Hash{Symbol=>Object}] . - # - # @option state [Boolean] :can_retry - # - # @return [Object] - def dump(value, state:) - if (target = resolve_variant(value)) - return ModerationAPI::Internal::Type::Converter.dump(target, value, state: state) - end - - known_variants.each do - target = _2.call - if target === value - return ModerationAPI::Internal::Type::Converter.dump( - target, - value, - state: state - ) - end - end - - super - end - - # @api private - # - # @return [Object] - def to_sorbet_type - types = variants.map { ModerationAPI::Internal::Util::SorbetRuntimeSupport.to_sorbet_type(_1) }.uniq - case types - in [] - T.noreturn - in [type] - type - else - T.any(*types) - end - end - - # rubocop:enable Style/CaseEquality - # rubocop:enable Style/HashEachMethods - - # @api private - # - # @param depth [Integer] - # - # @return [String] - def inspect(depth: 0) - if depth.positive? - return is_a?(Module) ? super() : self.class.name - end - - members = variants.map { ModerationAPI::Internal::Type::Converter.inspect(_1, depth: depth.succ) } - prefix = is_a?(Module) ? name : self.class.name - - "#{prefix}[#{members.join(' | ')}]" - end - end - end - end -end diff --git a/lib/moderation_api/internal/type/unknown.rb b/lib/moderation_api/internal/type/unknown.rb deleted file mode 100644 index f66db295..00000000 --- a/lib/moderation_api/internal/type/unknown.rb +++ /dev/null @@ -1,81 +0,0 @@ -# frozen_string_literal: true - -module ModerationAPI - module Internal - module Type - # @api private - # - # @abstract - # - # When we don't know what to expect for the value. - class Unknown - extend ModerationAPI::Internal::Type::Converter - extend ModerationAPI::Internal::Util::SorbetRuntimeSupport - - # rubocop:disable Lint/UnusedMethodArgument - - private_class_method :new - - # @api public - # - # @param other [Object] - # - # @return [Boolean] - def self.===(other) = true - - # @api public - # - # @param other [Object] - # - # @return [Boolean] - def self.==(other) = other.is_a?(Class) && other <= ModerationAPI::Internal::Type::Unknown - - class << self - # @api private - # - # No coercion needed for Unknown type. - # - # @param value [Object] - # - # @param state [Hash{Symbol=>Object}] . - # - # @option state [Boolean] :translate_names - # - # @option state [Boolean] :strictness - # - # @option state [Hash{Symbol=>Object}] :exactness - # - # @option state [Class] :error - # - # @option state [Integer] :branched - # - # @return [Object] - def coerce(value, state:) - state.fetch(:exactness)[:yes] += 1 - value - end - - # @!method dump(value, state:) - # @api private - # - # @param value [Object] - # - # @param state [Hash{Symbol=>Object}] . - # - # @option state [Boolean] :can_retry - # - # @return [Object] - - # @api private - # - # @return [Object] - def to_sorbet_type - T.anything - end - end - - # rubocop:enable Lint/UnusedMethodArgument - end - end - end -end diff --git a/lib/moderation_api/internal/util.rb b/lib/moderation_api/internal/util.rb deleted file mode 100644 index 4a98a137..00000000 --- a/lib/moderation_api/internal/util.rb +++ /dev/null @@ -1,966 +0,0 @@ -# frozen_string_literal: true - -module ModerationAPI - module Internal - # @api private - module Util - # @api private - # - # @return [Float] - def self.monotonic_secs = Process.clock_gettime(Process::CLOCK_MONOTONIC) - - # @api private - # - # @param ns [Module, Class] - # - # @return [Enumerable] - def self.walk_namespaces(ns) - ns.constants(false).lazy.flat_map do - case (c = ns.const_get(_1, false)) - in Module | Class - walk_namespaces(c) - else - [] - end - end - .chain([ns]) - end - - class << self - # @api private - # - # @return [String] - def arch - case (arch = RbConfig::CONFIG["arch"])&.downcase - in nil - "unknown" - in /aarch64|arm64/ - "arm64" - in /x86_64/ - "x64" - in /arm/ - "arm" - else - "other:#{arch}" - end - end - - # @api private - # - # @return [String] - def os - case (host = RbConfig::CONFIG["host_os"])&.downcase - in nil - "Unknown" - in /linux/ - "Linux" - in /darwin/ - "MacOS" - in /freebsd/ - "FreeBSD" - in /openbsd/ - "OpenBSD" - in /mswin|mingw|cygwin|ucrt/ - "Windows" - else - "Other:#{host}" - end - end - end - - class << self - # @api private - # - # @param input [Object] - # - # @return [Boolean] - def primitive?(input) - case input - in true | false | Numeric | Symbol | String - true - else - false - end - end - - # @api private - # - # @param input [String, Boolean] - # - # @return [Boolean, Object] - def coerce_boolean(input) - case input.is_a?(String) ? input.downcase : input - in "true" - true - in "false" - false - else - input - end - end - - # @api private - # - # @param input [String, Boolean] - # - # @raise [ArgumentError] - # @return [Boolean, nil] - def coerce_boolean!(input) - case coerce_boolean(input) - in true | false | nil => coerced - coerced - else - raise ArgumentError.new("Unable to coerce #{input.inspect} into boolean value") - end - end - - # @api private - # - # @param input [String, Integer] - # - # @return [Integer, Object] - def coerce_integer(input) - Integer(input, exception: false) || input - end - - # @api private - # - # @param input [String, Integer, Float] - # - # @return [Float, Object] - def coerce_float(input) - Float(input, exception: false) || input - end - - # @api private - # - # @param input [Object] - # - # @return [Hash{Object=>Object}, Object] - def coerce_hash(input) - case input - in NilClass | Array | Set | Enumerator | StringIO | IO - input - else - input.respond_to?(:to_h) ? input.to_h : input - end - end - - # @api private - # - # @param input [Object] - # - # @raise [ArgumentError] - # @return [Hash{Object=>Object}, nil] - def coerce_hash!(input) - case coerce_hash(input) - in Hash | nil => coerced - coerced - else - message = "Expected a #{Hash} or #{ModerationAPI::Internal::Type::BaseModel}, got #{input.inspect}" - raise ArgumentError.new(message) - end - end - end - - class << self - # @api private - # - # @param lhs [Object] - # @param rhs [Object] - # @param concat [Boolean] - # - # @return [Object] - private def deep_merge_lr(lhs, rhs, concat: false) - case [lhs, rhs, concat] - in [Hash, Hash, _] - lhs.merge(rhs) { deep_merge_lr(_2, _3, concat: concat) } - in [Array, Array, true] - lhs.concat(rhs) - else - rhs - end - end - - # @api private - # - # Recursively merge one hash with another. If the values at a given key are not - # both hashes, just take the new value. - # - # @param values [Array] - # - # @param sentinel [Object, nil] the value to return if no values are provided. - # - # @param concat [Boolean] whether to merge sequences by concatenation. - # - # @return [Object] - def deep_merge(*values, sentinel: nil, concat: false) - case values - in [value, *values] - values.reduce(value) do |acc, val| - deep_merge_lr(acc, val, concat: concat) - end - else - sentinel - end - end - - # @api private - # - # @param data [Hash{Symbol=>Object}, Array, Object] - # @param pick [Symbol, Integer, Array, Proc, nil] - # @param blk [Proc, nil] - # - # @return [Object, nil] - def dig(data, pick, &blk) - case [data, pick] - in [_, nil] - data - in [Hash, Symbol] | [Array, Integer] - data.fetch(pick) { blk&.call } - in [Hash | Array, Array] - pick.reduce(data) do |acc, key| - case acc - in Hash if acc.key?(key) - acc.fetch(key) - in Array if key.is_a?(Integer) && key < acc.length - acc[key] - else - return blk&.call - end - end - in [_, Proc] - pick.call(data) - else - blk&.call - end - end - end - - # @type [Regexp] - # - # https://www.rfc-editor.org/rfc/rfc3986.html#section-3.3 - RFC_3986_NOT_PCHARS = /[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/ - - class << self - # @api private - # - # @param uri [URI::Generic] - # - # @return [String] - def uri_origin(uri) - "#{uri.scheme}://#{uri.host}#{":#{uri.port}" unless uri.port == uri.default_port}" - end - - # @api private - # - # @param path [String, Integer] - # - # @return [String] - def encode_path(path) - path.to_s.gsub(ModerationAPI::Internal::Util::RFC_3986_NOT_PCHARS) { ERB::Util.url_encode(_1) } - end - - # @api private - # - # @param path [String, Array] - # - # @return [String] - def interpolate_path(path) - case path - in String - path - in [] - "" - in [String => p, *interpolations] - encoded = interpolations.map { encode_path(_1) } - format(p, *encoded) - end - end - end - - class << self - # @api private - # - # @param query [String, nil] - # - # @return [Hash{String=>Array}] - def decode_query(query) - CGI.parse(query.to_s) - end - - # @api private - # - # @param query [Hash{String=>Array, String, nil}, nil] - # - # @return [String, nil] - def encode_query(query) - query.to_h.empty? ? nil : URI.encode_www_form(query) - end - end - - class << self - # @api private - # - # @param url [URI::Generic, String] - # - # @return [Hash{Symbol=>String, Integer, nil}] - def parse_uri(url) - parsed = URI::Generic.component.zip(URI.split(url)).to_h - {**parsed, query: decode_query(parsed.fetch(:query))} - end - - # @api private - # - # @param parsed [Hash{Symbol=>String, Integer, nil}] . - # - # @option parsed [String, nil] :scheme - # - # @option parsed [String, nil] :host - # - # @option parsed [Integer, nil] :port - # - # @option parsed [String, nil] :path - # - # @option parsed [Hash{String=>Array}] :query - # - # @return [URI::Generic] - def unparse_uri(parsed) - URI::Generic.build(**parsed, query: encode_query(parsed.fetch(:query))) - end - - # @api private - # - # @param lhs [Hash{Symbol=>String, Integer, nil}] . - # - # @option lhs [String, nil] :scheme - # - # @option lhs [String, nil] :host - # - # @option lhs [Integer, nil] :port - # - # @option lhs [String, nil] :path - # - # @option lhs [Hash{String=>Array}] :query - # - # @param rhs [Hash{Symbol=>String, Integer, nil}] . - # - # @option rhs [String, nil] :scheme - # - # @option rhs [String, nil] :host - # - # @option rhs [Integer, nil] :port - # - # @option rhs [String, nil] :path - # - # @option rhs [Hash{String=>Array}] :query - # - # @return [URI::Generic] - def join_parsed_uri(lhs, rhs) - base_path, base_query = lhs.fetch_values(:path, :query) - slashed = base_path.end_with?("/") ? base_path : "#{base_path}/" - - merged = {**parse_uri(rhs.fetch(:path)), **rhs.except(:path, :query)} - parsed_path, parsed_query = merged.fetch_values(:path, :query) - override = URI::Generic.build(**merged.slice(:scheme, :host, :port), path: parsed_path) - - joined = URI.join(URI::Generic.build(lhs.except(:path, :query)), slashed, override) - query = deep_merge( - joined.path == base_path ? base_query : {}, - parsed_query, - rhs[:query].to_h, - concat: true - ) - - joined.query = encode_query(query) - joined - end - end - - class << self - # @api private - # - # @param headers [Hash{String=>String, Integer, Array, nil}] - # - # @return [Hash{String=>String}] - def normalized_headers(*headers) - {}.merge(*headers.compact).to_h do |key, val| - value = - case val - in Array - val.filter_map { _1&.to_s&.strip }.join(", ") - else - val&.to_s&.strip - end - [key.downcase, value] - end - end - end - - # @api private - # - # An adapter that satisfies the IO interface required by `::IO.copy_stream` - class ReadIOAdapter - # @api private - # - # @return [Boolean, nil] - def close? = @closing - - # @api private - def close - case @stream - in Enumerator - ModerationAPI::Internal::Util.close_fused!(@stream) - in IO if close? - @stream.close - else - end - end - - # @api private - # - # @param max_len [Integer, nil] - # - # @return [String] - private def read_enum(max_len) - case max_len - in nil - @stream.to_a.join - in Integer - @buf << @stream.next while @buf.length < max_len - @buf.slice!(..max_len) - end - rescue StopIteration - @stream = nil - @buf.slice!(0..) - end - - # @api private - # - # @param max_len [Integer, nil] - # @param out_string [String, nil] - # - # @return [String, nil] - def read(max_len = nil, out_string = nil) - case @stream - in nil - nil - in IO | StringIO - @stream.read(max_len, out_string) - in Enumerator - read = read_enum(max_len) - case out_string - in String - out_string.replace(read) - in nil - read - end - end - .tap(&@blk) - end - - # @api private - # - # @param src [String, Pathname, StringIO, Enumerable] - # @param blk [Proc] - # - # @yieldparam [String] - def initialize(src, &blk) - @stream = - case src - in String - StringIO.new(src) - in Pathname - @closing = true - src.open(binmode: true) - else - src - end - @buf = String.new - @blk = blk - end - end - - class << self - # @param blk [Proc] - # - # @yieldparam [Enumerator::Yielder] - # @return [Enumerable] - def writable_enum(&blk) - Enumerator.new do |y| - y.define_singleton_method(:write) do - self << _1.dup - _1.bytesize - end - - blk.call(y) - end - end - end - - # @type [Regexp] - JSON_CONTENT = %r{^application/(?:[a-zA-Z0-9.-]+\+)?json(?!l)} - # @type [Regexp] - JSONL_CONTENT = %r{^application/(:?x-(?:n|l)djson)|(:?(?:x-)?jsonl)} - - class << self - # @api private - # - # @param query [Hash{Symbol=>Object}] - # - # @return [Hash{Symbol=>Object}] - def encode_query_params(query) - out = {} - query.each { write_query_param_element!(out, _1, _2) } - out - end - - # @api private - # - # @param collection [Hash{Symbol=>Object}] - # @param key [String] - # @param element [Object] - # - # @return [nil] - private def write_query_param_element!(collection, key, element) - case element - in Hash - element.each do |name, value| - write_query_param_element!(collection, "#{key}[#{name}]", value) - end - in Array - collection[key] = element.map(&:to_s).join(",") - else - collection[key] = element.to_s - end - end - - # @api private - # - # @param y [Enumerator::Yielder] - # @param val [Object] - # @param closing [Array] - # @param content_type [String, nil] - private def write_multipart_content(y, val:, closing:, content_type: nil) - content_line = "Content-Type: %s\r\n\r\n" - - case val - in ModerationAPI::FilePart - return write_multipart_content( - y, - val: val.content, - closing: closing, - content_type: val.content_type - ) - in Pathname - y << format(content_line, content_type || "application/octet-stream") - io = val.open(binmode: true) - closing << io.method(:close) - IO.copy_stream(io, y) - in IO - y << format(content_line, content_type || "application/octet-stream") - IO.copy_stream(val, y) - in StringIO - y << format(content_line, content_type || "application/octet-stream") - y << val.string - in -> { primitive?(_1) } - y << format(content_line, content_type || "text/plain") - y << val.to_s - else - y << format(content_line, content_type || "application/json") - y << JSON.generate(val) - end - y << "\r\n" - end - - # @api private - # - # @param y [Enumerator::Yielder] - # @param boundary [String] - # @param key [Symbol, String] - # @param val [Object] - # @param closing [Array] - private def write_multipart_chunk(y, boundary:, key:, val:, closing:) - y << "--#{boundary}\r\n" - y << "Content-Disposition: form-data" - - unless key.nil? - y << "; name=\"#{key}\"" - end - - case val - in ModerationAPI::FilePart unless val.filename.nil? - filename = encode_path(val.filename) - y << "; filename=\"#{filename}\"" - in Pathname | IO - filename = encode_path(::File.basename(val.to_path)) - y << "; filename=\"#{filename}\"" - else - end - y << "\r\n" - - write_multipart_content(y, val: val, closing: closing) - end - - # @api private - # - # https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.1.md#special-considerations-for-multipart-content - # - # @param body [Object] - # - # @return [Array(String, Enumerable)] - private def encode_multipart_streaming(body) - # rubocop:disable Style/CaseEquality - # RFC 1521 Section 7.2.1 says we should have 70 char maximum for boundary length - boundary = SecureRandom.urlsafe_base64(46) - - closing = [] - strio = writable_enum do |y| - case body - in Hash - body.each do |key, val| - case val - in Array if val.all? { primitive?(_1) || ModerationAPI::Internal::Type::FileInput === _1 } - val.each do |v| - write_multipart_chunk(y, boundary: boundary, key: key, val: v, closing: closing) - end - else - write_multipart_chunk(y, boundary: boundary, key: key, val: val, closing: closing) - end - end - else - write_multipart_chunk(y, boundary: boundary, key: nil, val: body, closing: closing) - end - y << "--#{boundary}--\r\n" - end - - fused_io = fused_enum(strio) { closing.each(&:call) } - [boundary, fused_io] - # rubocop:enable Style/CaseEquality - end - - # @api private - # - # @param headers [Hash{String=>String}] - # @param body [Object] - # - # @return [Object] - def encode_content(headers, body) - # rubocop:disable Style/CaseEquality - # rubocop:disable Layout/LineLength - content_type = headers["content-type"] - case [content_type, body] - in [ModerationAPI::Internal::Util::JSON_CONTENT, Hash | Array | -> { primitive?(_1) }] - [headers, JSON.generate(body)] - in [ModerationAPI::Internal::Util::JSONL_CONTENT, Enumerable] unless ModerationAPI::Internal::Type::FileInput === body - [headers, body.lazy.map { JSON.generate(_1) }] - in [%r{^multipart/form-data}, Hash | ModerationAPI::Internal::Type::FileInput] - boundary, strio = encode_multipart_streaming(body) - headers = {**headers, "content-type" => "#{content_type}; boundary=#{boundary}"} - [headers, strio] - in [_, Symbol | Numeric] - [headers, body.to_s] - in [_, StringIO] - [headers, body.string] - in [_, ModerationAPI::FilePart] - [headers, body.content] - else - [headers, body] - end - # rubocop:enable Layout/LineLength - # rubocop:enable Style/CaseEquality - end - - # @api private - # - # https://www.iana.org/assignments/character-sets/character-sets.xhtml - # - # @param content_type [String] - # @param text [String] - def force_charset!(content_type, text:) - charset = /charset=([^;\s]+)/.match(content_type)&.captures&.first - - return unless charset - - begin - encoding = Encoding.find(charset) - text.force_encoding(encoding) - rescue ArgumentError - nil - end - end - - # @api private - # - # Assumes each chunk in stream has `Encoding::BINARY`. - # - # @param headers [Hash{String=>String}] - # @param stream [Enumerable] - # @param suppress_error [Boolean] - # - # @raise [JSON::ParserError] - # @return [Object] - def decode_content(headers, stream:, suppress_error: false) - case (content_type = headers["content-type"]) - in ModerationAPI::Internal::Util::JSON_CONTENT - return nil if (json = stream.to_a.join).empty? - - begin - JSON.parse(json, symbolize_names: true) - rescue JSON::ParserError => e - raise e unless suppress_error - json - end - in ModerationAPI::Internal::Util::JSONL_CONTENT - lines = decode_lines(stream) - chain_fused(lines) do |y| - lines.each do - next if _1.empty? - - y << JSON.parse(_1, symbolize_names: true) - end - end - in %r{^text/event-stream} - lines = decode_lines(stream) - decode_sse(lines) - else - text = stream.to_a.join - force_charset!(content_type, text: text) - StringIO.new(text) - end - end - end - - class << self - # @api private - # - # https://doc.rust-lang.org/std/iter/trait.FusedIterator.html - # - # @param enum [Enumerable] - # @param external [Boolean] - # @param close [Proc] - # - # @return [Enumerable] - def fused_enum(enum, external: false, &close) - fused = false - iter = Enumerator.new do |y| - next if fused - - fused = true - if external - loop { y << enum.next } - else - enum.each(&y) - end - ensure - close&.call - close = nil - end - - iter.define_singleton_method(:rewind) do - fused = true - self - end - iter - end - - # @api private - # - # @param enum [Enumerable, nil] - def close_fused!(enum) - return unless enum.is_a?(Enumerator) - - # rubocop:disable Lint/UnreachableLoop - enum.rewind.each { break } - # rubocop:enable Lint/UnreachableLoop - end - - # @api private - # - # @param enum [Enumerable, nil] - # @param blk [Proc] - # - # @yieldparam [Enumerator::Yielder] - # @return [Enumerable] - def chain_fused(enum, &blk) - iter = Enumerator.new { blk.call(_1) } - fused_enum(iter) { close_fused!(enum) } - end - end - - class << self - # @api private - # - # Assumes Strings have been forced into having `Encoding::BINARY`. - # - # This decoder is responsible for reassembling lines split across multiple - # fragments. - # - # @param enum [Enumerable] - # - # @return [Enumerable] - def decode_lines(enum) - re = /(\r\n|\r|\n)/ - buffer = String.new - cr_seen = nil - - chain_fused(enum) do |y| - enum.each do |row| - offset = buffer.bytesize - buffer << row - while (match = re.match(buffer, cr_seen&.to_i || offset)) - case [match.captures.first, cr_seen] - in ["\r", nil] - cr_seen = match.end(1) - next - in ["\r" | "\r\n", Integer] - y << buffer.slice!(..(cr_seen.pred)) - else - y << buffer.slice!(..(match.end(1).pred)) - end - offset = 0 - cr_seen = nil - end - end - - y << buffer.slice!(..(cr_seen.pred)) unless cr_seen.nil? - y << buffer unless buffer.empty? - end - end - - # @api private - # - # https://html.spec.whatwg.org/multipage/server-sent-events.html#parsing-an-event-stream - # - # Assumes that `lines` has been decoded with `#decode_lines`. - # - # @param lines [Enumerable] - # - # @return [EnumerableObject}>] - def decode_sse(lines) - # rubocop:disable Metrics/BlockLength - chain_fused(lines) do |y| - blank = {event: nil, data: nil, id: nil, retry: nil} - current = {} - - lines.each do |line| - case line.sub(/\R$/, "") - in "" - next if current.empty? - y << {**blank, **current} - current = {} - in /^:/ - next - in /^([^:]+):\s?(.*)$/ - field, value = Regexp.last_match.captures - case field - in "event" - current.merge!(event: value) - in "data" - (current[:data] ||= String.new) << (value << "\n") - in "id" unless value.include?("\0") - current.merge!(id: value) - in "retry" if /^\d+$/ =~ value - current.merge!(retry: Integer(value)) - else - end - else - end - end - # rubocop:enable Metrics/BlockLength - - y << {**blank, **current} unless current.empty? - end - end - end - - # @api private - module SorbetRuntimeSupport - class MissingSorbetRuntimeError < ::RuntimeError - end - - # @api private - # - # @return [Hash{Symbol=>Object}] - private def sorbet_runtime_constants = @sorbet_runtime_constants ||= {} - - # @api private - # - # @param name [Symbol] - def const_missing(name) - super unless sorbet_runtime_constants.key?(name) - - unless Object.const_defined?(:T) - message = "Trying to access a Sorbet constant #{name.inspect} without `sorbet-runtime`." - raise MissingSorbetRuntimeError.new(message) - end - - sorbet_runtime_constants.fetch(name).call - end - - # @api private - # - # @param name [Symbol] - # - # @return [Boolean] - def sorbet_constant_defined?(name) = sorbet_runtime_constants.key?(name) - - # @api private - # - # @param name [Symbol] - # @param blk [Proc] - def define_sorbet_constant!(name, &blk) = sorbet_runtime_constants.store(name, blk) - - # @api private - # - # @return [Object] - def to_sorbet_type = raise NotImplementedError - - class << self - # @api private - # - # @param type [ModerationAPI::Internal::Util::SorbetRuntimeSupport, Object] - # - # @return [Object] - def to_sorbet_type(type) - case type - in ModerationAPI::Internal::Util::SorbetRuntimeSupport - type.to_sorbet_type - in Class | Module - type - in true | false - T::Boolean - else - type.class - end - end - end - end - - extend ModerationAPI::Internal::Util::SorbetRuntimeSupport - - define_sorbet_constant!(:ParsedUri) do - T.type_alias do - { - scheme: T.nilable(String), - host: T.nilable(String), - port: T.nilable(Integer), - path: T.nilable(String), - query: T::Hash[String, T::Array[String]] - } - end - end - - define_sorbet_constant!(:ServerSentEvent) do - T.type_alias do - { - event: T.nilable(String), - data: T.nilable(String), - id: T.nilable(String), - retry: T.nilable(Integer) - } - end - end - end - end -end diff --git a/lib/moderation_api/items.rb b/lib/moderation_api/items.rb new file mode 100644 index 00000000..c7f440f2 --- /dev/null +++ b/lib/moderation_api/items.rb @@ -0,0 +1,919 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +require "faraday" +require "faraday/multipart" +require "faraday/retry" +require "sorbet-runtime" +require "janeway" + +require_relative "sdk_hooks/hooks" +require_relative "utils/retries" + +module ModerationApi + extend T::Sig + + class Items + extend T::Sig + + sig { params(sdk_config: SDKConfiguration).void } + def initialize(sdk_config) + @sdk_configuration = sdk_config + end + + sig { params(base_url: String, url_variables: T.nilable(T::Hash[Symbol, T.any(String, T::Enum)])).returns(String) } + def get_url(base_url:, url_variables: nil) + sd_base_url, sd_options = @sdk_configuration.get_server_details + + if base_url.nil? + base_url = sd_base_url + end + + if url_variables.nil? + url_variables = sd_options + end + + return Utils.template_url(base_url, url_variables) + end + + sig { + params( + request: Models::Operations::ListQueueItemsRequest, + timeout_ms: T.nilable(Integer), + http_headers: T.nilable(T::Hash[T.any(String, Symbol), String]) + ) + .returns(Models::Operations::ListQueueItemsResponse) + } + def list(request:, timeout_ms: nil, http_headers: nil) + # list - Get queue items + # Get paginated list of items in a moderation queue with filtering options + url, params = @sdk_configuration.get_server_details + base_url = Utils.template_url(url, params) + url = Utils.generate_url( + Models::Operations::ListQueueItemsRequest, + base_url, + "/queue/{id}/items", + request + ) + headers = {} + headers = T.cast(headers, T::Hash[String, String]) + query_params = Utils.get_query_params(Models::Operations::ListQueueItemsRequest, request, nil) + headers["Accept"] = "application/json" + headers["user-agent"] = @sdk_configuration.user_agent + + security = @sdk_configuration.security_source&.call + + timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil? + timeout ||= @sdk_configuration.timeout + + connection = @sdk_configuration.client + + hook_ctx = SDKHooks::HookContext.new( + config: @sdk_configuration, + base_url: base_url, + oauth2_scopes: nil, + operation_id: "listQueueItems", + security_source: @sdk_configuration.security_source + ) + + error = T.let(nil, T.nilable(StandardError)) + http_response = T.let(nil, T.nilable(Faraday::Response)) + + begin + http_response = T.must(connection).get(url) do |req| + req.headers.merge!(headers) + req.options.timeout = timeout unless timeout.nil? + req.params = query_params + Utils.configure_request_security(req, security) + http_headers&.each do |key, value| + req.headers[key.to_s] = value + end + + @sdk_configuration.hooks.before_request( + hook_ctx: SDKHooks::BeforeRequestHookContext.new( + hook_ctx: hook_ctx + ), + request: req + ) + end + + rescue StandardError => e + error = e + ensure + if http_response.nil? || Utils.error_status?(http_response.status) + http_response = @sdk_configuration.hooks.after_error( + error: error, + hook_ctx: SDKHooks::AfterErrorHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + else + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + end + + if http_response.nil? + raise error if !error.nil? + raise "no response" + end + end + + content_type = http_response.headers.fetch("Content-Type", "application/octet-stream") + if Utils.match_status_code(http_response.status, ["200"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Operations::ListQueueItemsResponseBody) + response = Models::Operations::ListQueueItemsResponse.new( + status_code: http_response.status, + content_type: content_type, + raw_response: http_response, + object: T.unsafe(obj) + ) + sdk = self + + response.next_page = proc do + request_page = T.must(!request.page.nil? ? request.page : 1) + next_page = request_page + 1 + num_pages = Janeway.enum_for("$.pagination.totalPages", JSON.parse(response_data)).search + if num_pages.nil? || num_pages[0] <= request_page + next nil + end + + if !response_data + next nil + end + + results = Janeway.enum_for("$.data", JSON.parse(response_data)).search + if results.is_a?(Array) + results = results[0] + end + + if results.count.zero? + next nil + end + + request_limit = !request.page_size.nil? ? request.page_size : 20 + if results.count < request_limit + next nil + end + + sdk.list( + request: Models::Operations::ListQueueItemsRequest.new( + id: request.id, + page: next_page, + page_size: request.page_size, + sort_field: request.sort_field, + sort_direction: request.sort_direction, + conversation_ids: request.conversation_ids, + labels: request.labels, + after_date: request.after_date, + before_date: request.before_date, + include_resolved: request.include_resolved, + author_id: request.author_id, + filtered_action_ids: request.filtered_action_ids + ), + http_headers: http_headers + ) + end + + return response + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["400"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::BadRequestError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["401"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::AuthenticationError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["403"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::PermissionDeniedError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["404"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::NotFoundError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["429"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::RateLimitError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["500"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::InternalServerError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["4XX"]) + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "API error occurred" + ) + elsif Utils.match_status_code(http_response.status, ["5XX"]) + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "API error occurred" + ) + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown status code received" + ) + + end + end + + sig { + params( + body: Models::Operations::ResolveQueueItemRequestBody, + id: ::String, + item_id: ::String, + timeout_ms: T.nilable(Integer), + http_headers: T.nilable(T::Hash[T.any(String, Symbol), String]) + ) + .returns(Models::Operations::ResolveQueueItemResponse) + } + def resolve(body:, id:, item_id:, timeout_ms: nil, http_headers: nil) + # resolve - Resolve a queue item + # Mark a queue item as resolved with a specific moderation action + request = Models::Operations::ResolveQueueItemRequest.new( + id: id, + item_id: item_id, + body: body + ) + url, params = @sdk_configuration.get_server_details + base_url = Utils.template_url(url, params) + url = Utils.generate_url( + Models::Operations::ResolveQueueItemRequest, + base_url, + "/queue/{id}/items/{itemId}/resolve", + request + ) + headers = {} + headers = T.cast(headers, T::Hash[String, String]) + req_content_type, data, form = Utils.serialize_request_body(request, false, false, :body, :json) + headers["content-type"] = req_content_type + raise StandardError, "request body is required" if data.nil? && form.nil? + + if form && !form.empty? + body = Utils.encode_form(form) + elsif Utils.match_content_type(req_content_type, "application/x-www-form-urlencoded") + body = URI.encode_www_form(T.cast(data, T::Hash[Symbol, Object])) + else + body = data + end + + headers["Accept"] = "application/json" + headers["user-agent"] = @sdk_configuration.user_agent + + security = @sdk_configuration.security_source&.call + + timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil? + timeout ||= @sdk_configuration.timeout + + connection = @sdk_configuration.client + + hook_ctx = SDKHooks::HookContext.new( + config: @sdk_configuration, + base_url: base_url, + oauth2_scopes: nil, + operation_id: "resolveQueueItem", + security_source: @sdk_configuration.security_source + ) + + error = T.let(nil, T.nilable(StandardError)) + http_response = T.let(nil, T.nilable(Faraday::Response)) + + begin + http_response = T.must(connection).post(url) do |req| + req.body = body + req.headers.merge!(headers) + req.options.timeout = timeout unless timeout.nil? + Utils.configure_request_security(req, security) + http_headers&.each do |key, value| + req.headers[key.to_s] = value + end + + @sdk_configuration.hooks.before_request( + hook_ctx: SDKHooks::BeforeRequestHookContext.new( + hook_ctx: hook_ctx + ), + request: req + ) + end + + rescue StandardError => e + error = e + ensure + if http_response.nil? || Utils.error_status?(http_response.status) + http_response = @sdk_configuration.hooks.after_error( + error: error, + hook_ctx: SDKHooks::AfterErrorHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + else + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + end + + if http_response.nil? + raise error if !error.nil? + raise "no response" + end + end + + content_type = http_response.headers.fetch("Content-Type", "application/octet-stream") + if Utils.match_status_code(http_response.status, ["200"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Operations::ResolveQueueItemResponseBody) + response = Models::Operations::ResolveQueueItemResponse.new( + status_code: http_response.status, + content_type: content_type, + raw_response: http_response, + object: T.unsafe(obj) + ) + + return response + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["400"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::BadRequestError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["401"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::AuthenticationError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["403"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::PermissionDeniedError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["429"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::RateLimitError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["500"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::InternalServerError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["4XX"]) + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "API error occurred" + ) + elsif Utils.match_status_code(http_response.status, ["5XX"]) + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "API error occurred" + ) + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown status code received" + ) + + end + end + + sig { + params( + body: Models::Operations::UnresolveQueueItemRequestBody, + id: ::String, + item_id: ::String, + timeout_ms: T.nilable(Integer), + http_headers: T.nilable(T::Hash[T.any(String, Symbol), String]) + ) + .returns(Models::Operations::UnresolveQueueItemResponse) + } + def unresolve(body:, id:, item_id:, timeout_ms: nil, http_headers: nil) + # unresolve - Unresolve a queue item + # Mark a previously resolved queue item as unresolved/pending + request = Models::Operations::UnresolveQueueItemRequest.new( + id: id, + item_id: item_id, + body: body + ) + url, params = @sdk_configuration.get_server_details + base_url = Utils.template_url(url, params) + url = Utils.generate_url( + Models::Operations::UnresolveQueueItemRequest, + base_url, + "/queue/{id}/items/{itemId}/unresolve", + request + ) + headers = {} + headers = T.cast(headers, T::Hash[String, String]) + req_content_type, data, form = Utils.serialize_request_body(request, false, false, :body, :json) + headers["content-type"] = req_content_type + raise StandardError, "request body is required" if data.nil? && form.nil? + + if form && !form.empty? + body = Utils.encode_form(form) + elsif Utils.match_content_type(req_content_type, "application/x-www-form-urlencoded") + body = URI.encode_www_form(T.cast(data, T::Hash[Symbol, Object])) + else + body = data + end + + headers["Accept"] = "application/json" + headers["user-agent"] = @sdk_configuration.user_agent + + security = @sdk_configuration.security_source&.call + + timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil? + timeout ||= @sdk_configuration.timeout + + connection = @sdk_configuration.client + + hook_ctx = SDKHooks::HookContext.new( + config: @sdk_configuration, + base_url: base_url, + oauth2_scopes: nil, + operation_id: "unresolveQueueItem", + security_source: @sdk_configuration.security_source + ) + + error = T.let(nil, T.nilable(StandardError)) + http_response = T.let(nil, T.nilable(Faraday::Response)) + + begin + http_response = T.must(connection).post(url) do |req| + req.body = body + req.headers.merge!(headers) + req.options.timeout = timeout unless timeout.nil? + Utils.configure_request_security(req, security) + http_headers&.each do |key, value| + req.headers[key.to_s] = value + end + + @sdk_configuration.hooks.before_request( + hook_ctx: SDKHooks::BeforeRequestHookContext.new( + hook_ctx: hook_ctx + ), + request: req + ) + end + + rescue StandardError => e + error = e + ensure + if http_response.nil? || Utils.error_status?(http_response.status) + http_response = @sdk_configuration.hooks.after_error( + error: error, + hook_ctx: SDKHooks::AfterErrorHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + else + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + end + + if http_response.nil? + raise error if !error.nil? + raise "no response" + end + end + + content_type = http_response.headers.fetch("Content-Type", "application/octet-stream") + if Utils.match_status_code(http_response.status, ["200"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json( + JSON.parse(response_data), + Models::Operations::UnresolveQueueItemResponseBody + ) + response = Models::Operations::UnresolveQueueItemResponse.new( + status_code: http_response.status, + content_type: content_type, + raw_response: http_response, + object: T.unsafe(obj) + ) + + return response + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["400"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::BadRequestError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["401"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::AuthenticationError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["403"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::PermissionDeniedError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["429"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::RateLimitError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["500"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::InternalServerError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["4XX"]) + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "API error occurred" + ) + elsif Utils.match_status_code(http_response.status, ["5XX"]) + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "API error occurred" + ) + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown status code received" + ) + + end + end + end +end diff --git a/lib/moderation_api/models.rb b/lib/moderation_api/models.rb deleted file mode 100644 index 3df2dc44..00000000 --- a/lib/moderation_api/models.rb +++ /dev/null @@ -1,106 +0,0 @@ -# frozen_string_literal: true - -module ModerationAPI - [ - ModerationAPI::Internal::Type::BaseModel, - *ModerationAPI::Internal::Type::BaseModel.subclasses - ].each do |cls| - cls.define_sorbet_constant!(:OrHash) { T.type_alias { T.any(cls, ModerationAPI::Internal::AnyHash) } } - end - - ModerationAPI::Internal::Util.walk_namespaces(ModerationAPI::Models).each do |mod| - case mod - in ModerationAPI::Internal::Type::Enum | ModerationAPI::Internal::Type::Union - mod.constants.each do |name| - case mod.const_get(name) - in true | false - mod.define_sorbet_constant!(:TaggedBoolean) { T.type_alias { T::Boolean } } - mod.define_sorbet_constant!(:OrBoolean) { T.type_alias { T::Boolean } } - in Integer - mod.define_sorbet_constant!(:TaggedInteger) { T.type_alias { Integer } } - mod.define_sorbet_constant!(:OrInteger) { T.type_alias { Integer } } - in Float - mod.define_sorbet_constant!(:TaggedFloat) { T.type_alias { Float } } - mod.define_sorbet_constant!(:OrFloat) { T.type_alias { Float } } - in Symbol - mod.define_sorbet_constant!(:TaggedSymbol) { T.type_alias { Symbol } } - mod.define_sorbet_constant!(:OrSymbol) { T.type_alias { T.any(Symbol, String) } } - else - end - end - else - end - end - - ModerationAPI::Internal::Util.walk_namespaces(ModerationAPI::Models) - .lazy - .grep(ModerationAPI::Internal::Type::Union) - .each do |mod| - const = :Variants - next if mod.sorbet_constant_defined?(const) - - mod.define_sorbet_constant!(const) { T.type_alias { mod.to_sorbet_type } } - end - - AccountListParams = ModerationAPI::Models::AccountListParams - - ActionCreateParams = ModerationAPI::Models::ActionCreateParams - - ActionDeleteParams = ModerationAPI::Models::ActionDeleteParams - - ActionListParams = ModerationAPI::Models::ActionListParams - - ActionRetrieveParams = ModerationAPI::Models::ActionRetrieveParams - - Actions = ModerationAPI::Models::Actions - - ActionUpdateParams = ModerationAPI::Models::ActionUpdateParams - - AuthCreateParams = ModerationAPI::Models::AuthCreateParams - - AuthorCreateParams = ModerationAPI::Models::AuthorCreateParams - - AuthorDeleteParams = ModerationAPI::Models::AuthorDeleteParams - - AuthorListParams = ModerationAPI::Models::AuthorListParams - - AuthorRetrieveParams = ModerationAPI::Models::AuthorRetrieveParams - - AuthorUpdateParams = ModerationAPI::Models::AuthorUpdateParams - - AuthRetrieveParams = ModerationAPI::Models::AuthRetrieveParams - - ContentStreamParams = ModerationAPI::Models::ContentStreamParams - - ContentSubmitParams = ModerationAPI::Models::ContentSubmitParams - - Queue = ModerationAPI::Models::Queue - - QueueGetStatsParams = ModerationAPI::Models::QueueGetStatsParams - - QueueRetrieveParams = ModerationAPI::Models::QueueRetrieveParams - - WebhookCreateParams = ModerationAPI::Models::WebhookCreateParams - - WebhookDeleteParams = ModerationAPI::Models::WebhookDeleteParams - - WebhookEvent = ModerationAPI::Models::WebhookEvent - - WebhookListParams = ModerationAPI::Models::WebhookListParams - - WebhookRetrieveParams = ModerationAPI::Models::WebhookRetrieveParams - - WebhookSecretRetrieveParams = ModerationAPI::Models::WebhookSecretRetrieveParams - - WebhookUpdateParams = ModerationAPI::Models::WebhookUpdateParams - - Wordlist = ModerationAPI::Models::Wordlist - - WordlistGetEmbeddingStatusParams = ModerationAPI::Models::WordlistGetEmbeddingStatusParams - - WordlistListParams = ModerationAPI::Models::WordlistListParams - - WordlistRetrieveParams = ModerationAPI::Models::WordlistRetrieveParams - - WordlistUpdateParams = ModerationAPI::Models::WordlistUpdateParams -end diff --git a/lib/moderation_api/models/account_list_params.rb b/lib/moderation_api/models/account_list_params.rb deleted file mode 100644 index ddf7db89..00000000 --- a/lib/moderation_api/models/account_list_params.rb +++ /dev/null @@ -1,14 +0,0 @@ -# frozen_string_literal: true - -module ModerationAPI - module Models - # @see ModerationAPI::Resources::Account#list - class AccountListParams < ModerationAPI::Internal::Type::BaseModel - extend ModerationAPI::Internal::Type::RequestParameters::Converter - include ModerationAPI::Internal::Type::RequestParameters - - # @!method initialize(request_options: {}) - # @param request_options [ModerationAPI::RequestOptions, Hash{Symbol=>Object}] - end - end -end diff --git a/lib/moderation_api/models/account_list_response.rb b/lib/moderation_api/models/account_list_response.rb deleted file mode 100644 index cf00f17c..00000000 --- a/lib/moderation_api/models/account_list_response.rb +++ /dev/null @@ -1,68 +0,0 @@ -# frozen_string_literal: true - -module ModerationAPI - module Models - # @see ModerationAPI::Resources::Account#list - class AccountListResponse < ModerationAPI::Internal::Type::BaseModel - # @!attribute id - # ID of the account - # - # @return [String] - required :id, String - - # @!attribute paid_plan_name - # Name of the paid plan - # - # @return [String] - required :paid_plan_name, String - - # @!attribute remaining_quota - # Remaining quota - # - # @return [Float] - required :remaining_quota, Float - - # @!attribute text_api_quota - # Text API quota - # - # @return [Float] - required :text_api_quota, Float - - # @!attribute current_project - # - # @return [ModerationAPI::Models::AccountListResponse::CurrentProject, nil] - optional :current_project, -> { ModerationAPI::Models::AccountListResponse::CurrentProject } - - # @!method initialize(id:, paid_plan_name:, remaining_quota:, text_api_quota:, current_project: nil) - # @param id [String] ID of the account - # - # @param paid_plan_name [String] Name of the paid plan - # - # @param remaining_quota [Float] Remaining quota - # - # @param text_api_quota [Float] Text API quota - # - # @param current_project [ModerationAPI::Models::AccountListResponse::CurrentProject] - - # @see ModerationAPI::Models::AccountListResponse#current_project - class CurrentProject < ModerationAPI::Internal::Type::BaseModel - # @!attribute id - # ID of the current project - # - # @return [String] - required :id, String - - # @!attribute name - # Name of the current project - # - # @return [String] - required :name, String - - # @!method initialize(id:, name:) - # @param id [String] ID of the current project - # - # @param name [String] Name of the current project - end - end - end -end diff --git a/lib/moderation_api/models/action_create_params.rb b/lib/moderation_api/models/action_create_params.rb deleted file mode 100644 index 465536e7..00000000 --- a/lib/moderation_api/models/action_create_params.rb +++ /dev/null @@ -1,173 +0,0 @@ -# frozen_string_literal: true - -module ModerationAPI - module Models - # @see ModerationAPI::Resources::Actions#create - class ActionCreateParams < ModerationAPI::Internal::Type::BaseModel - extend ModerationAPI::Internal::Type::RequestParameters::Converter - include ModerationAPI::Internal::Type::RequestParameters - - # @!attribute name - # The name of the action. - # - # @return [String] - required :name, String - - # @!attribute built_in - # Whether the action is a built-in action or a custom one. - # - # @return [Boolean, nil] - optional :built_in, ModerationAPI::Internal::Type::Boolean, api_name: :builtIn, nil?: true - - # @!attribute description - # The description of the action. - # - # @return [String, nil] - optional :description, String, nil?: true - - # @!attribute filter_in_queue_ids - # The IDs of the queues the action is available in. - # - # @return [Array, nil] - optional :filter_in_queue_ids, - ModerationAPI::Internal::Type::ArrayOf[String], - api_name: :filterInQueueIds - - # @!attribute free_text - # Whether the action allows any text to be entered as a value or if it must be one - # of the possible values. - # - # @return [Boolean, nil] - optional :free_text, ModerationAPI::Internal::Type::Boolean, api_name: :freeText - - # @!attribute key - # User defined key of the action. - # - # @return [String, nil] - optional :key, String, nil?: true - - # @!attribute position - # Show the action in all queues, selected queues or no queues (to use via API - # only). - # - # @return [Symbol, ModerationAPI::Models::ActionCreateParams::Position, nil] - optional :position, enum: -> { ModerationAPI::ActionCreateParams::Position } - - # @!attribute possible_values - # The possible values of the action. The user will be prompted to select one of - # these values when executing the action. - # - # @return [Array, nil] - optional :possible_values, - -> { - ModerationAPI::Internal::Type::ArrayOf[ModerationAPI::ActionCreateParams::PossibleValue] - }, - api_name: :possibleValues - - # @!attribute queue_behaviour - # Whether the action resolves and removes the item, unresolves and re-add it to - # the queue, or does not change the resolve status. - # - # @return [Symbol, ModerationAPI::Models::ActionCreateParams::QueueBehaviour, nil] - optional :queue_behaviour, - enum: -> { ModerationAPI::ActionCreateParams::QueueBehaviour }, - api_name: :queueBehaviour - - # @!attribute type - # The type of the action. - # - # @return [Symbol, ModerationAPI::Models::ActionCreateParams::Type, nil] - optional :type, enum: -> { ModerationAPI::ActionCreateParams::Type }, nil?: true - - # @!attribute value_required - # Whether the action requires a value to be executed. - # - # @return [Boolean, nil] - optional :value_required, ModerationAPI::Internal::Type::Boolean, api_name: :valueRequired - - # @!method initialize(name:, built_in: nil, description: nil, filter_in_queue_ids: nil, free_text: nil, key: nil, position: nil, possible_values: nil, queue_behaviour: nil, type: nil, value_required: nil, request_options: {}) - # Some parameter documentations has been truncated, see - # {ModerationAPI::Models::ActionCreateParams} for more details. - # - # @param name [String] The name of the action. - # - # @param built_in [Boolean, nil] Whether the action is a built-in action or a custom one. - # - # @param description [String, nil] The description of the action. - # - # @param filter_in_queue_ids [Array] The IDs of the queues the action is available in. - # - # @param free_text [Boolean] Whether the action allows any text to be entered as a value or if it must be one - # - # @param key [String, nil] User defined key of the action. - # - # @param position [Symbol, ModerationAPI::Models::ActionCreateParams::Position] Show the action in all queues, selected queues or no queues (to use via API only - # - # @param possible_values [Array] The possible values of the action. The user will be prompted to select one of th - # - # @param queue_behaviour [Symbol, ModerationAPI::Models::ActionCreateParams::QueueBehaviour] Whether the action resolves and removes the item, unresolves and re-add it to th - # - # @param type [Symbol, ModerationAPI::Models::ActionCreateParams::Type, nil] The type of the action. - # - # @param value_required [Boolean] Whether the action requires a value to be executed. - # - # @param request_options [ModerationAPI::RequestOptions, Hash{Symbol=>Object}] - - # Show the action in all queues, selected queues or no queues (to use via API - # only). - module Position - extend ModerationAPI::Internal::Type::Enum - - ALL_QUEUES = :ALL_QUEUES - SOME_QUEUES = :SOME_QUEUES - HIDDEN = :HIDDEN - - # @!method self.values - # @return [Array] - end - - class PossibleValue < ModerationAPI::Internal::Type::BaseModel - # @!attribute value - # The value of the action. - # - # @return [String] - required :value, String - - # @!method initialize(value:) - # @param value [String] The value of the action. - end - - # Whether the action resolves and removes the item, unresolves and re-add it to - # the queue, or does not change the resolve status. - module QueueBehaviour - extend ModerationAPI::Internal::Type::Enum - - REMOVE = :REMOVE - ADD = :ADD - NO_CHANGE = :NO_CHANGE - - # @!method self.values - # @return [Array] - end - - # The type of the action. - module Type - extend ModerationAPI::Internal::Type::Enum - - AUTHOR_BLOCK = :AUTHOR_BLOCK - AUTHOR_BLOCK_TEMP = :AUTHOR_BLOCK_TEMP - AUTHOR_UNBLOCK = :AUTHOR_UNBLOCK - AUTHOR_DELETE = :AUTHOR_DELETE - AUTHOR_REPORT = :AUTHOR_REPORT - AUTHOR_WARN = :AUTHOR_WARN - AUTHOR_CUSTOM = :AUTHOR_CUSTOM - ITEM_REJECT = :ITEM_REJECT - ITEM_ALLOW = :ITEM_ALLOW - ITEM_CUSTOM = :ITEM_CUSTOM - - # @!method self.values - # @return [Array] - end - end - end -end diff --git a/lib/moderation_api/models/action_create_response.rb b/lib/moderation_api/models/action_create_response.rb deleted file mode 100644 index 1288fda3..00000000 --- a/lib/moderation_api/models/action_create_response.rb +++ /dev/null @@ -1,188 +0,0 @@ -# frozen_string_literal: true - -module ModerationAPI - module Models - # @see ModerationAPI::Resources::Actions#create - class ActionCreateResponse < ModerationAPI::Internal::Type::BaseModel - # @!attribute id - # The ID of the action. - # - # @return [String] - required :id, String - - # @!attribute built_in - # Whether the action is a built-in action or a custom one. - # - # @return [Boolean, nil] - required :built_in, ModerationAPI::Internal::Type::Boolean, api_name: :builtIn, nil?: true - - # @!attribute created_at - # The date the action was created. - # - # @return [String] - required :created_at, String, api_name: :createdAt - - # @!attribute filter_in_queue_ids - # The IDs of the queues the action is available in. - # - # @return [Array] - required :filter_in_queue_ids, - ModerationAPI::Internal::Type::ArrayOf[String], - api_name: :filterInQueueIds - - # @!attribute free_text - # Whether the action allows any text to be entered as a value or if it must be one - # of the possible values. - # - # @return [Boolean] - required :free_text, ModerationAPI::Internal::Type::Boolean, api_name: :freeText - - # @!attribute name - # The name of the action. - # - # @return [String] - required :name, String - - # @!attribute position - # Show the action in all queues, selected queues or no queues (to use via API - # only). - # - # @return [Symbol, ModerationAPI::Models::ActionCreateResponse::Position] - required :position, enum: -> { ModerationAPI::Models::ActionCreateResponse::Position } - - # @!attribute possible_values - # The possible values of the action. The user will be prompted to select one of - # these values when executing the action. - # - # @return [Array] - required :possible_values, - -> { ModerationAPI::Internal::Type::ArrayOf[ModerationAPI::Models::ActionCreateResponse::PossibleValue] }, - api_name: :possibleValues - - # @!attribute queue_behaviour - # Whether the action resolves and removes the item, unresolves and re-add it to - # the queue, or does not change the resolve status. - # - # @return [Symbol, ModerationAPI::Models::ActionCreateResponse::QueueBehaviour] - required :queue_behaviour, - enum: -> { ModerationAPI::Models::ActionCreateResponse::QueueBehaviour }, - api_name: :queueBehaviour - - # @!attribute value_required - # Whether the action requires a value to be executed. - # - # @return [Boolean] - required :value_required, ModerationAPI::Internal::Type::Boolean, api_name: :valueRequired - - # @!attribute description - # The description of the action. - # - # @return [String, nil] - optional :description, String, nil?: true - - # @!attribute key - # User defined key of the action. - # - # @return [String, nil] - optional :key, String, nil?: true - - # @!attribute type - # The type of the action. - # - # @return [Symbol, ModerationAPI::Models::ActionCreateResponse::Type, nil] - optional :type, enum: -> { ModerationAPI::Models::ActionCreateResponse::Type }, nil?: true - - # @!method initialize(id:, built_in:, created_at:, filter_in_queue_ids:, free_text:, name:, position:, possible_values:, queue_behaviour:, value_required:, description: nil, key: nil, type: nil) - # Some parameter documentations has been truncated, see - # {ModerationAPI::Models::ActionCreateResponse} for more details. - # - # @param id [String] The ID of the action. - # - # @param built_in [Boolean, nil] Whether the action is a built-in action or a custom one. - # - # @param created_at [String] The date the action was created. - # - # @param filter_in_queue_ids [Array] The IDs of the queues the action is available in. - # - # @param free_text [Boolean] Whether the action allows any text to be entered as a value or if it must be one - # - # @param name [String] The name of the action. - # - # @param position [Symbol, ModerationAPI::Models::ActionCreateResponse::Position] Show the action in all queues, selected queues or no queues (to use via API only - # - # @param possible_values [Array] The possible values of the action. The user will be prompted to select one of th - # - # @param queue_behaviour [Symbol, ModerationAPI::Models::ActionCreateResponse::QueueBehaviour] Whether the action resolves and removes the item, unresolves and re-add it to th - # - # @param value_required [Boolean] Whether the action requires a value to be executed. - # - # @param description [String, nil] The description of the action. - # - # @param key [String, nil] User defined key of the action. - # - # @param type [Symbol, ModerationAPI::Models::ActionCreateResponse::Type, nil] The type of the action. - - # Show the action in all queues, selected queues or no queues (to use via API - # only). - # - # @see ModerationAPI::Models::ActionCreateResponse#position - module Position - extend ModerationAPI::Internal::Type::Enum - - ALL_QUEUES = :ALL_QUEUES - SOME_QUEUES = :SOME_QUEUES - HIDDEN = :HIDDEN - - # @!method self.values - # @return [Array] - end - - class PossibleValue < ModerationAPI::Internal::Type::BaseModel - # @!attribute value - # The value of the action. - # - # @return [String] - required :value, String - - # @!method initialize(value:) - # @param value [String] The value of the action. - end - - # Whether the action resolves and removes the item, unresolves and re-add it to - # the queue, or does not change the resolve status. - # - # @see ModerationAPI::Models::ActionCreateResponse#queue_behaviour - module QueueBehaviour - extend ModerationAPI::Internal::Type::Enum - - REMOVE = :REMOVE - ADD = :ADD - NO_CHANGE = :NO_CHANGE - - # @!method self.values - # @return [Array] - end - - # The type of the action. - # - # @see ModerationAPI::Models::ActionCreateResponse#type - module Type - extend ModerationAPI::Internal::Type::Enum - - AUTHOR_BLOCK = :AUTHOR_BLOCK - AUTHOR_BLOCK_TEMP = :AUTHOR_BLOCK_TEMP - AUTHOR_UNBLOCK = :AUTHOR_UNBLOCK - AUTHOR_DELETE = :AUTHOR_DELETE - AUTHOR_REPORT = :AUTHOR_REPORT - AUTHOR_WARN = :AUTHOR_WARN - AUTHOR_CUSTOM = :AUTHOR_CUSTOM - ITEM_REJECT = :ITEM_REJECT - ITEM_ALLOW = :ITEM_ALLOW - ITEM_CUSTOM = :ITEM_CUSTOM - - # @!method self.values - # @return [Array] - end - end - end -end diff --git a/lib/moderation_api/models/action_delete_params.rb b/lib/moderation_api/models/action_delete_params.rb deleted file mode 100644 index 85b3bede..00000000 --- a/lib/moderation_api/models/action_delete_params.rb +++ /dev/null @@ -1,22 +0,0 @@ -# frozen_string_literal: true - -module ModerationAPI - module Models - # @see ModerationAPI::Resources::Actions#delete - class ActionDeleteParams < ModerationAPI::Internal::Type::BaseModel - extend ModerationAPI::Internal::Type::RequestParameters::Converter - include ModerationAPI::Internal::Type::RequestParameters - - # @!attribute id - # The ID of the action to delete. - # - # @return [String] - required :id, String - - # @!method initialize(id:, request_options: {}) - # @param id [String] The ID of the action to delete. - # - # @param request_options [ModerationAPI::RequestOptions, Hash{Symbol=>Object}] - end - end -end diff --git a/lib/moderation_api/models/action_delete_response.rb b/lib/moderation_api/models/action_delete_response.rb deleted file mode 100644 index 10b46e64..00000000 --- a/lib/moderation_api/models/action_delete_response.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true - -module ModerationAPI - module Models - # @see ModerationAPI::Resources::Actions#delete - class ActionDeleteResponse < ModerationAPI::Internal::Type::BaseModel - # @!attribute id - # The ID of the action. - # - # @return [String] - required :id, String - - # @!attribute deleted - # Whether the action was deleted. - # - # @return [Boolean] - required :deleted, ModerationAPI::Internal::Type::Boolean - - # @!method initialize(id:, deleted:) - # @param id [String] The ID of the action. - # - # @param deleted [Boolean] Whether the action was deleted. - end - end -end diff --git a/lib/moderation_api/models/action_list_params.rb b/lib/moderation_api/models/action_list_params.rb deleted file mode 100644 index 997f5864..00000000 --- a/lib/moderation_api/models/action_list_params.rb +++ /dev/null @@ -1,20 +0,0 @@ -# frozen_string_literal: true - -module ModerationAPI - module Models - # @see ModerationAPI::Resources::Actions#list - class ActionListParams < ModerationAPI::Internal::Type::BaseModel - extend ModerationAPI::Internal::Type::RequestParameters::Converter - include ModerationAPI::Internal::Type::RequestParameters - - # @!attribute queue_id - # - # @return [String, nil] - optional :queue_id, String - - # @!method initialize(queue_id: nil, request_options: {}) - # @param queue_id [String] - # @param request_options [ModerationAPI::RequestOptions, Hash{Symbol=>Object}] - end - end -end diff --git a/lib/moderation_api/models/action_list_response.rb b/lib/moderation_api/models/action_list_response.rb deleted file mode 100644 index ad7d7f29..00000000 --- a/lib/moderation_api/models/action_list_response.rb +++ /dev/null @@ -1,191 +0,0 @@ -# frozen_string_literal: true - -module ModerationAPI - module Models - class ActionListResponseItem < ModerationAPI::Internal::Type::BaseModel - # @!attribute id - # The ID of the action. - # - # @return [String] - required :id, String - - # @!attribute built_in - # Whether the action is a built-in action or a custom one. - # - # @return [Boolean, nil] - required :built_in, ModerationAPI::Internal::Type::Boolean, api_name: :builtIn, nil?: true - - # @!attribute created_at - # The date the action was created. - # - # @return [String] - required :created_at, String, api_name: :createdAt - - # @!attribute filter_in_queue_ids - # The IDs of the queues the action is available in. - # - # @return [Array] - required :filter_in_queue_ids, - ModerationAPI::Internal::Type::ArrayOf[String], - api_name: :filterInQueueIds - - # @!attribute free_text - # Whether the action allows any text to be entered as a value or if it must be one - # of the possible values. - # - # @return [Boolean] - required :free_text, ModerationAPI::Internal::Type::Boolean, api_name: :freeText - - # @!attribute name - # The name of the action. - # - # @return [String] - required :name, String - - # @!attribute position - # Show the action in all queues, selected queues or no queues (to use via API - # only). - # - # @return [Symbol, ModerationAPI::Models::ActionListResponseItem::Position] - required :position, enum: -> { ModerationAPI::Models::ActionListResponseItem::Position } - - # @!attribute possible_values - # The possible values of the action. The user will be prompted to select one of - # these values when executing the action. - # - # @return [Array] - required :possible_values, - -> { ModerationAPI::Internal::Type::ArrayOf[ModerationAPI::Models::ActionListResponseItem::PossibleValue] }, - api_name: :possibleValues - - # @!attribute queue_behaviour - # Whether the action resolves and removes the item, unresolves and re-add it to - # the queue, or does not change the resolve status. - # - # @return [Symbol, ModerationAPI::Models::ActionListResponseItem::QueueBehaviour] - required :queue_behaviour, - enum: -> { ModerationAPI::Models::ActionListResponseItem::QueueBehaviour }, - api_name: :queueBehaviour - - # @!attribute value_required - # Whether the action requires a value to be executed. - # - # @return [Boolean] - required :value_required, ModerationAPI::Internal::Type::Boolean, api_name: :valueRequired - - # @!attribute description - # The description of the action. - # - # @return [String, nil] - optional :description, String, nil?: true - - # @!attribute key - # User defined key of the action. - # - # @return [String, nil] - optional :key, String, nil?: true - - # @!attribute type - # The type of the action. - # - # @return [Symbol, ModerationAPI::Models::ActionListResponseItem::Type, nil] - optional :type, enum: -> { ModerationAPI::Models::ActionListResponseItem::Type }, nil?: true - - # @!method initialize(id:, built_in:, created_at:, filter_in_queue_ids:, free_text:, name:, position:, possible_values:, queue_behaviour:, value_required:, description: nil, key: nil, type: nil) - # Some parameter documentations has been truncated, see - # {ModerationAPI::Models::ActionListResponseItem} for more details. - # - # @param id [String] The ID of the action. - # - # @param built_in [Boolean, nil] Whether the action is a built-in action or a custom one. - # - # @param created_at [String] The date the action was created. - # - # @param filter_in_queue_ids [Array] The IDs of the queues the action is available in. - # - # @param free_text [Boolean] Whether the action allows any text to be entered as a value or if it must be one - # - # @param name [String] The name of the action. - # - # @param position [Symbol, ModerationAPI::Models::ActionListResponseItem::Position] Show the action in all queues, selected queues or no queues (to use via API only - # - # @param possible_values [Array] The possible values of the action. The user will be prompted to select one of th - # - # @param queue_behaviour [Symbol, ModerationAPI::Models::ActionListResponseItem::QueueBehaviour] Whether the action resolves and removes the item, unresolves and re-add it to th - # - # @param value_required [Boolean] Whether the action requires a value to be executed. - # - # @param description [String, nil] The description of the action. - # - # @param key [String, nil] User defined key of the action. - # - # @param type [Symbol, ModerationAPI::Models::ActionListResponseItem::Type, nil] The type of the action. - - # Show the action in all queues, selected queues or no queues (to use via API - # only). - # - # @see ModerationAPI::Models::ActionListResponseItem#position - module Position - extend ModerationAPI::Internal::Type::Enum - - ALL_QUEUES = :ALL_QUEUES - SOME_QUEUES = :SOME_QUEUES - HIDDEN = :HIDDEN - - # @!method self.values - # @return [Array] - end - - class PossibleValue < ModerationAPI::Internal::Type::BaseModel - # @!attribute value - # The value of the action. - # - # @return [String] - required :value, String - - # @!method initialize(value:) - # @param value [String] The value of the action. - end - - # Whether the action resolves and removes the item, unresolves and re-add it to - # the queue, or does not change the resolve status. - # - # @see ModerationAPI::Models::ActionListResponseItem#queue_behaviour - module QueueBehaviour - extend ModerationAPI::Internal::Type::Enum - - REMOVE = :REMOVE - ADD = :ADD - NO_CHANGE = :NO_CHANGE - - # @!method self.values - # @return [Array] - end - - # The type of the action. - # - # @see ModerationAPI::Models::ActionListResponseItem#type - module Type - extend ModerationAPI::Internal::Type::Enum - - AUTHOR_BLOCK = :AUTHOR_BLOCK - AUTHOR_BLOCK_TEMP = :AUTHOR_BLOCK_TEMP - AUTHOR_UNBLOCK = :AUTHOR_UNBLOCK - AUTHOR_DELETE = :AUTHOR_DELETE - AUTHOR_REPORT = :AUTHOR_REPORT - AUTHOR_WARN = :AUTHOR_WARN - AUTHOR_CUSTOM = :AUTHOR_CUSTOM - ITEM_REJECT = :ITEM_REJECT - ITEM_ALLOW = :ITEM_ALLOW - ITEM_CUSTOM = :ITEM_CUSTOM - - # @!method self.values - # @return [Array] - end - end - - # @type [ModerationAPI::Internal::Type::Converter] - ActionListResponse = - ModerationAPI::Internal::Type::ArrayOf[-> { ModerationAPI::Models::ActionListResponseItem }] - end -end diff --git a/lib/moderation_api/models/action_retrieve_params.rb b/lib/moderation_api/models/action_retrieve_params.rb deleted file mode 100644 index 9705cbc3..00000000 --- a/lib/moderation_api/models/action_retrieve_params.rb +++ /dev/null @@ -1,22 +0,0 @@ -# frozen_string_literal: true - -module ModerationAPI - module Models - # @see ModerationAPI::Resources::Actions#retrieve - class ActionRetrieveParams < ModerationAPI::Internal::Type::BaseModel - extend ModerationAPI::Internal::Type::RequestParameters::Converter - include ModerationAPI::Internal::Type::RequestParameters - - # @!attribute id - # The ID of the action to get. - # - # @return [String] - required :id, String - - # @!method initialize(id:, request_options: {}) - # @param id [String] The ID of the action to get. - # - # @param request_options [ModerationAPI::RequestOptions, Hash{Symbol=>Object}] - end - end -end diff --git a/lib/moderation_api/models/action_retrieve_response.rb b/lib/moderation_api/models/action_retrieve_response.rb deleted file mode 100644 index 847b0c1d..00000000 --- a/lib/moderation_api/models/action_retrieve_response.rb +++ /dev/null @@ -1,188 +0,0 @@ -# frozen_string_literal: true - -module ModerationAPI - module Models - # @see ModerationAPI::Resources::Actions#retrieve - class ActionRetrieveResponse < ModerationAPI::Internal::Type::BaseModel - # @!attribute id - # The ID of the action. - # - # @return [String] - required :id, String - - # @!attribute built_in - # Whether the action is a built-in action or a custom one. - # - # @return [Boolean, nil] - required :built_in, ModerationAPI::Internal::Type::Boolean, api_name: :builtIn, nil?: true - - # @!attribute created_at - # The date the action was created. - # - # @return [String] - required :created_at, String, api_name: :createdAt - - # @!attribute filter_in_queue_ids - # The IDs of the queues the action is available in. - # - # @return [Array] - required :filter_in_queue_ids, - ModerationAPI::Internal::Type::ArrayOf[String], - api_name: :filterInQueueIds - - # @!attribute free_text - # Whether the action allows any text to be entered as a value or if it must be one - # of the possible values. - # - # @return [Boolean] - required :free_text, ModerationAPI::Internal::Type::Boolean, api_name: :freeText - - # @!attribute name - # The name of the action. - # - # @return [String] - required :name, String - - # @!attribute position - # Show the action in all queues, selected queues or no queues (to use via API - # only). - # - # @return [Symbol, ModerationAPI::Models::ActionRetrieveResponse::Position] - required :position, enum: -> { ModerationAPI::Models::ActionRetrieveResponse::Position } - - # @!attribute possible_values - # The possible values of the action. The user will be prompted to select one of - # these values when executing the action. - # - # @return [Array] - required :possible_values, - -> { ModerationAPI::Internal::Type::ArrayOf[ModerationAPI::Models::ActionRetrieveResponse::PossibleValue] }, - api_name: :possibleValues - - # @!attribute queue_behaviour - # Whether the action resolves and removes the item, unresolves and re-add it to - # the queue, or does not change the resolve status. - # - # @return [Symbol, ModerationAPI::Models::ActionRetrieveResponse::QueueBehaviour] - required :queue_behaviour, - enum: -> { ModerationAPI::Models::ActionRetrieveResponse::QueueBehaviour }, - api_name: :queueBehaviour - - # @!attribute value_required - # Whether the action requires a value to be executed. - # - # @return [Boolean] - required :value_required, ModerationAPI::Internal::Type::Boolean, api_name: :valueRequired - - # @!attribute description - # The description of the action. - # - # @return [String, nil] - optional :description, String, nil?: true - - # @!attribute key - # User defined key of the action. - # - # @return [String, nil] - optional :key, String, nil?: true - - # @!attribute type - # The type of the action. - # - # @return [Symbol, ModerationAPI::Models::ActionRetrieveResponse::Type, nil] - optional :type, enum: -> { ModerationAPI::Models::ActionRetrieveResponse::Type }, nil?: true - - # @!method initialize(id:, built_in:, created_at:, filter_in_queue_ids:, free_text:, name:, position:, possible_values:, queue_behaviour:, value_required:, description: nil, key: nil, type: nil) - # Some parameter documentations has been truncated, see - # {ModerationAPI::Models::ActionRetrieveResponse} for more details. - # - # @param id [String] The ID of the action. - # - # @param built_in [Boolean, nil] Whether the action is a built-in action or a custom one. - # - # @param created_at [String] The date the action was created. - # - # @param filter_in_queue_ids [Array] The IDs of the queues the action is available in. - # - # @param free_text [Boolean] Whether the action allows any text to be entered as a value or if it must be one - # - # @param name [String] The name of the action. - # - # @param position [Symbol, ModerationAPI::Models::ActionRetrieveResponse::Position] Show the action in all queues, selected queues or no queues (to use via API only - # - # @param possible_values [Array] The possible values of the action. The user will be prompted to select one of th - # - # @param queue_behaviour [Symbol, ModerationAPI::Models::ActionRetrieveResponse::QueueBehaviour] Whether the action resolves and removes the item, unresolves and re-add it to th - # - # @param value_required [Boolean] Whether the action requires a value to be executed. - # - # @param description [String, nil] The description of the action. - # - # @param key [String, nil] User defined key of the action. - # - # @param type [Symbol, ModerationAPI::Models::ActionRetrieveResponse::Type, nil] The type of the action. - - # Show the action in all queues, selected queues or no queues (to use via API - # only). - # - # @see ModerationAPI::Models::ActionRetrieveResponse#position - module Position - extend ModerationAPI::Internal::Type::Enum - - ALL_QUEUES = :ALL_QUEUES - SOME_QUEUES = :SOME_QUEUES - HIDDEN = :HIDDEN - - # @!method self.values - # @return [Array] - end - - class PossibleValue < ModerationAPI::Internal::Type::BaseModel - # @!attribute value - # The value of the action. - # - # @return [String] - required :value, String - - # @!method initialize(value:) - # @param value [String] The value of the action. - end - - # Whether the action resolves and removes the item, unresolves and re-add it to - # the queue, or does not change the resolve status. - # - # @see ModerationAPI::Models::ActionRetrieveResponse#queue_behaviour - module QueueBehaviour - extend ModerationAPI::Internal::Type::Enum - - REMOVE = :REMOVE - ADD = :ADD - NO_CHANGE = :NO_CHANGE - - # @!method self.values - # @return [Array] - end - - # The type of the action. - # - # @see ModerationAPI::Models::ActionRetrieveResponse#type - module Type - extend ModerationAPI::Internal::Type::Enum - - AUTHOR_BLOCK = :AUTHOR_BLOCK - AUTHOR_BLOCK_TEMP = :AUTHOR_BLOCK_TEMP - AUTHOR_UNBLOCK = :AUTHOR_UNBLOCK - AUTHOR_DELETE = :AUTHOR_DELETE - AUTHOR_REPORT = :AUTHOR_REPORT - AUTHOR_WARN = :AUTHOR_WARN - AUTHOR_CUSTOM = :AUTHOR_CUSTOM - ITEM_REJECT = :ITEM_REJECT - ITEM_ALLOW = :ITEM_ALLOW - ITEM_CUSTOM = :ITEM_CUSTOM - - # @!method self.values - # @return [Array] - end - end - end -end diff --git a/lib/moderation_api/models/action_update_params.rb b/lib/moderation_api/models/action_update_params.rb deleted file mode 100644 index 75f88d8c..00000000 --- a/lib/moderation_api/models/action_update_params.rb +++ /dev/null @@ -1,181 +0,0 @@ -# frozen_string_literal: true - -module ModerationAPI - module Models - # @see ModerationAPI::Resources::Actions#update - class ActionUpdateParams < ModerationAPI::Internal::Type::BaseModel - extend ModerationAPI::Internal::Type::RequestParameters::Converter - include ModerationAPI::Internal::Type::RequestParameters - - # @!attribute id - # The ID of the action to update. - # - # @return [String] - required :id, String - - # @!attribute built_in - # Whether the action is a built-in action or a custom one. - # - # @return [Boolean, nil] - optional :built_in, ModerationAPI::Internal::Type::Boolean, api_name: :builtIn, nil?: true - - # @!attribute description - # The description of the action. - # - # @return [String, nil] - optional :description, String, nil?: true - - # @!attribute filter_in_queue_ids - # The IDs of the queues the action is available in. - # - # @return [Array, nil] - optional :filter_in_queue_ids, - ModerationAPI::Internal::Type::ArrayOf[String], - api_name: :filterInQueueIds - - # @!attribute free_text - # Whether the action allows any text to be entered as a value or if it must be one - # of the possible values. - # - # @return [Boolean, nil] - optional :free_text, ModerationAPI::Internal::Type::Boolean, api_name: :freeText - - # @!attribute key - # User defined key of the action. - # - # @return [String, nil] - optional :key, String, nil?: true - - # @!attribute name - # The name of the action. - # - # @return [String, nil] - optional :name, String - - # @!attribute position - # Show the action in all queues, selected queues or no queues (to use via API - # only). - # - # @return [Symbol, ModerationAPI::Models::ActionUpdateParams::Position, nil] - optional :position, enum: -> { ModerationAPI::ActionUpdateParams::Position } - - # @!attribute possible_values - # The possible values of the action. The user will be prompted to select one of - # these values when executing the action. - # - # @return [Array, nil] - optional :possible_values, - -> { - ModerationAPI::Internal::Type::ArrayOf[ModerationAPI::ActionUpdateParams::PossibleValue] - }, - api_name: :possibleValues - - # @!attribute queue_behaviour - # Whether the action resolves and removes the item, unresolves and re-add it to - # the queue, or does not change the resolve status. - # - # @return [Symbol, ModerationAPI::Models::ActionUpdateParams::QueueBehaviour, nil] - optional :queue_behaviour, - enum: -> { ModerationAPI::ActionUpdateParams::QueueBehaviour }, - api_name: :queueBehaviour - - # @!attribute type - # The type of the action. - # - # @return [Symbol, ModerationAPI::Models::ActionUpdateParams::Type, nil] - optional :type, enum: -> { ModerationAPI::ActionUpdateParams::Type }, nil?: true - - # @!attribute value_required - # Whether the action requires a value to be executed. - # - # @return [Boolean, nil] - optional :value_required, ModerationAPI::Internal::Type::Boolean, api_name: :valueRequired - - # @!method initialize(id:, built_in: nil, description: nil, filter_in_queue_ids: nil, free_text: nil, key: nil, name: nil, position: nil, possible_values: nil, queue_behaviour: nil, type: nil, value_required: nil, request_options: {}) - # Some parameter documentations has been truncated, see - # {ModerationAPI::Models::ActionUpdateParams} for more details. - # - # @param id [String] The ID of the action to update. - # - # @param built_in [Boolean, nil] Whether the action is a built-in action or a custom one. - # - # @param description [String, nil] The description of the action. - # - # @param filter_in_queue_ids [Array] The IDs of the queues the action is available in. - # - # @param free_text [Boolean] Whether the action allows any text to be entered as a value or if it must be one - # - # @param key [String, nil] User defined key of the action. - # - # @param name [String] The name of the action. - # - # @param position [Symbol, ModerationAPI::Models::ActionUpdateParams::Position] Show the action in all queues, selected queues or no queues (to use via API only - # - # @param possible_values [Array] The possible values of the action. The user will be prompted to select one of th - # - # @param queue_behaviour [Symbol, ModerationAPI::Models::ActionUpdateParams::QueueBehaviour] Whether the action resolves and removes the item, unresolves and re-add it to th - # - # @param type [Symbol, ModerationAPI::Models::ActionUpdateParams::Type, nil] The type of the action. - # - # @param value_required [Boolean] Whether the action requires a value to be executed. - # - # @param request_options [ModerationAPI::RequestOptions, Hash{Symbol=>Object}] - - # Show the action in all queues, selected queues or no queues (to use via API - # only). - module Position - extend ModerationAPI::Internal::Type::Enum - - ALL_QUEUES = :ALL_QUEUES - SOME_QUEUES = :SOME_QUEUES - HIDDEN = :HIDDEN - - # @!method self.values - # @return [Array] - end - - class PossibleValue < ModerationAPI::Internal::Type::BaseModel - # @!attribute value - # The value of the action. - # - # @return [String] - required :value, String - - # @!method initialize(value:) - # @param value [String] The value of the action. - end - - # Whether the action resolves and removes the item, unresolves and re-add it to - # the queue, or does not change the resolve status. - module QueueBehaviour - extend ModerationAPI::Internal::Type::Enum - - REMOVE = :REMOVE - ADD = :ADD - NO_CHANGE = :NO_CHANGE - - # @!method self.values - # @return [Array] - end - - # The type of the action. - module Type - extend ModerationAPI::Internal::Type::Enum - - AUTHOR_BLOCK = :AUTHOR_BLOCK - AUTHOR_BLOCK_TEMP = :AUTHOR_BLOCK_TEMP - AUTHOR_UNBLOCK = :AUTHOR_UNBLOCK - AUTHOR_DELETE = :AUTHOR_DELETE - AUTHOR_REPORT = :AUTHOR_REPORT - AUTHOR_WARN = :AUTHOR_WARN - AUTHOR_CUSTOM = :AUTHOR_CUSTOM - ITEM_REJECT = :ITEM_REJECT - ITEM_ALLOW = :ITEM_ALLOW - ITEM_CUSTOM = :ITEM_CUSTOM - - # @!method self.values - # @return [Array] - end - end - end -end diff --git a/lib/moderation_api/models/action_update_response.rb b/lib/moderation_api/models/action_update_response.rb deleted file mode 100644 index 0485497f..00000000 --- a/lib/moderation_api/models/action_update_response.rb +++ /dev/null @@ -1,188 +0,0 @@ -# frozen_string_literal: true - -module ModerationAPI - module Models - # @see ModerationAPI::Resources::Actions#update - class ActionUpdateResponse < ModerationAPI::Internal::Type::BaseModel - # @!attribute id - # The ID of the action. - # - # @return [String] - required :id, String - - # @!attribute built_in - # Whether the action is a built-in action or a custom one. - # - # @return [Boolean, nil] - required :built_in, ModerationAPI::Internal::Type::Boolean, api_name: :builtIn, nil?: true - - # @!attribute created_at - # The date the action was created. - # - # @return [String] - required :created_at, String, api_name: :createdAt - - # @!attribute filter_in_queue_ids - # The IDs of the queues the action is available in. - # - # @return [Array] - required :filter_in_queue_ids, - ModerationAPI::Internal::Type::ArrayOf[String], - api_name: :filterInQueueIds - - # @!attribute free_text - # Whether the action allows any text to be entered as a value or if it must be one - # of the possible values. - # - # @return [Boolean] - required :free_text, ModerationAPI::Internal::Type::Boolean, api_name: :freeText - - # @!attribute name - # The name of the action. - # - # @return [String] - required :name, String - - # @!attribute position - # Show the action in all queues, selected queues or no queues (to use via API - # only). - # - # @return [Symbol, ModerationAPI::Models::ActionUpdateResponse::Position] - required :position, enum: -> { ModerationAPI::Models::ActionUpdateResponse::Position } - - # @!attribute possible_values - # The possible values of the action. The user will be prompted to select one of - # these values when executing the action. - # - # @return [Array] - required :possible_values, - -> { ModerationAPI::Internal::Type::ArrayOf[ModerationAPI::Models::ActionUpdateResponse::PossibleValue] }, - api_name: :possibleValues - - # @!attribute queue_behaviour - # Whether the action resolves and removes the item, unresolves and re-add it to - # the queue, or does not change the resolve status. - # - # @return [Symbol, ModerationAPI::Models::ActionUpdateResponse::QueueBehaviour] - required :queue_behaviour, - enum: -> { ModerationAPI::Models::ActionUpdateResponse::QueueBehaviour }, - api_name: :queueBehaviour - - # @!attribute value_required - # Whether the action requires a value to be executed. - # - # @return [Boolean] - required :value_required, ModerationAPI::Internal::Type::Boolean, api_name: :valueRequired - - # @!attribute description - # The description of the action. - # - # @return [String, nil] - optional :description, String, nil?: true - - # @!attribute key - # User defined key of the action. - # - # @return [String, nil] - optional :key, String, nil?: true - - # @!attribute type - # The type of the action. - # - # @return [Symbol, ModerationAPI::Models::ActionUpdateResponse::Type, nil] - optional :type, enum: -> { ModerationAPI::Models::ActionUpdateResponse::Type }, nil?: true - - # @!method initialize(id:, built_in:, created_at:, filter_in_queue_ids:, free_text:, name:, position:, possible_values:, queue_behaviour:, value_required:, description: nil, key: nil, type: nil) - # Some parameter documentations has been truncated, see - # {ModerationAPI::Models::ActionUpdateResponse} for more details. - # - # @param id [String] The ID of the action. - # - # @param built_in [Boolean, nil] Whether the action is a built-in action or a custom one. - # - # @param created_at [String] The date the action was created. - # - # @param filter_in_queue_ids [Array] The IDs of the queues the action is available in. - # - # @param free_text [Boolean] Whether the action allows any text to be entered as a value or if it must be one - # - # @param name [String] The name of the action. - # - # @param position [Symbol, ModerationAPI::Models::ActionUpdateResponse::Position] Show the action in all queues, selected queues or no queues (to use via API only - # - # @param possible_values [Array] The possible values of the action. The user will be prompted to select one of th - # - # @param queue_behaviour [Symbol, ModerationAPI::Models::ActionUpdateResponse::QueueBehaviour] Whether the action resolves and removes the item, unresolves and re-add it to th - # - # @param value_required [Boolean] Whether the action requires a value to be executed. - # - # @param description [String, nil] The description of the action. - # - # @param key [String, nil] User defined key of the action. - # - # @param type [Symbol, ModerationAPI::Models::ActionUpdateResponse::Type, nil] The type of the action. - - # Show the action in all queues, selected queues or no queues (to use via API - # only). - # - # @see ModerationAPI::Models::ActionUpdateResponse#position - module Position - extend ModerationAPI::Internal::Type::Enum - - ALL_QUEUES = :ALL_QUEUES - SOME_QUEUES = :SOME_QUEUES - HIDDEN = :HIDDEN - - # @!method self.values - # @return [Array] - end - - class PossibleValue < ModerationAPI::Internal::Type::BaseModel - # @!attribute value - # The value of the action. - # - # @return [String] - required :value, String - - # @!method initialize(value:) - # @param value [String] The value of the action. - end - - # Whether the action resolves and removes the item, unresolves and re-add it to - # the queue, or does not change the resolve status. - # - # @see ModerationAPI::Models::ActionUpdateResponse#queue_behaviour - module QueueBehaviour - extend ModerationAPI::Internal::Type::Enum - - REMOVE = :REMOVE - ADD = :ADD - NO_CHANGE = :NO_CHANGE - - # @!method self.values - # @return [Array] - end - - # The type of the action. - # - # @see ModerationAPI::Models::ActionUpdateResponse#type - module Type - extend ModerationAPI::Internal::Type::Enum - - AUTHOR_BLOCK = :AUTHOR_BLOCK - AUTHOR_BLOCK_TEMP = :AUTHOR_BLOCK_TEMP - AUTHOR_UNBLOCK = :AUTHOR_UNBLOCK - AUTHOR_DELETE = :AUTHOR_DELETE - AUTHOR_REPORT = :AUTHOR_REPORT - AUTHOR_WARN = :AUTHOR_WARN - AUTHOR_CUSTOM = :AUTHOR_CUSTOM - ITEM_REJECT = :ITEM_REJECT - ITEM_ALLOW = :ITEM_ALLOW - ITEM_CUSTOM = :ITEM_CUSTOM - - # @!method self.values - # @return [Array] - end - end - end -end diff --git a/lib/moderation_api/models/actions/execute_execute_by_id_params.rb b/lib/moderation_api/models/actions/execute_execute_by_id_params.rb deleted file mode 100644 index 9aec2cbc..00000000 --- a/lib/moderation_api/models/actions/execute_execute_by_id_params.rb +++ /dev/null @@ -1,56 +0,0 @@ -# frozen_string_literal: true - -module ModerationAPI - module Models - module Actions - # @see ModerationAPI::Resources::Actions::Execute#execute_by_id - class ExecuteExecuteByIDParams < ModerationAPI::Internal::Type::BaseModel - extend ModerationAPI::Internal::Type::RequestParameters::Converter - include ModerationAPI::Internal::Type::RequestParameters - - # @!attribute action_id - # The ID or key of the action to execute. - # - # @return [String] - required :action_id, String - - # @!attribute author_ids - # IDs of the authors to apply the action to - # - # @return [Array, nil] - optional :author_ids, ModerationAPI::Internal::Type::ArrayOf[String], api_name: :authorIds - - # @!attribute content_ids - # The IDs of the content items to perform the action on. - # - # @return [Array, nil] - optional :content_ids, ModerationAPI::Internal::Type::ArrayOf[String], api_name: :contentIds - - # @!attribute queue_id - # The ID of the queue the action was performed from if any. - # - # @return [String, nil] - optional :queue_id, String, api_name: :queueId - - # @!attribute value - # The value of the action. Useful to set a reason for the action etc. - # - # @return [String, nil] - optional :value, String - - # @!method initialize(action_id:, author_ids: nil, content_ids: nil, queue_id: nil, value: nil, request_options: {}) - # @param action_id [String] The ID or key of the action to execute. - # - # @param author_ids [Array] IDs of the authors to apply the action to - # - # @param content_ids [Array] The IDs of the content items to perform the action on. - # - # @param queue_id [String] The ID of the queue the action was performed from if any. - # - # @param value [String] The value of the action. Useful to set a reason for the action etc. - # - # @param request_options [ModerationAPI::RequestOptions, Hash{Symbol=>Object}] - end - end - end -end diff --git a/lib/moderation_api/models/actions/execute_execute_by_id_response.rb b/lib/moderation_api/models/actions/execute_execute_by_id_response.rb deleted file mode 100644 index a907fe62..00000000 --- a/lib/moderation_api/models/actions/execute_execute_by_id_response.rb +++ /dev/null @@ -1,35 +0,0 @@ -# frozen_string_literal: true - -module ModerationAPI - module Models - module Actions - # @see ModerationAPI::Resources::Actions::Execute#execute_by_id - class ExecuteExecuteByIDResponse < ModerationAPI::Internal::Type::BaseModel - # @!attribute action_id - # The ID of the action. - # - # @return [String] - required :action_id, String, api_name: :actionId - - # @!attribute ids - # The IDs of the content items. - # - # @return [Array] - required :ids, ModerationAPI::Internal::Type::ArrayOf[String] - - # @!attribute success - # Action executed successfully. - # - # @return [Boolean] - required :success, ModerationAPI::Internal::Type::Boolean - - # @!method initialize(action_id:, ids:, success:) - # @param action_id [String] The ID of the action. - # - # @param ids [Array] The IDs of the content items. - # - # @param success [Boolean] Action executed successfully. - end - end - end -end diff --git a/lib/moderation_api/models/actions/execute_execute_params.rb b/lib/moderation_api/models/actions/execute_execute_params.rb deleted file mode 100644 index 0be9b12d..00000000 --- a/lib/moderation_api/models/actions/execute_execute_params.rb +++ /dev/null @@ -1,64 +0,0 @@ -# frozen_string_literal: true - -module ModerationAPI - module Models - module Actions - # @see ModerationAPI::Resources::Actions::Execute#execute - class ExecuteExecuteParams < ModerationAPI::Internal::Type::BaseModel - extend ModerationAPI::Internal::Type::RequestParameters::Converter - include ModerationAPI::Internal::Type::RequestParameters - - # @!attribute action_key - # ID or key of the action to execute - # - # @return [String] - required :action_key, String, api_name: :actionKey - - # @!attribute author_ids - # IDs of the authors to apply the action to. Provide this or contentIds. - # - # @return [Array, nil] - optional :author_ids, ModerationAPI::Internal::Type::ArrayOf[String], api_name: :authorIds - - # @!attribute content_ids - # IDs of the content items to apply the action to. Provide this or authorIds. - # - # @return [Array, nil] - optional :content_ids, ModerationAPI::Internal::Type::ArrayOf[String], api_name: :contentIds - - # @!attribute duration - # Optional duration in milliseconds for actions with timeouts - # - # @return [Float, nil] - optional :duration, Float - - # @!attribute queue_id - # Optional queue ID if the action is queue-specific - # - # @return [String, nil] - optional :queue_id, String, api_name: :queueId - - # @!attribute value - # Optional value to provide with the action - # - # @return [String, nil] - optional :value, String - - # @!method initialize(action_key:, author_ids: nil, content_ids: nil, duration: nil, queue_id: nil, value: nil, request_options: {}) - # @param action_key [String] ID or key of the action to execute - # - # @param author_ids [Array] IDs of the authors to apply the action to. Provide this or contentIds. - # - # @param content_ids [Array] IDs of the content items to apply the action to. Provide this or authorIds. - # - # @param duration [Float] Optional duration in milliseconds for actions with timeouts - # - # @param queue_id [String] Optional queue ID if the action is queue-specific - # - # @param value [String] Optional value to provide with the action - # - # @param request_options [ModerationAPI::RequestOptions, Hash{Symbol=>Object}] - end - end - end -end diff --git a/lib/moderation_api/models/actions/execute_execute_response.rb b/lib/moderation_api/models/actions/execute_execute_response.rb deleted file mode 100644 index 1328442b..00000000 --- a/lib/moderation_api/models/actions/execute_execute_response.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true - -module ModerationAPI - module Models - module Actions - # @see ModerationAPI::Resources::Actions::Execute#execute - class ExecuteExecuteResponse < ModerationAPI::Internal::Type::BaseModel - # @!attribute success - # Whether the action was executed successfully - # - # @return [Boolean] - required :success, ModerationAPI::Internal::Type::Boolean - - # @!method initialize(success:) - # Execution result - # - # @param success [Boolean] Whether the action was executed successfully - end - end - end -end diff --git a/lib/moderation_api/models/auth_create_params.rb b/lib/moderation_api/models/auth_create_params.rb deleted file mode 100644 index a2af5307..00000000 --- a/lib/moderation_api/models/auth_create_params.rb +++ /dev/null @@ -1,14 +0,0 @@ -# frozen_string_literal: true - -module ModerationAPI - module Models - # @see ModerationAPI::Resources::Auth#create - class AuthCreateParams < ModerationAPI::Internal::Type::BaseModel - extend ModerationAPI::Internal::Type::RequestParameters::Converter - include ModerationAPI::Internal::Type::RequestParameters - - # @!method initialize(request_options: {}) - # @param request_options [ModerationAPI::RequestOptions, Hash{Symbol=>Object}] - end - end -end diff --git a/lib/moderation_api/models/auth_create_response.rb b/lib/moderation_api/models/auth_create_response.rb deleted file mode 100644 index 84e9dc1c..00000000 --- a/lib/moderation_api/models/auth_create_response.rb +++ /dev/null @@ -1,33 +0,0 @@ -# frozen_string_literal: true - -module ModerationAPI - module Models - # @see ModerationAPI::Resources::Auth#create - class AuthCreateResponse < ModerationAPI::Internal::Type::BaseModel - # @!attribute message - # Message of the authentication - # - # @return [String] - required :message, String - - # @!attribute project - # Name of the authenticated project - # - # @return [String] - required :project, String - - # @!attribute status - # Status of the authentication - # - # @return [String] - required :status, String - - # @!method initialize(message:, project:, status:) - # @param message [String] Message of the authentication - # - # @param project [String] Name of the authenticated project - # - # @param status [String] Status of the authentication - end - end -end diff --git a/lib/moderation_api/models/auth_retrieve_params.rb b/lib/moderation_api/models/auth_retrieve_params.rb deleted file mode 100644 index aacd58e9..00000000 --- a/lib/moderation_api/models/auth_retrieve_params.rb +++ /dev/null @@ -1,14 +0,0 @@ -# frozen_string_literal: true - -module ModerationAPI - module Models - # @see ModerationAPI::Resources::Auth#retrieve - class AuthRetrieveParams < ModerationAPI::Internal::Type::BaseModel - extend ModerationAPI::Internal::Type::RequestParameters::Converter - include ModerationAPI::Internal::Type::RequestParameters - - # @!method initialize(request_options: {}) - # @param request_options [ModerationAPI::RequestOptions, Hash{Symbol=>Object}] - end - end -end diff --git a/lib/moderation_api/models/auth_retrieve_response.rb b/lib/moderation_api/models/auth_retrieve_response.rb deleted file mode 100644 index 9be23f6b..00000000 --- a/lib/moderation_api/models/auth_retrieve_response.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true - -module ModerationAPI - module Models - # @see ModerationAPI::Resources::Auth#retrieve - class AuthRetrieveResponse < ModerationAPI::Internal::Type::BaseModel - # @!attribute message - # Message of the authentication - # - # @return [String] - required :message, String - - # @!attribute status - # Status of the authentication - # - # @return [String] - required :status, String - - # @!method initialize(message:, status:) - # @param message [String] Message of the authentication - # - # @param status [String] Status of the authentication - end - end -end diff --git a/lib/moderation_api/models/author_create_params.rb b/lib/moderation_api/models/author_create_params.rb deleted file mode 100644 index f8c218d8..00000000 --- a/lib/moderation_api/models/author_create_params.rb +++ /dev/null @@ -1,135 +0,0 @@ -# frozen_string_literal: true - -module ModerationAPI - module Models - # @see ModerationAPI::Resources::Authors#create - class AuthorCreateParams < ModerationAPI::Internal::Type::BaseModel - extend ModerationAPI::Internal::Type::RequestParameters::Converter - include ModerationAPI::Internal::Type::RequestParameters - - # @!attribute external_id - # External ID of the user, typically the ID of the author in your database. - # - # @return [String] - required :external_id, String - - # @!attribute company - # The author's company or organization - # - # @return [String, nil] - optional :company, String, nil?: true - - # @!attribute email - # Author email address - # - # @return [String, nil] - optional :email, String, nil?: true - - # @!attribute external_link - # URL of the author's external profile - # - # @return [String, nil] - optional :external_link, String, nil?: true - - # @!attribute first_seen - # Timestamp when author first appeared - # - # @return [Float, nil] - optional :first_seen, Float - - # @!attribute last_seen - # Timestamp of last activity - # - # @return [Float, nil] - optional :last_seen, Float - - # @!attribute manual_trust_level - # - # @return [Float, nil] - optional :manual_trust_level, Float, nil?: true - - # @!attribute metadata - # Additional metadata provided by your system. We recommend including any relevant - # information that may assist in the moderation process. - # - # @return [ModerationAPI::Models::AuthorCreateParams::Metadata, nil] - optional :metadata, -> { ModerationAPI::AuthorCreateParams::Metadata } - - # @!attribute name - # Author name or identifier - # - # @return [String, nil] - optional :name, String, nil?: true - - # @!attribute profile_picture - # URL of the author's profile picture - # - # @return [String, nil] - optional :profile_picture, String, nil?: true - - # @!method initialize(external_id:, company: nil, email: nil, external_link: nil, first_seen: nil, last_seen: nil, manual_trust_level: nil, metadata: nil, name: nil, profile_picture: nil, request_options: {}) - # Some parameter documentations has been truncated, see - # {ModerationAPI::Models::AuthorCreateParams} for more details. - # - # @param external_id [String] External ID of the user, typically the ID of the author in your database. - # - # @param company [String, nil] The author's company or organization - # - # @param email [String, nil] Author email address - # - # @param external_link [String, nil] URL of the author's external profile - # - # @param first_seen [Float] Timestamp when author first appeared - # - # @param last_seen [Float] Timestamp of last activity - # - # @param manual_trust_level [Float, nil] - # - # @param metadata [ModerationAPI::Models::AuthorCreateParams::Metadata] Additional metadata provided by your system. We recommend including any relevant - # - # @param name [String, nil] Author name or identifier - # - # @param profile_picture [String, nil] URL of the author's profile picture - # - # @param request_options [ModerationAPI::RequestOptions, Hash{Symbol=>Object}] - - class Metadata < ModerationAPI::Internal::Type::BaseModel - # @!attribute email_verified - # Whether the author's email is verified - # - # @return [Boolean, nil] - optional :email_verified, ModerationAPI::Internal::Type::Boolean, nil?: true - - # @!attribute identity_verified - # Whether the author's identity is verified - # - # @return [Boolean, nil] - optional :identity_verified, ModerationAPI::Internal::Type::Boolean, nil?: true - - # @!attribute is_paying_customer - # Whether the author is a paying customer - # - # @return [Boolean, nil] - optional :is_paying_customer, ModerationAPI::Internal::Type::Boolean, nil?: true - - # @!attribute phone_verified - # Whether the author's phone number is verified - # - # @return [Boolean, nil] - optional :phone_verified, ModerationAPI::Internal::Type::Boolean, nil?: true - - # @!method initialize(email_verified: nil, identity_verified: nil, is_paying_customer: nil, phone_verified: nil) - # Additional metadata provided by your system. We recommend including any relevant - # information that may assist in the moderation process. - # - # @param email_verified [Boolean, nil] Whether the author's email is verified - # - # @param identity_verified [Boolean, nil] Whether the author's identity is verified - # - # @param is_paying_customer [Boolean, nil] Whether the author is a paying customer - # - # @param phone_verified [Boolean, nil] Whether the author's phone number is verified - end - end - end -end diff --git a/lib/moderation_api/models/author_create_response.rb b/lib/moderation_api/models/author_create_response.rb deleted file mode 100644 index 1787150d..00000000 --- a/lib/moderation_api/models/author_create_response.rb +++ /dev/null @@ -1,280 +0,0 @@ -# frozen_string_literal: true - -module ModerationAPI - module Models - # @see ModerationAPI::Resources::Authors#create - class AuthorCreateResponse < ModerationAPI::Internal::Type::BaseModel - # @!attribute id - # Author ID in Moderation API - # - # @return [String] - required :id, String - - # @!attribute block - # Block or suspension details, if applicable. Null if the author is enabled. - # - # @return [ModerationAPI::Models::AuthorCreateResponse::Block, nil] - required :block, -> { ModerationAPI::Models::AuthorCreateResponse::Block }, nil?: true - - # @!attribute first_seen - # Timestamp when author first appeared - # - # @return [Float] - required :first_seen, Float - - # @!attribute last_seen - # Timestamp of last activity - # - # @return [Float] - required :last_seen, Float - - # @!attribute metadata - # Additional metadata provided by your system. We recommend including any relevant - # information that may assist in the moderation process. - # - # @return [ModerationAPI::Models::AuthorCreateResponse::Metadata] - required :metadata, -> { ModerationAPI::Models::AuthorCreateResponse::Metadata } - - # @!attribute metrics - # - # @return [ModerationAPI::Models::AuthorCreateResponse::Metrics] - required :metrics, -> { ModerationAPI::Models::AuthorCreateResponse::Metrics } - - # @!attribute risk_evaluation - # Risk assessment details, if available. - # - # @return [ModerationAPI::Models::AuthorCreateResponse::RiskEvaluation, nil] - required :risk_evaluation, -> { ModerationAPI::Models::AuthorCreateResponse::RiskEvaluation }, nil?: true - - # @!attribute status - # Current author status - # - # @return [Symbol, ModerationAPI::Models::AuthorCreateResponse::Status] - required :status, enum: -> { ModerationAPI::Models::AuthorCreateResponse::Status } - - # @!attribute trust_level - # - # @return [ModerationAPI::Models::AuthorCreateResponse::TrustLevel] - required :trust_level, -> { ModerationAPI::Models::AuthorCreateResponse::TrustLevel } - - # @!attribute company - # The author's company or organization - # - # @return [String, nil] - optional :company, String, nil?: true - - # @!attribute email - # Author email address - # - # @return [String, nil] - optional :email, String, nil?: true - - # @!attribute external_id - # The author's ID from your system - # - # @return [String, nil] - optional :external_id, String, nil?: true - - # @!attribute external_link - # URL of the author's external profile - # - # @return [String, nil] - optional :external_link, String, nil?: true - - # @!attribute last_incident - # Timestamp of last incident - # - # @return [Float, nil] - optional :last_incident, Float, nil?: true - - # @!attribute name - # Author name or identifier - # - # @return [String, nil] - optional :name, String, nil?: true - - # @!attribute profile_picture - # URL of the author's profile picture - # - # @return [String, nil] - optional :profile_picture, String, nil?: true - - # @!method initialize(id:, block:, first_seen:, last_seen:, metadata:, metrics:, risk_evaluation:, status:, trust_level:, company: nil, email: nil, external_id: nil, external_link: nil, last_incident: nil, name: nil, profile_picture: nil) - # Some parameter documentations has been truncated, see - # {ModerationAPI::Models::AuthorCreateResponse} for more details. - # - # @param id [String] Author ID in Moderation API - # - # @param block [ModerationAPI::Models::AuthorCreateResponse::Block, nil] Block or suspension details, if applicable. Null if the author is enabled. - # - # @param first_seen [Float] Timestamp when author first appeared - # - # @param last_seen [Float] Timestamp of last activity - # - # @param metadata [ModerationAPI::Models::AuthorCreateResponse::Metadata] Additional metadata provided by your system. We recommend including any relevant - # - # @param metrics [ModerationAPI::Models::AuthorCreateResponse::Metrics] - # - # @param risk_evaluation [ModerationAPI::Models::AuthorCreateResponse::RiskEvaluation, nil] Risk assessment details, if available. - # - # @param status [Symbol, ModerationAPI::Models::AuthorCreateResponse::Status] Current author status - # - # @param trust_level [ModerationAPI::Models::AuthorCreateResponse::TrustLevel] - # - # @param company [String, nil] The author's company or organization - # - # @param email [String, nil] Author email address - # - # @param external_id [String, nil] The author's ID from your system - # - # @param external_link [String, nil] URL of the author's external profile - # - # @param last_incident [Float, nil] Timestamp of last incident - # - # @param name [String, nil] Author name or identifier - # - # @param profile_picture [String, nil] URL of the author's profile picture - - # @see ModerationAPI::Models::AuthorCreateResponse#block - class Block < ModerationAPI::Internal::Type::BaseModel - # @!attribute reason - # The moderators reason why the author was blocked or suspended. - # - # @return [String, nil] - optional :reason, String, nil?: true - - # @!attribute until_ - # The timestamp until which they are blocked if the author is suspended. - # - # @return [Float, nil] - optional :until_, Float, api_name: :until, nil?: true - - # @!method initialize(reason: nil, until_: nil) - # Block or suspension details, if applicable. Null if the author is enabled. - # - # @param reason [String, nil] The moderators reason why the author was blocked or suspended. - # - # @param until_ [Float, nil] The timestamp until which they are blocked if the author is suspended. - end - - # @see ModerationAPI::Models::AuthorCreateResponse#metadata - class Metadata < ModerationAPI::Internal::Type::BaseModel - # @!attribute email_verified - # Whether the author's email is verified - # - # @return [Boolean, nil] - optional :email_verified, ModerationAPI::Internal::Type::Boolean, nil?: true - - # @!attribute identity_verified - # Whether the author's identity is verified - # - # @return [Boolean, nil] - optional :identity_verified, ModerationAPI::Internal::Type::Boolean, nil?: true - - # @!attribute is_paying_customer - # Whether the author is a paying customer - # - # @return [Boolean, nil] - optional :is_paying_customer, ModerationAPI::Internal::Type::Boolean, nil?: true - - # @!attribute phone_verified - # Whether the author's phone number is verified - # - # @return [Boolean, nil] - optional :phone_verified, ModerationAPI::Internal::Type::Boolean, nil?: true - - # @!method initialize(email_verified: nil, identity_verified: nil, is_paying_customer: nil, phone_verified: nil) - # Additional metadata provided by your system. We recommend including any relevant - # information that may assist in the moderation process. - # - # @param email_verified [Boolean, nil] Whether the author's email is verified - # - # @param identity_verified [Boolean, nil] Whether the author's identity is verified - # - # @param is_paying_customer [Boolean, nil] Whether the author is a paying customer - # - # @param phone_verified [Boolean, nil] Whether the author's phone number is verified - end - - # @see ModerationAPI::Models::AuthorCreateResponse#metrics - class Metrics < ModerationAPI::Internal::Type::BaseModel - # @!attribute flagged_content - # Number of flagged content pieces - # - # @return [Float] - required :flagged_content, Float - - # @!attribute total_content - # Total pieces of content - # - # @return [Float] - required :total_content, Float - - # @!attribute average_sentiment - # Average sentiment score of content (-1 to 1). Requires a sentiment model in your - # project. - # - # @return [Float, nil] - optional :average_sentiment, Float, nil?: true - - # @!method initialize(flagged_content:, total_content:, average_sentiment: nil) - # Some parameter documentations has been truncated, see - # {ModerationAPI::Models::AuthorCreateResponse::Metrics} for more details. - # - # @param flagged_content [Float] Number of flagged content pieces - # - # @param total_content [Float] Total pieces of content - # - # @param average_sentiment [Float, nil] Average sentiment score of content (-1 to 1). Requires a sentiment model in your - end - - # @see ModerationAPI::Models::AuthorCreateResponse#risk_evaluation - class RiskEvaluation < ModerationAPI::Internal::Type::BaseModel - # @!attribute risk_level - # Calculated risk level based on more than 10 behavioral signals. - # - # @return [Float, nil] - optional :risk_level, Float, nil?: true - - # @!method initialize(risk_level: nil) - # Risk assessment details, if available. - # - # @param risk_level [Float, nil] Calculated risk level based on more than 10 behavioral signals. - end - - # Current author status - # - # @see ModerationAPI::Models::AuthorCreateResponse#status - module Status - extend ModerationAPI::Internal::Type::Enum - - ENABLED = :enabled - SUSPENDED = :suspended - BLOCKED = :blocked - - # @!method self.values - # @return [Array] - end - - # @see ModerationAPI::Models::AuthorCreateResponse#trust_level - class TrustLevel < ModerationAPI::Internal::Type::BaseModel - # @!attribute level - # Author trust level (-1, 0, 1, 2, 3, or 4) - # - # @return [Float] - required :level, Float - - # @!attribute manual - # True if the trust level was set manually by a moderator - # - # @return [Boolean] - required :manual, ModerationAPI::Internal::Type::Boolean - - # @!method initialize(level:, manual:) - # @param level [Float] Author trust level (-1, 0, 1, 2, 3, or 4) - # - # @param manual [Boolean] True if the trust level was set manually by a moderator - end - end - end -end diff --git a/lib/moderation_api/models/author_delete_params.rb b/lib/moderation_api/models/author_delete_params.rb deleted file mode 100644 index 5510c9e4..00000000 --- a/lib/moderation_api/models/author_delete_params.rb +++ /dev/null @@ -1,22 +0,0 @@ -# frozen_string_literal: true - -module ModerationAPI - module Models - # @see ModerationAPI::Resources::Authors#delete - class AuthorDeleteParams < ModerationAPI::Internal::Type::BaseModel - extend ModerationAPI::Internal::Type::RequestParameters::Converter - include ModerationAPI::Internal::Type::RequestParameters - - # @!attribute id - # Either external ID or the ID assigned by moderation API. - # - # @return [String] - required :id, String - - # @!method initialize(id:, request_options: {}) - # @param id [String] Either external ID or the ID assigned by moderation API. - # - # @param request_options [ModerationAPI::RequestOptions, Hash{Symbol=>Object}] - end - end -end diff --git a/lib/moderation_api/models/author_delete_response.rb b/lib/moderation_api/models/author_delete_response.rb deleted file mode 100644 index 32ec12ee..00000000 --- a/lib/moderation_api/models/author_delete_response.rb +++ /dev/null @@ -1,16 +0,0 @@ -# frozen_string_literal: true - -module ModerationAPI - module Models - # @see ModerationAPI::Resources::Authors#delete - class AuthorDeleteResponse < ModerationAPI::Internal::Type::BaseModel - # @!attribute success - # - # @return [Boolean] - required :success, ModerationAPI::Internal::Type::Boolean - - # @!method initialize(success:) - # @param success [Boolean] - end - end -end diff --git a/lib/moderation_api/models/author_list_params.rb b/lib/moderation_api/models/author_list_params.rb deleted file mode 100644 index ba48465f..00000000 --- a/lib/moderation_api/models/author_list_params.rb +++ /dev/null @@ -1,93 +0,0 @@ -# frozen_string_literal: true - -module ModerationAPI - module Models - # @see ModerationAPI::Resources::Authors#list - class AuthorListParams < ModerationAPI::Internal::Type::BaseModel - extend ModerationAPI::Internal::Type::RequestParameters::Converter - include ModerationAPI::Internal::Type::RequestParameters - - # @!attribute content_types - # - # @return [String, nil] - optional :content_types, String - - # @!attribute last_active_date - # - # @return [String, nil] - optional :last_active_date, String - - # @!attribute member_since_date - # - # @return [String, nil] - optional :member_since_date, String - - # @!attribute page_number - # Page number to fetch - # - # @return [Float, nil] - optional :page_number, Float - - # @!attribute page_size - # Number of authors per page - # - # @return [Float, nil] - optional :page_size, Float - - # @!attribute sort_by - # - # @return [Symbol, ModerationAPI::Models::AuthorListParams::SortBy, nil] - optional :sort_by, enum: -> { ModerationAPI::AuthorListParams::SortBy } - - # @!attribute sort_direction - # Sort direction - # - # @return [Symbol, ModerationAPI::Models::AuthorListParams::SortDirection, nil] - optional :sort_direction, enum: -> { ModerationAPI::AuthorListParams::SortDirection } - - # @!method initialize(content_types: nil, last_active_date: nil, member_since_date: nil, page_number: nil, page_size: nil, sort_by: nil, sort_direction: nil, request_options: {}) - # @param content_types [String] - # - # @param last_active_date [String] - # - # @param member_since_date [String] - # - # @param page_number [Float] Page number to fetch - # - # @param page_size [Float] Number of authors per page - # - # @param sort_by [Symbol, ModerationAPI::Models::AuthorListParams::SortBy] - # - # @param sort_direction [Symbol, ModerationAPI::Models::AuthorListParams::SortDirection] Sort direction - # - # @param request_options [ModerationAPI::RequestOptions, Hash{Symbol=>Object}] - - module SortBy - extend ModerationAPI::Internal::Type::Enum - - TRUST_LEVEL = :trustLevel - VIOLATION_COUNT = :violationCount - REPORT_COUNT = :reportCount - MEMBER_SINCE = :memberSince - LAST_ACTIVE = :lastActive - CONTENT_COUNT = :contentCount - FLAGGED_CONTENT_RATIO = :flaggedContentRatio - AVERAGE_SENTIMENT = :averageSentiment - - # @!method self.values - # @return [Array] - end - - # Sort direction - module SortDirection - extend ModerationAPI::Internal::Type::Enum - - ASC = :asc - DESC = :desc - - # @!method self.values - # @return [Array] - end - end - end -end diff --git a/lib/moderation_api/models/author_list_response.rb b/lib/moderation_api/models/author_list_response.rb deleted file mode 100644 index 513fbc7f..00000000 --- a/lib/moderation_api/models/author_list_response.rb +++ /dev/null @@ -1,334 +0,0 @@ -# frozen_string_literal: true - -module ModerationAPI - module Models - # @see ModerationAPI::Resources::Authors#list - class AuthorListResponse < ModerationAPI::Internal::Type::BaseModel - # @!attribute authors - # - # @return [Array] - required :authors, - -> { ModerationAPI::Internal::Type::ArrayOf[ModerationAPI::Models::AuthorListResponse::Author] } - - # @!attribute pagination - # - # @return [ModerationAPI::Models::AuthorListResponse::Pagination] - required :pagination, -> { ModerationAPI::Models::AuthorListResponse::Pagination } - - # @!method initialize(authors:, pagination:) - # @param authors [Array] - # @param pagination [ModerationAPI::Models::AuthorListResponse::Pagination] - - class Author < ModerationAPI::Internal::Type::BaseModel - # @!attribute id - # Author ID in Moderation API - # - # @return [String] - required :id, String - - # @!attribute block - # Block or suspension details, if applicable. Null if the author is enabled. - # - # @return [ModerationAPI::Models::AuthorListResponse::Author::Block, nil] - required :block, -> { ModerationAPI::Models::AuthorListResponse::Author::Block }, nil?: true - - # @!attribute first_seen - # Timestamp when author first appeared - # - # @return [Float] - required :first_seen, Float - - # @!attribute last_seen - # Timestamp of last activity - # - # @return [Float] - required :last_seen, Float - - # @!attribute metadata - # Additional metadata provided by your system. We recommend including any relevant - # information that may assist in the moderation process. - # - # @return [ModerationAPI::Models::AuthorListResponse::Author::Metadata] - required :metadata, -> { ModerationAPI::Models::AuthorListResponse::Author::Metadata } - - # @!attribute metrics - # - # @return [ModerationAPI::Models::AuthorListResponse::Author::Metrics] - required :metrics, -> { ModerationAPI::Models::AuthorListResponse::Author::Metrics } - - # @!attribute risk_evaluation - # Risk assessment details, if available. - # - # @return [ModerationAPI::Models::AuthorListResponse::Author::RiskEvaluation, nil] - required :risk_evaluation, - -> { ModerationAPI::Models::AuthorListResponse::Author::RiskEvaluation }, - nil?: true - - # @!attribute status - # Current author status - # - # @return [Symbol, ModerationAPI::Models::AuthorListResponse::Author::Status] - required :status, enum: -> { ModerationAPI::Models::AuthorListResponse::Author::Status } - - # @!attribute trust_level - # - # @return [ModerationAPI::Models::AuthorListResponse::Author::TrustLevel] - required :trust_level, -> { ModerationAPI::Models::AuthorListResponse::Author::TrustLevel } - - # @!attribute company - # The author's company or organization - # - # @return [String, nil] - optional :company, String, nil?: true - - # @!attribute email - # Author email address - # - # @return [String, nil] - optional :email, String, nil?: true - - # @!attribute external_id - # The author's ID from your system - # - # @return [String, nil] - optional :external_id, String, nil?: true - - # @!attribute external_link - # URL of the author's external profile - # - # @return [String, nil] - optional :external_link, String, nil?: true - - # @!attribute last_incident - # Timestamp of last incident - # - # @return [Float, nil] - optional :last_incident, Float, nil?: true - - # @!attribute name - # Author name or identifier - # - # @return [String, nil] - optional :name, String, nil?: true - - # @!attribute profile_picture - # URL of the author's profile picture - # - # @return [String, nil] - optional :profile_picture, String, nil?: true - - # @!method initialize(id:, block:, first_seen:, last_seen:, metadata:, metrics:, risk_evaluation:, status:, trust_level:, company: nil, email: nil, external_id: nil, external_link: nil, last_incident: nil, name: nil, profile_picture: nil) - # Some parameter documentations has been truncated, see - # {ModerationAPI::Models::AuthorListResponse::Author} for more details. - # - # @param id [String] Author ID in Moderation API - # - # @param block [ModerationAPI::Models::AuthorListResponse::Author::Block, nil] Block or suspension details, if applicable. Null if the author is enabled. - # - # @param first_seen [Float] Timestamp when author first appeared - # - # @param last_seen [Float] Timestamp of last activity - # - # @param metadata [ModerationAPI::Models::AuthorListResponse::Author::Metadata] Additional metadata provided by your system. We recommend including any relevant - # - # @param metrics [ModerationAPI::Models::AuthorListResponse::Author::Metrics] - # - # @param risk_evaluation [ModerationAPI::Models::AuthorListResponse::Author::RiskEvaluation, nil] Risk assessment details, if available. - # - # @param status [Symbol, ModerationAPI::Models::AuthorListResponse::Author::Status] Current author status - # - # @param trust_level [ModerationAPI::Models::AuthorListResponse::Author::TrustLevel] - # - # @param company [String, nil] The author's company or organization - # - # @param email [String, nil] Author email address - # - # @param external_id [String, nil] The author's ID from your system - # - # @param external_link [String, nil] URL of the author's external profile - # - # @param last_incident [Float, nil] Timestamp of last incident - # - # @param name [String, nil] Author name or identifier - # - # @param profile_picture [String, nil] URL of the author's profile picture - - # @see ModerationAPI::Models::AuthorListResponse::Author#block - class Block < ModerationAPI::Internal::Type::BaseModel - # @!attribute reason - # The moderators reason why the author was blocked or suspended. - # - # @return [String, nil] - optional :reason, String, nil?: true - - # @!attribute until_ - # The timestamp until which they are blocked if the author is suspended. - # - # @return [Float, nil] - optional :until_, Float, api_name: :until, nil?: true - - # @!method initialize(reason: nil, until_: nil) - # Block or suspension details, if applicable. Null if the author is enabled. - # - # @param reason [String, nil] The moderators reason why the author was blocked or suspended. - # - # @param until_ [Float, nil] The timestamp until which they are blocked if the author is suspended. - end - - # @see ModerationAPI::Models::AuthorListResponse::Author#metadata - class Metadata < ModerationAPI::Internal::Type::BaseModel - # @!attribute email_verified - # Whether the author's email is verified - # - # @return [Boolean, nil] - optional :email_verified, ModerationAPI::Internal::Type::Boolean, nil?: true - - # @!attribute identity_verified - # Whether the author's identity is verified - # - # @return [Boolean, nil] - optional :identity_verified, ModerationAPI::Internal::Type::Boolean, nil?: true - - # @!attribute is_paying_customer - # Whether the author is a paying customer - # - # @return [Boolean, nil] - optional :is_paying_customer, ModerationAPI::Internal::Type::Boolean, nil?: true - - # @!attribute phone_verified - # Whether the author's phone number is verified - # - # @return [Boolean, nil] - optional :phone_verified, ModerationAPI::Internal::Type::Boolean, nil?: true - - # @!method initialize(email_verified: nil, identity_verified: nil, is_paying_customer: nil, phone_verified: nil) - # Additional metadata provided by your system. We recommend including any relevant - # information that may assist in the moderation process. - # - # @param email_verified [Boolean, nil] Whether the author's email is verified - # - # @param identity_verified [Boolean, nil] Whether the author's identity is verified - # - # @param is_paying_customer [Boolean, nil] Whether the author is a paying customer - # - # @param phone_verified [Boolean, nil] Whether the author's phone number is verified - end - - # @see ModerationAPI::Models::AuthorListResponse::Author#metrics - class Metrics < ModerationAPI::Internal::Type::BaseModel - # @!attribute flagged_content - # Number of flagged content pieces - # - # @return [Float] - required :flagged_content, Float - - # @!attribute total_content - # Total pieces of content - # - # @return [Float] - required :total_content, Float - - # @!attribute average_sentiment - # Average sentiment score of content (-1 to 1). Requires a sentiment model in your - # project. - # - # @return [Float, nil] - optional :average_sentiment, Float, nil?: true - - # @!method initialize(flagged_content:, total_content:, average_sentiment: nil) - # Some parameter documentations has been truncated, see - # {ModerationAPI::Models::AuthorListResponse::Author::Metrics} for more details. - # - # @param flagged_content [Float] Number of flagged content pieces - # - # @param total_content [Float] Total pieces of content - # - # @param average_sentiment [Float, nil] Average sentiment score of content (-1 to 1). Requires a sentiment model in your - end - - # @see ModerationAPI::Models::AuthorListResponse::Author#risk_evaluation - class RiskEvaluation < ModerationAPI::Internal::Type::BaseModel - # @!attribute risk_level - # Calculated risk level based on more than 10 behavioral signals. - # - # @return [Float, nil] - optional :risk_level, Float, nil?: true - - # @!method initialize(risk_level: nil) - # Risk assessment details, if available. - # - # @param risk_level [Float, nil] Calculated risk level based on more than 10 behavioral signals. - end - - # Current author status - # - # @see ModerationAPI::Models::AuthorListResponse::Author#status - module Status - extend ModerationAPI::Internal::Type::Enum - - ENABLED = :enabled - SUSPENDED = :suspended - BLOCKED = :blocked - - # @!method self.values - # @return [Array] - end - - # @see ModerationAPI::Models::AuthorListResponse::Author#trust_level - class TrustLevel < ModerationAPI::Internal::Type::BaseModel - # @!attribute level - # Author trust level (-1, 0, 1, 2, 3, or 4) - # - # @return [Float] - required :level, Float - - # @!attribute manual - # True if the trust level was set manually by a moderator - # - # @return [Boolean] - required :manual, ModerationAPI::Internal::Type::Boolean - - # @!method initialize(level:, manual:) - # @param level [Float] Author trust level (-1, 0, 1, 2, 3, or 4) - # - # @param manual [Boolean] True if the trust level was set manually by a moderator - end - end - - # @see ModerationAPI::Models::AuthorListResponse#pagination - class Pagination < ModerationAPI::Internal::Type::BaseModel - # @!attribute has_next_page - # - # @return [Boolean] - required :has_next_page, ModerationAPI::Internal::Type::Boolean, api_name: :hasNextPage - - # @!attribute has_previous_page - # - # @return [Boolean] - required :has_previous_page, ModerationAPI::Internal::Type::Boolean, api_name: :hasPreviousPage - - # @!attribute page_number - # - # @return [Float] - required :page_number, Float, api_name: :pageNumber - - # @!attribute page_size - # - # @return [Float] - required :page_size, Float, api_name: :pageSize - - # @!attribute total - # - # @return [Float] - required :total, Float - - # @!method initialize(has_next_page:, has_previous_page:, page_number:, page_size:, total:) - # @param has_next_page [Boolean] - # @param has_previous_page [Boolean] - # @param page_number [Float] - # @param page_size [Float] - # @param total [Float] - end - end - end -end diff --git a/lib/moderation_api/models/author_retrieve_params.rb b/lib/moderation_api/models/author_retrieve_params.rb deleted file mode 100644 index 7bee2ba2..00000000 --- a/lib/moderation_api/models/author_retrieve_params.rb +++ /dev/null @@ -1,22 +0,0 @@ -# frozen_string_literal: true - -module ModerationAPI - module Models - # @see ModerationAPI::Resources::Authors#retrieve - class AuthorRetrieveParams < ModerationAPI::Internal::Type::BaseModel - extend ModerationAPI::Internal::Type::RequestParameters::Converter - include ModerationAPI::Internal::Type::RequestParameters - - # @!attribute id - # Either external ID or the ID assigned by moderation API. - # - # @return [String] - required :id, String - - # @!method initialize(id:, request_options: {}) - # @param id [String] Either external ID or the ID assigned by moderation API. - # - # @param request_options [ModerationAPI::RequestOptions, Hash{Symbol=>Object}] - end - end -end diff --git a/lib/moderation_api/models/author_retrieve_response.rb b/lib/moderation_api/models/author_retrieve_response.rb deleted file mode 100644 index ac9b3c99..00000000 --- a/lib/moderation_api/models/author_retrieve_response.rb +++ /dev/null @@ -1,282 +0,0 @@ -# frozen_string_literal: true - -module ModerationAPI - module Models - # @see ModerationAPI::Resources::Authors#retrieve - class AuthorRetrieveResponse < ModerationAPI::Internal::Type::BaseModel - # @!attribute id - # Author ID in Moderation API - # - # @return [String] - required :id, String - - # @!attribute block - # Block or suspension details, if applicable. Null if the author is enabled. - # - # @return [ModerationAPI::Models::AuthorRetrieveResponse::Block, nil] - required :block, -> { ModerationAPI::Models::AuthorRetrieveResponse::Block }, nil?: true - - # @!attribute first_seen - # Timestamp when author first appeared - # - # @return [Float] - required :first_seen, Float - - # @!attribute last_seen - # Timestamp of last activity - # - # @return [Float] - required :last_seen, Float - - # @!attribute metadata - # Additional metadata provided by your system. We recommend including any relevant - # information that may assist in the moderation process. - # - # @return [ModerationAPI::Models::AuthorRetrieveResponse::Metadata] - required :metadata, -> { ModerationAPI::Models::AuthorRetrieveResponse::Metadata } - - # @!attribute metrics - # - # @return [ModerationAPI::Models::AuthorRetrieveResponse::Metrics] - required :metrics, -> { ModerationAPI::Models::AuthorRetrieveResponse::Metrics } - - # @!attribute risk_evaluation - # Risk assessment details, if available. - # - # @return [ModerationAPI::Models::AuthorRetrieveResponse::RiskEvaluation, nil] - required :risk_evaluation, - -> { ModerationAPI::Models::AuthorRetrieveResponse::RiskEvaluation }, - nil?: true - - # @!attribute status - # Current author status - # - # @return [Symbol, ModerationAPI::Models::AuthorRetrieveResponse::Status] - required :status, enum: -> { ModerationAPI::Models::AuthorRetrieveResponse::Status } - - # @!attribute trust_level - # - # @return [ModerationAPI::Models::AuthorRetrieveResponse::TrustLevel] - required :trust_level, -> { ModerationAPI::Models::AuthorRetrieveResponse::TrustLevel } - - # @!attribute company - # The author's company or organization - # - # @return [String, nil] - optional :company, String, nil?: true - - # @!attribute email - # Author email address - # - # @return [String, nil] - optional :email, String, nil?: true - - # @!attribute external_id - # The author's ID from your system - # - # @return [String, nil] - optional :external_id, String, nil?: true - - # @!attribute external_link - # URL of the author's external profile - # - # @return [String, nil] - optional :external_link, String, nil?: true - - # @!attribute last_incident - # Timestamp of last incident - # - # @return [Float, nil] - optional :last_incident, Float, nil?: true - - # @!attribute name - # Author name or identifier - # - # @return [String, nil] - optional :name, String, nil?: true - - # @!attribute profile_picture - # URL of the author's profile picture - # - # @return [String, nil] - optional :profile_picture, String, nil?: true - - # @!method initialize(id:, block:, first_seen:, last_seen:, metadata:, metrics:, risk_evaluation:, status:, trust_level:, company: nil, email: nil, external_id: nil, external_link: nil, last_incident: nil, name: nil, profile_picture: nil) - # Some parameter documentations has been truncated, see - # {ModerationAPI::Models::AuthorRetrieveResponse} for more details. - # - # @param id [String] Author ID in Moderation API - # - # @param block [ModerationAPI::Models::AuthorRetrieveResponse::Block, nil] Block or suspension details, if applicable. Null if the author is enabled. - # - # @param first_seen [Float] Timestamp when author first appeared - # - # @param last_seen [Float] Timestamp of last activity - # - # @param metadata [ModerationAPI::Models::AuthorRetrieveResponse::Metadata] Additional metadata provided by your system. We recommend including any relevant - # - # @param metrics [ModerationAPI::Models::AuthorRetrieveResponse::Metrics] - # - # @param risk_evaluation [ModerationAPI::Models::AuthorRetrieveResponse::RiskEvaluation, nil] Risk assessment details, if available. - # - # @param status [Symbol, ModerationAPI::Models::AuthorRetrieveResponse::Status] Current author status - # - # @param trust_level [ModerationAPI::Models::AuthorRetrieveResponse::TrustLevel] - # - # @param company [String, nil] The author's company or organization - # - # @param email [String, nil] Author email address - # - # @param external_id [String, nil] The author's ID from your system - # - # @param external_link [String, nil] URL of the author's external profile - # - # @param last_incident [Float, nil] Timestamp of last incident - # - # @param name [String, nil] Author name or identifier - # - # @param profile_picture [String, nil] URL of the author's profile picture - - # @see ModerationAPI::Models::AuthorRetrieveResponse#block - class Block < ModerationAPI::Internal::Type::BaseModel - # @!attribute reason - # The moderators reason why the author was blocked or suspended. - # - # @return [String, nil] - optional :reason, String, nil?: true - - # @!attribute until_ - # The timestamp until which they are blocked if the author is suspended. - # - # @return [Float, nil] - optional :until_, Float, api_name: :until, nil?: true - - # @!method initialize(reason: nil, until_: nil) - # Block or suspension details, if applicable. Null if the author is enabled. - # - # @param reason [String, nil] The moderators reason why the author was blocked or suspended. - # - # @param until_ [Float, nil] The timestamp until which they are blocked if the author is suspended. - end - - # @see ModerationAPI::Models::AuthorRetrieveResponse#metadata - class Metadata < ModerationAPI::Internal::Type::BaseModel - # @!attribute email_verified - # Whether the author's email is verified - # - # @return [Boolean, nil] - optional :email_verified, ModerationAPI::Internal::Type::Boolean, nil?: true - - # @!attribute identity_verified - # Whether the author's identity is verified - # - # @return [Boolean, nil] - optional :identity_verified, ModerationAPI::Internal::Type::Boolean, nil?: true - - # @!attribute is_paying_customer - # Whether the author is a paying customer - # - # @return [Boolean, nil] - optional :is_paying_customer, ModerationAPI::Internal::Type::Boolean, nil?: true - - # @!attribute phone_verified - # Whether the author's phone number is verified - # - # @return [Boolean, nil] - optional :phone_verified, ModerationAPI::Internal::Type::Boolean, nil?: true - - # @!method initialize(email_verified: nil, identity_verified: nil, is_paying_customer: nil, phone_verified: nil) - # Additional metadata provided by your system. We recommend including any relevant - # information that may assist in the moderation process. - # - # @param email_verified [Boolean, nil] Whether the author's email is verified - # - # @param identity_verified [Boolean, nil] Whether the author's identity is verified - # - # @param is_paying_customer [Boolean, nil] Whether the author is a paying customer - # - # @param phone_verified [Boolean, nil] Whether the author's phone number is verified - end - - # @see ModerationAPI::Models::AuthorRetrieveResponse#metrics - class Metrics < ModerationAPI::Internal::Type::BaseModel - # @!attribute flagged_content - # Number of flagged content pieces - # - # @return [Float] - required :flagged_content, Float - - # @!attribute total_content - # Total pieces of content - # - # @return [Float] - required :total_content, Float - - # @!attribute average_sentiment - # Average sentiment score of content (-1 to 1). Requires a sentiment model in your - # project. - # - # @return [Float, nil] - optional :average_sentiment, Float, nil?: true - - # @!method initialize(flagged_content:, total_content:, average_sentiment: nil) - # Some parameter documentations has been truncated, see - # {ModerationAPI::Models::AuthorRetrieveResponse::Metrics} for more details. - # - # @param flagged_content [Float] Number of flagged content pieces - # - # @param total_content [Float] Total pieces of content - # - # @param average_sentiment [Float, nil] Average sentiment score of content (-1 to 1). Requires a sentiment model in your - end - - # @see ModerationAPI::Models::AuthorRetrieveResponse#risk_evaluation - class RiskEvaluation < ModerationAPI::Internal::Type::BaseModel - # @!attribute risk_level - # Calculated risk level based on more than 10 behavioral signals. - # - # @return [Float, nil] - optional :risk_level, Float, nil?: true - - # @!method initialize(risk_level: nil) - # Risk assessment details, if available. - # - # @param risk_level [Float, nil] Calculated risk level based on more than 10 behavioral signals. - end - - # Current author status - # - # @see ModerationAPI::Models::AuthorRetrieveResponse#status - module Status - extend ModerationAPI::Internal::Type::Enum - - ENABLED = :enabled - SUSPENDED = :suspended - BLOCKED = :blocked - - # @!method self.values - # @return [Array] - end - - # @see ModerationAPI::Models::AuthorRetrieveResponse#trust_level - class TrustLevel < ModerationAPI::Internal::Type::BaseModel - # @!attribute level - # Author trust level (-1, 0, 1, 2, 3, or 4) - # - # @return [Float] - required :level, Float - - # @!attribute manual - # True if the trust level was set manually by a moderator - # - # @return [Boolean] - required :manual, ModerationAPI::Internal::Type::Boolean - - # @!method initialize(level:, manual:) - # @param level [Float] Author trust level (-1, 0, 1, 2, 3, or 4) - # - # @param manual [Boolean] True if the trust level was set manually by a moderator - end - end - end -end diff --git a/lib/moderation_api/models/author_update_params.rb b/lib/moderation_api/models/author_update_params.rb deleted file mode 100644 index 6e5160d8..00000000 --- a/lib/moderation_api/models/author_update_params.rb +++ /dev/null @@ -1,135 +0,0 @@ -# frozen_string_literal: true - -module ModerationAPI - module Models - # @see ModerationAPI::Resources::Authors#update - class AuthorUpdateParams < ModerationAPI::Internal::Type::BaseModel - extend ModerationAPI::Internal::Type::RequestParameters::Converter - include ModerationAPI::Internal::Type::RequestParameters - - # @!attribute id - # Either external ID or the ID assigned by moderation API. - # - # @return [String] - required :id, String - - # @!attribute company - # The author's company or organization - # - # @return [String, nil] - optional :company, String, nil?: true - - # @!attribute email - # Author email address - # - # @return [String, nil] - optional :email, String, nil?: true - - # @!attribute external_link - # URL of the author's external profile - # - # @return [String, nil] - optional :external_link, String, nil?: true - - # @!attribute first_seen - # Timestamp when author first appeared - # - # @return [Float, nil] - optional :first_seen, Float - - # @!attribute last_seen - # Timestamp of last activity - # - # @return [Float, nil] - optional :last_seen, Float - - # @!attribute manual_trust_level - # - # @return [Float, nil] - optional :manual_trust_level, Float, nil?: true - - # @!attribute metadata - # Additional metadata provided by your system. We recommend including any relevant - # information that may assist in the moderation process. - # - # @return [ModerationAPI::Models::AuthorUpdateParams::Metadata, nil] - optional :metadata, -> { ModerationAPI::AuthorUpdateParams::Metadata } - - # @!attribute name - # Author name or identifier - # - # @return [String, nil] - optional :name, String, nil?: true - - # @!attribute profile_picture - # URL of the author's profile picture - # - # @return [String, nil] - optional :profile_picture, String, nil?: true - - # @!method initialize(id:, company: nil, email: nil, external_link: nil, first_seen: nil, last_seen: nil, manual_trust_level: nil, metadata: nil, name: nil, profile_picture: nil, request_options: {}) - # Some parameter documentations has been truncated, see - # {ModerationAPI::Models::AuthorUpdateParams} for more details. - # - # @param id [String] Either external ID or the ID assigned by moderation API. - # - # @param company [String, nil] The author's company or organization - # - # @param email [String, nil] Author email address - # - # @param external_link [String, nil] URL of the author's external profile - # - # @param first_seen [Float] Timestamp when author first appeared - # - # @param last_seen [Float] Timestamp of last activity - # - # @param manual_trust_level [Float, nil] - # - # @param metadata [ModerationAPI::Models::AuthorUpdateParams::Metadata] Additional metadata provided by your system. We recommend including any relevant - # - # @param name [String, nil] Author name or identifier - # - # @param profile_picture [String, nil] URL of the author's profile picture - # - # @param request_options [ModerationAPI::RequestOptions, Hash{Symbol=>Object}] - - class Metadata < ModerationAPI::Internal::Type::BaseModel - # @!attribute email_verified - # Whether the author's email is verified - # - # @return [Boolean, nil] - optional :email_verified, ModerationAPI::Internal::Type::Boolean, nil?: true - - # @!attribute identity_verified - # Whether the author's identity is verified - # - # @return [Boolean, nil] - optional :identity_verified, ModerationAPI::Internal::Type::Boolean, nil?: true - - # @!attribute is_paying_customer - # Whether the author is a paying customer - # - # @return [Boolean, nil] - optional :is_paying_customer, ModerationAPI::Internal::Type::Boolean, nil?: true - - # @!attribute phone_verified - # Whether the author's phone number is verified - # - # @return [Boolean, nil] - optional :phone_verified, ModerationAPI::Internal::Type::Boolean, nil?: true - - # @!method initialize(email_verified: nil, identity_verified: nil, is_paying_customer: nil, phone_verified: nil) - # Additional metadata provided by your system. We recommend including any relevant - # information that may assist in the moderation process. - # - # @param email_verified [Boolean, nil] Whether the author's email is verified - # - # @param identity_verified [Boolean, nil] Whether the author's identity is verified - # - # @param is_paying_customer [Boolean, nil] Whether the author is a paying customer - # - # @param phone_verified [Boolean, nil] Whether the author's phone number is verified - end - end - end -end diff --git a/lib/moderation_api/models/author_update_response.rb b/lib/moderation_api/models/author_update_response.rb deleted file mode 100644 index 4168e536..00000000 --- a/lib/moderation_api/models/author_update_response.rb +++ /dev/null @@ -1,280 +0,0 @@ -# frozen_string_literal: true - -module ModerationAPI - module Models - # @see ModerationAPI::Resources::Authors#update - class AuthorUpdateResponse < ModerationAPI::Internal::Type::BaseModel - # @!attribute id - # Author ID in Moderation API - # - # @return [String] - required :id, String - - # @!attribute block - # Block or suspension details, if applicable. Null if the author is enabled. - # - # @return [ModerationAPI::Models::AuthorUpdateResponse::Block, nil] - required :block, -> { ModerationAPI::Models::AuthorUpdateResponse::Block }, nil?: true - - # @!attribute first_seen - # Timestamp when author first appeared - # - # @return [Float] - required :first_seen, Float - - # @!attribute last_seen - # Timestamp of last activity - # - # @return [Float] - required :last_seen, Float - - # @!attribute metadata - # Additional metadata provided by your system. We recommend including any relevant - # information that may assist in the moderation process. - # - # @return [ModerationAPI::Models::AuthorUpdateResponse::Metadata] - required :metadata, -> { ModerationAPI::Models::AuthorUpdateResponse::Metadata } - - # @!attribute metrics - # - # @return [ModerationAPI::Models::AuthorUpdateResponse::Metrics] - required :metrics, -> { ModerationAPI::Models::AuthorUpdateResponse::Metrics } - - # @!attribute risk_evaluation - # Risk assessment details, if available. - # - # @return [ModerationAPI::Models::AuthorUpdateResponse::RiskEvaluation, nil] - required :risk_evaluation, -> { ModerationAPI::Models::AuthorUpdateResponse::RiskEvaluation }, nil?: true - - # @!attribute status - # Current author status - # - # @return [Symbol, ModerationAPI::Models::AuthorUpdateResponse::Status] - required :status, enum: -> { ModerationAPI::Models::AuthorUpdateResponse::Status } - - # @!attribute trust_level - # - # @return [ModerationAPI::Models::AuthorUpdateResponse::TrustLevel] - required :trust_level, -> { ModerationAPI::Models::AuthorUpdateResponse::TrustLevel } - - # @!attribute company - # The author's company or organization - # - # @return [String, nil] - optional :company, String, nil?: true - - # @!attribute email - # Author email address - # - # @return [String, nil] - optional :email, String, nil?: true - - # @!attribute external_id - # The author's ID from your system - # - # @return [String, nil] - optional :external_id, String, nil?: true - - # @!attribute external_link - # URL of the author's external profile - # - # @return [String, nil] - optional :external_link, String, nil?: true - - # @!attribute last_incident - # Timestamp of last incident - # - # @return [Float, nil] - optional :last_incident, Float, nil?: true - - # @!attribute name - # Author name or identifier - # - # @return [String, nil] - optional :name, String, nil?: true - - # @!attribute profile_picture - # URL of the author's profile picture - # - # @return [String, nil] - optional :profile_picture, String, nil?: true - - # @!method initialize(id:, block:, first_seen:, last_seen:, metadata:, metrics:, risk_evaluation:, status:, trust_level:, company: nil, email: nil, external_id: nil, external_link: nil, last_incident: nil, name: nil, profile_picture: nil) - # Some parameter documentations has been truncated, see - # {ModerationAPI::Models::AuthorUpdateResponse} for more details. - # - # @param id [String] Author ID in Moderation API - # - # @param block [ModerationAPI::Models::AuthorUpdateResponse::Block, nil] Block or suspension details, if applicable. Null if the author is enabled. - # - # @param first_seen [Float] Timestamp when author first appeared - # - # @param last_seen [Float] Timestamp of last activity - # - # @param metadata [ModerationAPI::Models::AuthorUpdateResponse::Metadata] Additional metadata provided by your system. We recommend including any relevant - # - # @param metrics [ModerationAPI::Models::AuthorUpdateResponse::Metrics] - # - # @param risk_evaluation [ModerationAPI::Models::AuthorUpdateResponse::RiskEvaluation, nil] Risk assessment details, if available. - # - # @param status [Symbol, ModerationAPI::Models::AuthorUpdateResponse::Status] Current author status - # - # @param trust_level [ModerationAPI::Models::AuthorUpdateResponse::TrustLevel] - # - # @param company [String, nil] The author's company or organization - # - # @param email [String, nil] Author email address - # - # @param external_id [String, nil] The author's ID from your system - # - # @param external_link [String, nil] URL of the author's external profile - # - # @param last_incident [Float, nil] Timestamp of last incident - # - # @param name [String, nil] Author name or identifier - # - # @param profile_picture [String, nil] URL of the author's profile picture - - # @see ModerationAPI::Models::AuthorUpdateResponse#block - class Block < ModerationAPI::Internal::Type::BaseModel - # @!attribute reason - # The moderators reason why the author was blocked or suspended. - # - # @return [String, nil] - optional :reason, String, nil?: true - - # @!attribute until_ - # The timestamp until which they are blocked if the author is suspended. - # - # @return [Float, nil] - optional :until_, Float, api_name: :until, nil?: true - - # @!method initialize(reason: nil, until_: nil) - # Block or suspension details, if applicable. Null if the author is enabled. - # - # @param reason [String, nil] The moderators reason why the author was blocked or suspended. - # - # @param until_ [Float, nil] The timestamp until which they are blocked if the author is suspended. - end - - # @see ModerationAPI::Models::AuthorUpdateResponse#metadata - class Metadata < ModerationAPI::Internal::Type::BaseModel - # @!attribute email_verified - # Whether the author's email is verified - # - # @return [Boolean, nil] - optional :email_verified, ModerationAPI::Internal::Type::Boolean, nil?: true - - # @!attribute identity_verified - # Whether the author's identity is verified - # - # @return [Boolean, nil] - optional :identity_verified, ModerationAPI::Internal::Type::Boolean, nil?: true - - # @!attribute is_paying_customer - # Whether the author is a paying customer - # - # @return [Boolean, nil] - optional :is_paying_customer, ModerationAPI::Internal::Type::Boolean, nil?: true - - # @!attribute phone_verified - # Whether the author's phone number is verified - # - # @return [Boolean, nil] - optional :phone_verified, ModerationAPI::Internal::Type::Boolean, nil?: true - - # @!method initialize(email_verified: nil, identity_verified: nil, is_paying_customer: nil, phone_verified: nil) - # Additional metadata provided by your system. We recommend including any relevant - # information that may assist in the moderation process. - # - # @param email_verified [Boolean, nil] Whether the author's email is verified - # - # @param identity_verified [Boolean, nil] Whether the author's identity is verified - # - # @param is_paying_customer [Boolean, nil] Whether the author is a paying customer - # - # @param phone_verified [Boolean, nil] Whether the author's phone number is verified - end - - # @see ModerationAPI::Models::AuthorUpdateResponse#metrics - class Metrics < ModerationAPI::Internal::Type::BaseModel - # @!attribute flagged_content - # Number of flagged content pieces - # - # @return [Float] - required :flagged_content, Float - - # @!attribute total_content - # Total pieces of content - # - # @return [Float] - required :total_content, Float - - # @!attribute average_sentiment - # Average sentiment score of content (-1 to 1). Requires a sentiment model in your - # project. - # - # @return [Float, nil] - optional :average_sentiment, Float, nil?: true - - # @!method initialize(flagged_content:, total_content:, average_sentiment: nil) - # Some parameter documentations has been truncated, see - # {ModerationAPI::Models::AuthorUpdateResponse::Metrics} for more details. - # - # @param flagged_content [Float] Number of flagged content pieces - # - # @param total_content [Float] Total pieces of content - # - # @param average_sentiment [Float, nil] Average sentiment score of content (-1 to 1). Requires a sentiment model in your - end - - # @see ModerationAPI::Models::AuthorUpdateResponse#risk_evaluation - class RiskEvaluation < ModerationAPI::Internal::Type::BaseModel - # @!attribute risk_level - # Calculated risk level based on more than 10 behavioral signals. - # - # @return [Float, nil] - optional :risk_level, Float, nil?: true - - # @!method initialize(risk_level: nil) - # Risk assessment details, if available. - # - # @param risk_level [Float, nil] Calculated risk level based on more than 10 behavioral signals. - end - - # Current author status - # - # @see ModerationAPI::Models::AuthorUpdateResponse#status - module Status - extend ModerationAPI::Internal::Type::Enum - - ENABLED = :enabled - SUSPENDED = :suspended - BLOCKED = :blocked - - # @!method self.values - # @return [Array] - end - - # @see ModerationAPI::Models::AuthorUpdateResponse#trust_level - class TrustLevel < ModerationAPI::Internal::Type::BaseModel - # @!attribute level - # Author trust level (-1, 0, 1, 2, 3, or 4) - # - # @return [Float] - required :level, Float - - # @!attribute manual - # True if the trust level was set manually by a moderator - # - # @return [Boolean] - required :manual, ModerationAPI::Internal::Type::Boolean - - # @!method initialize(level:, manual:) - # @param level [Float] Author trust level (-1, 0, 1, 2, 3, or 4) - # - # @param manual [Boolean] True if the trust level was set manually by a moderator - end - end - end -end diff --git a/lib/moderation_api/models/callbacks.rb b/lib/moderation_api/models/callbacks.rb new file mode 100644 index 00000000..3a47d6e0 --- /dev/null +++ b/lib/moderation_api/models/callbacks.rb @@ -0,0 +1,12 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Callbacks + + end + end +end diff --git a/lib/moderation_api/models/components.rb b/lib/moderation_api/models/components.rb new file mode 100644 index 00000000..843d63fd --- /dev/null +++ b/lib/moderation_api/models/components.rb @@ -0,0 +1,40 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Components + autoload :AuthenticationErrorCode, "moderation_api/models/components/authenticationerror_code.rb" + autoload :BadRequestErrorCode, "moderation_api/models/components/badrequesterror_code.rb" + autoload :Channel, "moderation_api/models/components/channel.rb" + autoload :ConflictErrorCode, "moderation_api/models/components/conflicterror_code.rb" + autoload :ErrorIssue, "moderation_api/models/components/errorissue.rb" + autoload :InternalServerErrorCode, "moderation_api/models/components/internalservererror_code.rb" + autoload :NotFoundErrorCode, "moderation_api/models/components/notfounderror_code.rb" + autoload :Pagination, "moderation_api/models/components/pagination.rb" + autoload :PermissionDeniedErrorCode, "moderation_api/models/components/permissiondeniederror_code.rb" + autoload :Project, "moderation_api/models/components/project.rb" + autoload :ProjectWithKey, "moderation_api/models/components/projectwithkey.rb" + autoload( + :ProjectWithKeyGlobalFlaggingMode, + "moderation_api/models/components/projectwithkey_globalflaggingmode.rb" + ) + autoload :ProjectGlobalFlaggingMode, "moderation_api/models/components/project_globalflaggingmode.rb" + autoload :PublicAuthor, "moderation_api/models/components/publicauthor.rb" + autoload :RateLimitErrorCode, "moderation_api/models/components/ratelimiterror_code.rb" + autoload :Security, "moderation_api/models/components/security.rb" + autoload :Block, "moderation_api/models/components/block.rb" + autoload :ContentType, "moderation_api/models/components/contenttype.rb" + autoload :FlaggingMode, "moderation_api/models/components/flaggingmode.rb" + autoload :Metadata, "moderation_api/models/components/metadata.rb" + autoload :Metrics, "moderation_api/models/components/metrics.rb" + autoload :Path, "moderation_api/models/components/path.rb" + autoload :RiskEvaluation, "moderation_api/models/components/risk_evaluation.rb" + autoload :Status, "moderation_api/models/components/status.rb" + autoload :TranscriptionQuality, "moderation_api/models/components/transcriptionquality.rb" + autoload :TrustLevel, "moderation_api/models/components/trust_level.rb" + end + end +end diff --git a/lib/moderation_api/models/components/authenticationerror_code.rb b/lib/moderation_api/models/components/authenticationerror_code.rb new file mode 100644 index 00000000..a0a8baa4 --- /dev/null +++ b/lib/moderation_api/models/components/authenticationerror_code.rb @@ -0,0 +1,28 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Components + # AuthenticationErrorCode - Exactly what went wrong. Stable; safe to branch on. New codes may be added. + # + # - `unauthorized`: Authentication failed. + # - `missing_api_key`: No API key in the `Authorization` header. + # - `malformed_api_key`: The `Authorization` header does not contain a valid key format. + # - `invalid_api_key`: The API key does not exist or was revoked. + class AuthenticationErrorCode + include ::Crystalline::Enum + enums do + UNAUTHORIZED = new("unauthorized") + MISSING_API_KEY = new("missing_api_key") + MALFORMED_API_KEY = new("malformed_api_key") + INVALID_API_KEY = new("invalid_api_key") + end + + open! + end + end + end +end diff --git a/lib/moderation_api/models/components/authenticationerror_code.rbi b/lib/moderation_api/models/components/authenticationerror_code.rbi new file mode 100644 index 00000000..006f4832 --- /dev/null +++ b/lib/moderation_api/models/components/authenticationerror_code.rbi @@ -0,0 +1,9 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Components::AuthenticationErrorCode + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Components::AuthenticationErrorCode +end diff --git a/lib/moderation_api/models/components/badrequesterror_code.rb b/lib/moderation_api/models/components/badrequesterror_code.rb new file mode 100644 index 00000000..93645a2b --- /dev/null +++ b/lib/moderation_api/models/components/badrequesterror_code.rb @@ -0,0 +1,24 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Components + # BadRequestErrorCode - Exactly what went wrong. Stable; safe to branch on. New codes may be added. + # + # - `invalid_request`: A parameter is invalid. `message` says which one. + # - `validation_failed`: The request body does not match the schema. `issues` lists each problem with its `path`. + class BadRequestErrorCode + include ::Crystalline::Enum + enums do + INVALID_REQUEST = new("invalid_request") + VALIDATION_FAILED = new("validation_failed") + end + + open! + end + end + end +end diff --git a/lib/moderation_api/models/components/badrequesterror_code.rbi b/lib/moderation_api/models/components/badrequesterror_code.rbi new file mode 100644 index 00000000..4d53b129 --- /dev/null +++ b/lib/moderation_api/models/components/badrequesterror_code.rbi @@ -0,0 +1,9 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Components::BadRequestErrorCode + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Components::BadRequestErrorCode +end diff --git a/lib/moderation_api/models/components/block.rb b/lib/moderation_api/models/components/block.rb new file mode 100644 index 00000000..49e14754 --- /dev/null +++ b/lib/moderation_api/models/components/block.rb @@ -0,0 +1,43 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Components + + class Block + extend T::Sig + include Crystalline::MetadataFields + + # The timestamp until which they are blocked if the author is suspended. + field( + :until_, + Crystalline::Nilable.new(::Float), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("until")}} + ) + # The moderators reason why the author was blocked or suspended. + field( + :reason, + Crystalline::Nilable.new(::String), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("reason")}} + ) + + sig { params(until_: T.nilable(::Float), reason: T.nilable(::String)).void } + def initialize(until_: nil, reason: nil) + @until_ = until_ + @reason = reason + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @until_ == other.until_ + return false unless @reason == other.reason + true + end + end + end + end +end diff --git a/lib/moderation_api/models/components/block.rbi b/lib/moderation_api/models/components/block.rbi new file mode 100644 index 00000000..a5d4cb1a --- /dev/null +++ b/lib/moderation_api/models/components/block.rbi @@ -0,0 +1,20 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Components::Block + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Components::Block + def until_ + end + + def until_=(str_) + end + + def reason + end + + def reason=(str_) + end +end diff --git a/lib/moderation_api/models/components/channel.rb b/lib/moderation_api/models/components/channel.rb new file mode 100644 index 00000000..5f5bc4aa --- /dev/null +++ b/lib/moderation_api/models/components/channel.rb @@ -0,0 +1,262 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Components + + class Channel + extend T::Sig + include Crystalline::MetadataFields + + # The ID of the channel. + field :id, ::String, {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("id"), required: true}} + # The ID of the project the channel is in. + field( + :project_id, + ::String, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("projectId"), required: true}} + ) + # The key you pass as `channel` when you moderate content. Unique in the project. + field :key, ::String, {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("key"), required: true}} + # The channel's name. + field( + :name, + ::String, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("name"), required: true}} + ) + # Whether requests that name no channel use this one. Each project has one default channel. + field( + :is_default, + Crystalline::Boolean.new, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("isDefault"), required: true}} + ) + # `ACTIVE` flags content. `DRY_RUN` evaluates content without flagging it. + field( + :flagging_mode, + Models::Components::FlaggingMode, + { + 'format_json': { + 'letter_case': ::ModerationApi::Utils.field_name("flaggingMode"), + required: true, + 'decoder': ::ModerationApi::Utils.open_enum_from_string(Models::Components::FlaggingMode, false) + } + } + ) + # Whether earlier messages in the conversation are read when moderating a message. + field( + :context_enabled, + Crystalline::Boolean.new, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("contextEnabled"), required: true}} + ) + # Whether images are moderated. + field( + :enable_image_moderation, + Crystalline::Boolean.new, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("enableImageModeration"), required: true}} + ) + # Whether videos are moderated. + field( + :enable_video_moderation, + Crystalline::Boolean.new, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("enableVideoModeration"), required: true}} + ) + # Whether audio is moderated. + field( + :enable_audio_moderation, + Crystalline::Boolean.new, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("enableAudioModeration"), required: true}} + ) + # Whether real-time voice streams are moderated. + field( + :enable_voice_moderation, + Crystalline::Boolean.new, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("enableVoiceModeration"), required: true}} + ) + # Whether audio and video transcripts are returned in responses. + field( + :include_transcript_in_response, + Crystalline::Boolean.new, + { + 'format_json': { + 'letter_case': ::ModerationApi::Utils.field_name("includeTranscriptInResponse"), + required: true + } + } + ) + # Trade-off between transcription speed and accuracy. + field( + :transcription_quality, + Models::Components::TranscriptionQuality, + { + 'format_json': { + 'letter_case': ::ModerationApi::Utils.field_name("transcriptionQuality"), + required: true, + 'decoder': ::ModerationApi::Utils.open_enum_from_string(Models::Components::TranscriptionQuality, false) + } + } + ) + # Whether look-alike Unicode characters are normalized before moderation. + field( + :unicode_spoof_detection_enabled, + Crystalline::Boolean.new, + { + 'format_json': { + 'letter_case': ::ModerationApi::Utils.field_name("unicodeSpoofDetectionEnabled"), + required: true + } + } + ) + # Seconds between frames captured from a video. + field( + :frame_capture_interval, + ::Float, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("frameCaptureInterval"), required: true}} + ) + # The most frames moderated per video. + field( + :max_frames_per_video, + ::Integer, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("maxFramesPerVideo"), required: true}} + ) + # Whether frames are spread evenly across the whole video. + field( + :spread_frames, + Crystalline::Boolean.new, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("spreadFrames"), required: true}} + ) + # When the channel was created. + field( + :created_at, + ::String, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("createdAt"), required: true}} + ) + # When the channel was last changed. + field( + :updated_at, + ::String, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("updatedAt"), required: true}} + ) + # The channel's description. + field( + :description, + Crystalline::Nilable.new(::String), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("description"), required: true}} + ) + + field( + :content_type, + Crystalline::Nilable.new(Models::Components::ContentType), + { + 'format_json': { + 'letter_case': ::ModerationApi::Utils.field_name("contentType"), + required: true, + 'decoder': ::ModerationApi::Utils.open_enum_from_string(Models::Components::ContentType, false) + } + } + ) + + sig { + params( + id: ::String, + project_id: ::String, + key: ::String, + name: ::String, + is_default: T::Boolean, + flagging_mode: Models::Components::FlaggingMode, + context_enabled: T::Boolean, + enable_image_moderation: T::Boolean, + enable_video_moderation: T::Boolean, + enable_audio_moderation: T::Boolean, + enable_voice_moderation: T::Boolean, + include_transcript_in_response: T::Boolean, + transcription_quality: Models::Components::TranscriptionQuality, + unicode_spoof_detection_enabled: T::Boolean, + frame_capture_interval: ::Float, + max_frames_per_video: ::Integer, + spread_frames: T::Boolean, + created_at: ::String, + updated_at: ::String, + description: T.nilable(::String), + content_type: T.nilable(Models::Components::ContentType) + ) + .void + } + def initialize( + id:, + project_id:, + key:, + name:, + is_default:, + flagging_mode:, + context_enabled:, + enable_image_moderation:, + enable_video_moderation:, + enable_audio_moderation:, + enable_voice_moderation:, + include_transcript_in_response:, + transcription_quality:, + unicode_spoof_detection_enabled:, + frame_capture_interval:, + max_frames_per_video:, + spread_frames:, + created_at:, + updated_at:, + description: nil, + content_type: nil + ) + @id = id + @project_id = project_id + @key = key + @name = name + @is_default = is_default + @flagging_mode = flagging_mode + @context_enabled = context_enabled + @enable_image_moderation = enable_image_moderation + @enable_video_moderation = enable_video_moderation + @enable_audio_moderation = enable_audio_moderation + @enable_voice_moderation = enable_voice_moderation + @include_transcript_in_response = include_transcript_in_response + @transcription_quality = transcription_quality + @unicode_spoof_detection_enabled = unicode_spoof_detection_enabled + @frame_capture_interval = frame_capture_interval + @max_frames_per_video = max_frames_per_video + @spread_frames = spread_frames + @created_at = created_at + @updated_at = updated_at + @description = description + @content_type = content_type + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @id == other.id + return false unless @project_id == other.project_id + return false unless @key == other.key + return false unless @name == other.name + return false unless @is_default == other.is_default + return false unless @flagging_mode == other.flagging_mode + return false unless @context_enabled == other.context_enabled + return false unless @enable_image_moderation == other.enable_image_moderation + return false unless @enable_video_moderation == other.enable_video_moderation + return false unless @enable_audio_moderation == other.enable_audio_moderation + return false unless @enable_voice_moderation == other.enable_voice_moderation + return false unless @include_transcript_in_response == other.include_transcript_in_response + return false unless @transcription_quality == other.transcription_quality + return false unless @unicode_spoof_detection_enabled == other.unicode_spoof_detection_enabled + return false unless @frame_capture_interval == other.frame_capture_interval + return false unless @max_frames_per_video == other.max_frames_per_video + return false unless @spread_frames == other.spread_frames + return false unless @created_at == other.created_at + return false unless @updated_at == other.updated_at + return false unless @description == other.description + return false unless @content_type == other.content_type + true + end + end + end + end +end diff --git a/lib/moderation_api/models/components/channel.rbi b/lib/moderation_api/models/components/channel.rbi new file mode 100644 index 00000000..a05bfb24 --- /dev/null +++ b/lib/moderation_api/models/components/channel.rbi @@ -0,0 +1,134 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Components::Channel + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Components::Channel + def id + end + + def id=(str_) + end + + def project_id + end + + def project_id=(str_) + end + + def key + end + + def key=(str_) + end + + def name + end + + def name=(str_) + end + + def is_default + end + + def is_default=(str_) + end + + def flagging_mode + end + + def flagging_mode=(str_) + end + + def context_enabled + end + + def context_enabled=(str_) + end + + def enable_image_moderation + end + + def enable_image_moderation=(str_) + end + + def enable_video_moderation + end + + def enable_video_moderation=(str_) + end + + def enable_audio_moderation + end + + def enable_audio_moderation=(str_) + end + + def enable_voice_moderation + end + + def enable_voice_moderation=(str_) + end + + def include_transcript_in_response + end + + def include_transcript_in_response=(str_) + end + + def transcription_quality + end + + def transcription_quality=(str_) + end + + def unicode_spoof_detection_enabled + end + + def unicode_spoof_detection_enabled=(str_) + end + + def frame_capture_interval + end + + def frame_capture_interval=(str_) + end + + def max_frames_per_video + end + + def max_frames_per_video=(str_) + end + + def spread_frames + end + + def spread_frames=(str_) + end + + def created_at + end + + def created_at=(str_) + end + + def updated_at + end + + def updated_at=(str_) + end + + def description + end + + def description=(str_) + end + + def content_type + end + + def content_type=(str_) + end +end diff --git a/lib/moderation_api/models/components/conflicterror_code.rb b/lib/moderation_api/models/components/conflicterror_code.rb new file mode 100644 index 00000000..5a29ec2d --- /dev/null +++ b/lib/moderation_api/models/components/conflicterror_code.rb @@ -0,0 +1,22 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Components + # ConflictErrorCode - Exactly what went wrong. Stable; safe to branch on. New codes may be added. + # + # - `resource_conflict`: The request conflicts with an existing resource. + class ConflictErrorCode + include ::Crystalline::Enum + enums do + RESOURCE_CONFLICT = new("resource_conflict") + end + + open! + end + end + end +end diff --git a/lib/moderation_api/models/components/conflicterror_code.rbi b/lib/moderation_api/models/components/conflicterror_code.rbi new file mode 100644 index 00000000..f6d1fb24 --- /dev/null +++ b/lib/moderation_api/models/components/conflicterror_code.rbi @@ -0,0 +1,9 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Components::ConflictErrorCode + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Components::ConflictErrorCode +end diff --git a/lib/moderation_api/models/components/contenttype.rb b/lib/moderation_api/models/components/contenttype.rb new file mode 100644 index 00000000..6ca85365 --- /dev/null +++ b/lib/moderation_api/models/components/contenttype.rb @@ -0,0 +1,28 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Components + # ContentType - The kind of content the channel moderates. + class ContentType + include ::Crystalline::Enum + enums do + PROFILE = new("profile") + MESSAGE = new("message") + POST = new("post") + COMMENT = new("comment") + EVENT = new("event") + PRODUCT = new("product") + REVIEW = new("review") + VOICE = new("voice") + OTHER = new("other") + end + + open! + end + end + end +end diff --git a/lib/moderation_api/models/components/contenttype.rbi b/lib/moderation_api/models/components/contenttype.rbi new file mode 100644 index 00000000..614796b2 --- /dev/null +++ b/lib/moderation_api/models/components/contenttype.rbi @@ -0,0 +1,9 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Components::ContentType + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Components::ContentType +end diff --git a/lib/moderation_api/models/components/errorissue.rb b/lib/moderation_api/models/components/errorissue.rb new file mode 100644 index 00000000..352f3032 --- /dev/null +++ b/lib/moderation_api/models/components/errorissue.rb @@ -0,0 +1,53 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Components + + class ErrorIssue + extend T::Sig + include Crystalline::MetadataFields + + # What is wrong. + field( + :message, + ::String, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("message"), required: true}} + ) + # Location of the invalid field in the request body. + field( + :path, + Crystalline::Nilable.new(Crystalline::Array.new(Crystalline::Union.new(::String, ::Float))), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("path")}} + ) + # Validation rule that failed. + field( + :code, + Crystalline::Nilable.new(::String), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("code")}} + ) + + sig { + params(message: ::String, path: T.nilable(T::Array[T.any(::String, ::Float)]), code: T.nilable(::String)).void + } + def initialize(message:, path: nil, code: nil) + @message = message + @path = path + @code = code + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @message == other.message + return false unless @path == other.path + return false unless @code == other.code + true + end + end + end + end +end diff --git a/lib/moderation_api/models/components/errorissue.rbi b/lib/moderation_api/models/components/errorissue.rbi new file mode 100644 index 00000000..2fc3eb94 --- /dev/null +++ b/lib/moderation_api/models/components/errorissue.rbi @@ -0,0 +1,26 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Components::ErrorIssue + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Components::ErrorIssue + def message + end + + def message=(str_) + end + + def path + end + + def path=(str_) + end + + def code + end + + def code=(str_) + end +end diff --git a/lib/moderation_api/models/components/flaggingmode.rb b/lib/moderation_api/models/components/flaggingmode.rb new file mode 100644 index 00000000..6cccb4e0 --- /dev/null +++ b/lib/moderation_api/models/components/flaggingmode.rb @@ -0,0 +1,21 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Components + # FlaggingMode - `ACTIVE` flags content. `DRY_RUN` evaluates content without flagging it. + class FlaggingMode + include ::Crystalline::Enum + enums do + DRY_RUN = new("DRY_RUN") + ACTIVE = new("ACTIVE") + end + + open! + end + end + end +end diff --git a/lib/moderation_api/models/components/flaggingmode.rbi b/lib/moderation_api/models/components/flaggingmode.rbi new file mode 100644 index 00000000..15093f46 --- /dev/null +++ b/lib/moderation_api/models/components/flaggingmode.rbi @@ -0,0 +1,9 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Components::FlaggingMode + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Components::FlaggingMode +end diff --git a/lib/moderation_api/models/components/internalservererror_code.rb b/lib/moderation_api/models/components/internalservererror_code.rb new file mode 100644 index 00000000..b216b32e --- /dev/null +++ b/lib/moderation_api/models/components/internalservererror_code.rb @@ -0,0 +1,22 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Components + # InternalServerErrorCode - Exactly what went wrong. Stable; safe to branch on. New codes may be added. + # + # - `internal_error`: Something went wrong on our side. Retry with backoff. + class InternalServerErrorCode + include ::Crystalline::Enum + enums do + INTERNAL_ERROR = new("internal_error") + end + + open! + end + end + end +end diff --git a/lib/moderation_api/models/components/internalservererror_code.rbi b/lib/moderation_api/models/components/internalservererror_code.rbi new file mode 100644 index 00000000..e29d9b68 --- /dev/null +++ b/lib/moderation_api/models/components/internalservererror_code.rbi @@ -0,0 +1,9 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Components::InternalServerErrorCode + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Components::InternalServerErrorCode +end diff --git a/lib/moderation_api/models/components/metadata.rb b/lib/moderation_api/models/components/metadata.rb new file mode 100644 index 00000000..e0343817 --- /dev/null +++ b/lib/moderation_api/models/components/metadata.rb @@ -0,0 +1,86 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Components + # Additional metadata provided by your system. We recommend including any relevant information that may assist in the moderation process. + class Metadata + extend T::Sig + include Crystalline::MetadataFields + + field( + :additional_properties, + Crystalline::Nilable.new(Crystalline::Hash.new(Symbol, ::Object)), + { + 'format_json': { + 'letter_case': ::ModerationApi::Utils.field_name("additional_properties"), + 'additional_properties': true + } + } + ) + # Whether the author's email is verified + field( + :email_verified, + Crystalline::Nilable.new(Crystalline::Boolean.new), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("email_verified")}} + ) + # Whether the author's phone number is verified + field( + :phone_verified, + Crystalline::Nilable.new(Crystalline::Boolean.new), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("phone_verified")}} + ) + # Whether the author's identity is verified + field( + :identity_verified, + Crystalline::Nilable.new(Crystalline::Boolean.new), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("identity_verified")}} + ) + # Whether the author is a paying customer + field( + :is_paying_customer, + Crystalline::Nilable.new(Crystalline::Boolean.new), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("is_paying_customer")}} + ) + + sig { + params( + additional_properties: T.nilable(T::Hash[Symbol, ::Object]), + email_verified: T.nilable(T::Boolean), + phone_verified: T.nilable(T::Boolean), + identity_verified: T.nilable(T::Boolean), + is_paying_customer: T.nilable(T::Boolean) + ) + .void + } + def initialize( + additional_properties: nil, + email_verified: nil, + phone_verified: nil, + identity_verified: nil, + is_paying_customer: nil + ) + @additional_properties = additional_properties + @email_verified = email_verified + @phone_verified = phone_verified + @identity_verified = identity_verified + @is_paying_customer = is_paying_customer + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @additional_properties == other.additional_properties + return false unless @email_verified == other.email_verified + return false unless @phone_verified == other.phone_verified + return false unless @identity_verified == other.identity_verified + return false unless @is_paying_customer == other.is_paying_customer + true + end + end + end + end +end diff --git a/lib/moderation_api/models/components/metadata.rbi b/lib/moderation_api/models/components/metadata.rbi new file mode 100644 index 00000000..2a2180de --- /dev/null +++ b/lib/moderation_api/models/components/metadata.rbi @@ -0,0 +1,38 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Components::Metadata + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Components::Metadata + def additional_properties + end + + def additional_properties=(str_) + end + + def email_verified + end + + def email_verified=(str_) + end + + def phone_verified + end + + def phone_verified=(str_) + end + + def identity_verified + end + + def identity_verified=(str_) + end + + def is_paying_customer + end + + def is_paying_customer=(str_) + end +end diff --git a/lib/moderation_api/models/components/metrics.rb b/lib/moderation_api/models/components/metrics.rb new file mode 100644 index 00000000..bd03ef18 --- /dev/null +++ b/lib/moderation_api/models/components/metrics.rb @@ -0,0 +1,51 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Components + + class Metrics + extend T::Sig + include Crystalline::MetadataFields + + # Total pieces of content + field( + :total_content, + ::Float, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("total_content"), required: true}} + ) + # Number of flagged content pieces + field( + :flagged_content, + ::Float, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("flagged_content"), required: true}} + ) + # Average sentiment score of content (-1 to 1). Requires a sentiment model in your project. + field( + :average_sentiment, + Crystalline::Nilable.new(::Float), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("average_sentiment")}} + ) + + sig { params(total_content: ::Float, flagged_content: ::Float, average_sentiment: T.nilable(::Float)).void } + def initialize(total_content:, flagged_content:, average_sentiment: nil) + @total_content = total_content + @flagged_content = flagged_content + @average_sentiment = average_sentiment + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @total_content == other.total_content + return false unless @flagged_content == other.flagged_content + return false unless @average_sentiment == other.average_sentiment + true + end + end + end + end +end diff --git a/lib/moderation_api/models/components/metrics.rbi b/lib/moderation_api/models/components/metrics.rbi new file mode 100644 index 00000000..925fab9a --- /dev/null +++ b/lib/moderation_api/models/components/metrics.rbi @@ -0,0 +1,26 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Components::Metrics + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Components::Metrics + def total_content + end + + def total_content=(str_) + end + + def flagged_content + end + + def flagged_content=(str_) + end + + def average_sentiment + end + + def average_sentiment=(str_) + end +end diff --git a/lib/moderation_api/models/components/notfounderror_code.rb b/lib/moderation_api/models/components/notfounderror_code.rb new file mode 100644 index 00000000..9e41ada5 --- /dev/null +++ b/lib/moderation_api/models/components/notfounderror_code.rb @@ -0,0 +1,36 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Components + # NotFoundErrorCode - Exactly what went wrong. Stable; safe to branch on. New codes may be added. + # + # - `resource_not_found`: The resource does not exist. + # - `action_not_found`: The action does not exist. + # - `author_not_found`: The author does not exist. + # - `queue_not_found`: The review queue does not exist. + # - `wordlist_not_found`: The wordlist does not exist. + # - `webhook_not_found`: The webhook does not exist. + # - `project_not_found`: The project does not exist. + # - `channel_not_found`: The channel does not exist. + class NotFoundErrorCode + include ::Crystalline::Enum + enums do + RESOURCE_NOT_FOUND = new("resource_not_found") + ACTION_NOT_FOUND = new("action_not_found") + AUTHOR_NOT_FOUND = new("author_not_found") + QUEUE_NOT_FOUND = new("queue_not_found") + WORDLIST_NOT_FOUND = new("wordlist_not_found") + WEBHOOK_NOT_FOUND = new("webhook_not_found") + PROJECT_NOT_FOUND = new("project_not_found") + CHANNEL_NOT_FOUND = new("channel_not_found") + end + + open! + end + end + end +end diff --git a/lib/moderation_api/models/components/notfounderror_code.rbi b/lib/moderation_api/models/components/notfounderror_code.rbi new file mode 100644 index 00000000..a8a35f4d --- /dev/null +++ b/lib/moderation_api/models/components/notfounderror_code.rbi @@ -0,0 +1,9 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Components::NotFoundErrorCode + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Components::NotFoundErrorCode +end diff --git a/lib/moderation_api/models/components/pagination.rb b/lib/moderation_api/models/components/pagination.rb new file mode 100644 index 00000000..aa4d0c98 --- /dev/null +++ b/lib/moderation_api/models/components/pagination.rb @@ -0,0 +1,70 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Components + # Where this page is in the full list. + class Pagination + extend T::Sig + include Crystalline::MetadataFields + + # The current page, starting at 1. + field( + :page, + ::Integer, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("page"), required: true}} + ) + # Number of items per page. + field( + :page_size, + ::Integer, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("pageSize"), required: true}} + ) + # Total number of items. + field( + :total, + ::Integer, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("total"), required: true}} + ) + # Total number of pages. + field( + :total_pages, + ::Integer, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("totalPages"), required: true}} + ) + # Whether there is a next page. + field( + :has_more, + Crystalline::Boolean.new, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("hasMore"), required: true}} + ) + + sig { + params(page: ::Integer, page_size: ::Integer, total: ::Integer, total_pages: ::Integer, has_more: T::Boolean) + .void + } + def initialize(page:, page_size:, total:, total_pages:, has_more:) + @page = page + @page_size = page_size + @total = total + @total_pages = total_pages + @has_more = has_more + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @page == other.page + return false unless @page_size == other.page_size + return false unless @total == other.total + return false unless @total_pages == other.total_pages + return false unless @has_more == other.has_more + true + end + end + end + end +end diff --git a/lib/moderation_api/models/components/pagination.rbi b/lib/moderation_api/models/components/pagination.rbi new file mode 100644 index 00000000..15b75b7d --- /dev/null +++ b/lib/moderation_api/models/components/pagination.rbi @@ -0,0 +1,38 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Components::Pagination + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Components::Pagination + def page + end + + def page=(str_) + end + + def page_size + end + + def page_size=(str_) + end + + def total + end + + def total=(str_) + end + + def total_pages + end + + def total_pages=(str_) + end + + def has_more + end + + def has_more=(str_) + end +end diff --git a/lib/moderation_api/models/components/path.rb b/lib/moderation_api/models/components/path.rb new file mode 100644 index 00000000..570a1116 --- /dev/null +++ b/lib/moderation_api/models/components/path.rb @@ -0,0 +1,25 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Components + + class Path + extend T::Sig + include Crystalline::MetadataFields + + def initialize + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + true + end + end + end + end +end diff --git a/lib/moderation_api/models/components/path.rbi b/lib/moderation_api/models/components/path.rbi new file mode 100644 index 00000000..5daab4ab --- /dev/null +++ b/lib/moderation_api/models/components/path.rbi @@ -0,0 +1,9 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Components::Path + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Components::Path +end diff --git a/lib/moderation_api/models/components/permissiondeniederror_code.rb b/lib/moderation_api/models/components/permissiondeniederror_code.rb new file mode 100644 index 00000000..5c2bc42b --- /dev/null +++ b/lib/moderation_api/models/components/permissiondeniederror_code.rb @@ -0,0 +1,38 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Components + # PermissionDeniedErrorCode - Exactly what went wrong. Stable; safe to branch on. New codes may be added. + # + # - `permission_denied`: The API key cannot perform this request. + # - `account_disabled`: The organization account is disabled. + # - `quota_exceeded`: The organization has used all API requests on its plan. + # - `plan_feature_unavailable`: The current plan does not include this feature. + # - `plan_limit_exceeded`: The request goes over a limit of the current plan. + # - `project_key_required`: This endpoint needs a project API key, but an organization key was used. + # - `organization_key_required`: This endpoint needs an organization API key, but a project key was used. + # - `missing_key_permission`: The organization key does not have the permission this endpoint needs. + # - `project_not_reachable`: The organization key is limited to other projects. + class PermissionDeniedErrorCode + include ::Crystalline::Enum + enums do + PERMISSION_DENIED = new("permission_denied") + ACCOUNT_DISABLED = new("account_disabled") + QUOTA_EXCEEDED = new("quota_exceeded") + PLAN_FEATURE_UNAVAILABLE = new("plan_feature_unavailable") + PLAN_LIMIT_EXCEEDED = new("plan_limit_exceeded") + PROJECT_KEY_REQUIRED = new("project_key_required") + ORGANIZATION_KEY_REQUIRED = new("organization_key_required") + MISSING_KEY_PERMISSION = new("missing_key_permission") + PROJECT_NOT_REACHABLE = new("project_not_reachable") + end + + open! + end + end + end +end diff --git a/lib/moderation_api/models/components/permissiondeniederror_code.rbi b/lib/moderation_api/models/components/permissiondeniederror_code.rbi new file mode 100644 index 00000000..5012c331 --- /dev/null +++ b/lib/moderation_api/models/components/permissiondeniederror_code.rbi @@ -0,0 +1,9 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Components::PermissionDeniedErrorCode + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Components::PermissionDeniedErrorCode +end diff --git a/lib/moderation_api/models/components/project.rb b/lib/moderation_api/models/components/project.rb new file mode 100644 index 00000000..3b8a2e3b --- /dev/null +++ b/lib/moderation_api/models/components/project.rb @@ -0,0 +1,137 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Components + + class Project + extend T::Sig + include Crystalline::MetadataFields + + # The ID of the project. + field :id, ::String, {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("id"), required: true}} + # The project's name. + field( + :name, + ::String, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("name"), required: true}} + ) + # `ACTIVE` flags content. `DRY_RUN` evaluates content without flagging it, for testing a setup. + field( + :global_flagging_mode, + Models::Components::ProjectGlobalFlaggingMode, + { + 'format_json': { + 'letter_case': ::ModerationApi::Utils.field_name("globalFlaggingMode"), + required: true, + 'decoder': ::ModerationApi::Utils.open_enum_from_string( + Models::Components::ProjectGlobalFlaggingMode, + false + ) + } + } + ) + # Whether moderated content is stored and shown in the dashboard. + field( + :enable_request_logging, + Crystalline::Boolean.new, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("enableRequestLogging"), required: true}} + ) + # Whether decisions made in the review queue are recorded in the project's casebook. + field( + :casebook_enabled, + Crystalline::Boolean.new, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("casebookEnabled"), required: true}} + ) + # When the project was created. + field( + :created_at, + ::String, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("createdAt"), required: true}} + ) + # When the project was last changed. + field( + :updated_at, + ::String, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("updatedAt"), required: true}} + ) + # The project's description. + field( + :description, + Crystalline::Nilable.new(::String), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("description"), required: true}} + ) + # The website or app the project moderates content for. + field( + :domain, + Crystalline::Nilable.new(::String), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("domain"), required: true}} + ) + # What the platform is and who uses it. AI moderation reads it to judge content in context. + field( + :context, + Crystalline::Nilable.new(::String), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("context"), required: true}} + ) + + sig { + params( + id: ::String, + name: ::String, + global_flagging_mode: Models::Components::ProjectGlobalFlaggingMode, + enable_request_logging: T::Boolean, + casebook_enabled: T::Boolean, + created_at: ::String, + updated_at: ::String, + description: T.nilable(::String), + domain: T.nilable(::String), + context: T.nilable(::String) + ) + .void + } + def initialize( + id:, + name:, + global_flagging_mode:, + enable_request_logging:, + casebook_enabled:, + created_at:, + updated_at:, + description: nil, + domain: nil, + context: nil + ) + @id = id + @name = name + @global_flagging_mode = global_flagging_mode + @enable_request_logging = enable_request_logging + @casebook_enabled = casebook_enabled + @created_at = created_at + @updated_at = updated_at + @description = description + @domain = domain + @context = context + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @id == other.id + return false unless @name == other.name + return false unless @global_flagging_mode == other.global_flagging_mode + return false unless @enable_request_logging == other.enable_request_logging + return false unless @casebook_enabled == other.casebook_enabled + return false unless @created_at == other.created_at + return false unless @updated_at == other.updated_at + return false unless @description == other.description + return false unless @domain == other.domain + return false unless @context == other.context + true + end + end + end + end +end diff --git a/lib/moderation_api/models/components/project.rbi b/lib/moderation_api/models/components/project.rbi new file mode 100644 index 00000000..3f348d9d --- /dev/null +++ b/lib/moderation_api/models/components/project.rbi @@ -0,0 +1,68 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Components::Project + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Components::Project + def id + end + + def id=(str_) + end + + def name + end + + def name=(str_) + end + + def global_flagging_mode + end + + def global_flagging_mode=(str_) + end + + def enable_request_logging + end + + def enable_request_logging=(str_) + end + + def casebook_enabled + end + + def casebook_enabled=(str_) + end + + def created_at + end + + def created_at=(str_) + end + + def updated_at + end + + def updated_at=(str_) + end + + def description + end + + def description=(str_) + end + + def domain + end + + def domain=(str_) + end + + def context + end + + def context=(str_) + end +end diff --git a/lib/moderation_api/models/components/project_globalflaggingmode.rb b/lib/moderation_api/models/components/project_globalflaggingmode.rb new file mode 100644 index 00000000..f99a7fc4 --- /dev/null +++ b/lib/moderation_api/models/components/project_globalflaggingmode.rb @@ -0,0 +1,21 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Components + # ProjectGlobalFlaggingMode - `ACTIVE` flags content. `DRY_RUN` evaluates content without flagging it, for testing a setup. + class ProjectGlobalFlaggingMode + include ::Crystalline::Enum + enums do + DRY_RUN = new("DRY_RUN") + ACTIVE = new("ACTIVE") + end + + open! + end + end + end +end diff --git a/lib/moderation_api/models/components/project_globalflaggingmode.rbi b/lib/moderation_api/models/components/project_globalflaggingmode.rbi new file mode 100644 index 00000000..120db815 --- /dev/null +++ b/lib/moderation_api/models/components/project_globalflaggingmode.rbi @@ -0,0 +1,9 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Components::ProjectGlobalFlaggingMode + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Components::ProjectGlobalFlaggingMode +end diff --git a/lib/moderation_api/models/components/projectwithkey.rb b/lib/moderation_api/models/components/projectwithkey.rb new file mode 100644 index 00000000..d4b78f83 --- /dev/null +++ b/lib/moderation_api/models/components/projectwithkey.rb @@ -0,0 +1,147 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Components + + class ProjectWithKey + extend T::Sig + include Crystalline::MetadataFields + + # The ID of the project. + field :id, ::String, {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("id"), required: true}} + # The project's name. + field( + :name, + ::String, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("name"), required: true}} + ) + # `ACTIVE` flags content. `DRY_RUN` evaluates content without flagging it, for testing a setup. + field( + :global_flagging_mode, + Models::Components::ProjectWithKeyGlobalFlaggingMode, + { + 'format_json': { + 'letter_case': ::ModerationApi::Utils.field_name("globalFlaggingMode"), + required: true, + 'decoder': ::ModerationApi::Utils.open_enum_from_string( + Models::Components::ProjectWithKeyGlobalFlaggingMode, + false + ) + } + } + ) + # Whether moderated content is stored and shown in the dashboard. + field( + :enable_request_logging, + Crystalline::Boolean.new, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("enableRequestLogging"), required: true}} + ) + # Whether decisions made in the review queue are recorded in the project's casebook. + field( + :casebook_enabled, + Crystalline::Boolean.new, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("casebookEnabled"), required: true}} + ) + # When the project was created. + field( + :created_at, + ::String, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("createdAt"), required: true}} + ) + # When the project was last changed. + field( + :updated_at, + ::String, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("updatedAt"), required: true}} + ) + # A secret API key for the new project. Use it to moderate content in this project. It is also shown in the project's settings. + field( + :secret_key, + ::String, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("secretKey"), required: true}} + ) + # The project's description. + field( + :description, + Crystalline::Nilable.new(::String), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("description"), required: true}} + ) + # The website or app the project moderates content for. + field( + :domain, + Crystalline::Nilable.new(::String), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("domain"), required: true}} + ) + # What the platform is and who uses it. AI moderation reads it to judge content in context. + field( + :context, + Crystalline::Nilable.new(::String), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("context"), required: true}} + ) + + sig { + params( + id: ::String, + name: ::String, + global_flagging_mode: Models::Components::ProjectWithKeyGlobalFlaggingMode, + enable_request_logging: T::Boolean, + casebook_enabled: T::Boolean, + created_at: ::String, + updated_at: ::String, + secret_key: ::String, + description: T.nilable(::String), + domain: T.nilable(::String), + context: T.nilable(::String) + ) + .void + } + def initialize( + id:, + name:, + global_flagging_mode:, + enable_request_logging:, + casebook_enabled:, + created_at:, + updated_at:, + secret_key:, + description: nil, + domain: nil, + context: nil + ) + @id = id + @name = name + @global_flagging_mode = global_flagging_mode + @enable_request_logging = enable_request_logging + @casebook_enabled = casebook_enabled + @created_at = created_at + @updated_at = updated_at + @secret_key = secret_key + @description = description + @domain = domain + @context = context + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @id == other.id + return false unless @name == other.name + return false unless @global_flagging_mode == other.global_flagging_mode + return false unless @enable_request_logging == other.enable_request_logging + return false unless @casebook_enabled == other.casebook_enabled + return false unless @created_at == other.created_at + return false unless @updated_at == other.updated_at + return false unless @secret_key == other.secret_key + return false unless @description == other.description + return false unless @domain == other.domain + return false unless @context == other.context + true + end + end + end + end +end diff --git a/lib/moderation_api/models/components/projectwithkey.rbi b/lib/moderation_api/models/components/projectwithkey.rbi new file mode 100644 index 00000000..14cfaacd --- /dev/null +++ b/lib/moderation_api/models/components/projectwithkey.rbi @@ -0,0 +1,74 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Components::ProjectWithKey + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Components::ProjectWithKey + def id + end + + def id=(str_) + end + + def name + end + + def name=(str_) + end + + def global_flagging_mode + end + + def global_flagging_mode=(str_) + end + + def enable_request_logging + end + + def enable_request_logging=(str_) + end + + def casebook_enabled + end + + def casebook_enabled=(str_) + end + + def created_at + end + + def created_at=(str_) + end + + def updated_at + end + + def updated_at=(str_) + end + + def secret_key + end + + def secret_key=(str_) + end + + def description + end + + def description=(str_) + end + + def domain + end + + def domain=(str_) + end + + def context + end + + def context=(str_) + end +end diff --git a/lib/moderation_api/models/components/projectwithkey_globalflaggingmode.rb b/lib/moderation_api/models/components/projectwithkey_globalflaggingmode.rb new file mode 100644 index 00000000..75e6226a --- /dev/null +++ b/lib/moderation_api/models/components/projectwithkey_globalflaggingmode.rb @@ -0,0 +1,21 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Components + # ProjectWithKeyGlobalFlaggingMode - `ACTIVE` flags content. `DRY_RUN` evaluates content without flagging it, for testing a setup. + class ProjectWithKeyGlobalFlaggingMode + include ::Crystalline::Enum + enums do + DRY_RUN = new("DRY_RUN") + ACTIVE = new("ACTIVE") + end + + open! + end + end + end +end diff --git a/lib/moderation_api/models/components/projectwithkey_globalflaggingmode.rbi b/lib/moderation_api/models/components/projectwithkey_globalflaggingmode.rbi new file mode 100644 index 00000000..4bceb9fa --- /dev/null +++ b/lib/moderation_api/models/components/projectwithkey_globalflaggingmode.rbi @@ -0,0 +1,9 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Components::ProjectWithKeyGlobalFlaggingMode + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Components::ProjectWithKeyGlobalFlaggingMode +end diff --git a/lib/moderation_api/models/components/publicauthor.rb b/lib/moderation_api/models/components/publicauthor.rb new file mode 100644 index 00000000..686f4766 --- /dev/null +++ b/lib/moderation_api/models/components/publicauthor.rb @@ -0,0 +1,194 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Components + + class PublicAuthor + extend T::Sig + include Crystalline::MetadataFields + + # Author ID in Moderation API + field :id, ::String, {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("id"), required: true}} + # Timestamp when author first appeared + field( + :first_seen, + ::Float, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("first_seen"), required: true}} + ) + # Timestamp of last activity + field( + :last_seen, + ::Float, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("last_seen"), required: true}} + ) + # Current author status + field( + :status, + Models::Components::Status, + { + 'format_json': { + 'letter_case': ::ModerationApi::Utils.field_name("status"), + required: true, + 'decoder': ::ModerationApi::Utils.open_enum_from_string(Models::Components::Status, false) + } + } + ) + + field( + :trust_level, + Models::Components::TrustLevel, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("trust_level"), required: true}} + ) + + field( + :metrics, + Models::Components::Metrics, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("metrics"), required: true}} + ) + # Additional metadata provided by your system. We recommend including any relevant information that may assist in the moderation process. + field( + :metadata, + Models::Components::Metadata, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("metadata"), required: true}} + ) + # Block or suspension details, if applicable. Null if the author is enabled. + field( + :block, + Crystalline::Nilable.new(Models::Components::Block), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("block"), required: true}} + ) + # Risk assessment details, if available. + field( + :risk_evaluation, + Crystalline::Nilable.new(Models::Components::RiskEvaluation), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("risk_evaluation"), required: true}} + ) + # The author's ID from your system + field( + :external_id, + Crystalline::Nilable.new(::String), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("external_id")}} + ) + # URL of the author's profile picture + field( + :profile_picture, + Crystalline::Nilable.new(::String), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("profile_picture")}} + ) + # URL of the author's external profile + field( + :external_link, + Crystalline::Nilable.new(::String), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("external_link")}} + ) + # Author name or identifier + field( + :name, + Crystalline::Nilable.new(::String), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("name")}} + ) + # Author email address + field( + :email, + Crystalline::Nilable.new(::String), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("email")}} + ) + # The author's company or organization + field( + :company, + Crystalline::Nilable.new(::String), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("company")}} + ) + # Timestamp of last incident + field( + :last_incident, + Crystalline::Nilable.new(::Float), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("last_incident")}} + ) + + sig { + params( + id: ::String, + first_seen: ::Float, + last_seen: ::Float, + status: Models::Components::Status, + trust_level: Models::Components::TrustLevel, + metrics: Models::Components::Metrics, + metadata: Models::Components::Metadata, + block: T.nilable(Models::Components::Block), + risk_evaluation: T.nilable(Models::Components::RiskEvaluation), + external_id: T.nilable(::String), + profile_picture: T.nilable(::String), + external_link: T.nilable(::String), + name: T.nilable(::String), + email: T.nilable(::String), + company: T.nilable(::String), + last_incident: T.nilable(::Float) + ) + .void + } + def initialize( + id:, + first_seen:, + last_seen:, + status:, + trust_level:, + metrics:, + metadata:, + block: nil, + risk_evaluation: nil, + external_id: nil, + profile_picture: nil, + external_link: nil, + name: nil, + email: nil, + company: nil, + last_incident: nil + ) + @id = id + @first_seen = first_seen + @last_seen = last_seen + @status = status + @trust_level = trust_level + @metrics = metrics + @metadata = metadata + @block = block + @risk_evaluation = risk_evaluation + @external_id = external_id + @profile_picture = profile_picture + @external_link = external_link + @name = name + @email = email + @company = company + @last_incident = last_incident + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @id == other.id + return false unless @first_seen == other.first_seen + return false unless @last_seen == other.last_seen + return false unless @status == other.status + return false unless @trust_level == other.trust_level + return false unless @metrics == other.metrics + return false unless @metadata == other.metadata + return false unless @block == other.block + return false unless @risk_evaluation == other.risk_evaluation + return false unless @external_id == other.external_id + return false unless @profile_picture == other.profile_picture + return false unless @external_link == other.external_link + return false unless @name == other.name + return false unless @email == other.email + return false unless @company == other.company + return false unless @last_incident == other.last_incident + true + end + end + end + end +end diff --git a/lib/moderation_api/models/components/publicauthor.rbi b/lib/moderation_api/models/components/publicauthor.rbi new file mode 100644 index 00000000..a5d58d45 --- /dev/null +++ b/lib/moderation_api/models/components/publicauthor.rbi @@ -0,0 +1,104 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Components::PublicAuthor + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Components::PublicAuthor + def id + end + + def id=(str_) + end + + def first_seen + end + + def first_seen=(str_) + end + + def last_seen + end + + def last_seen=(str_) + end + + def status + end + + def status=(str_) + end + + def trust_level + end + + def trust_level=(str_) + end + + def metrics + end + + def metrics=(str_) + end + + def metadata + end + + def metadata=(str_) + end + + def block + end + + def block=(str_) + end + + def risk_evaluation + end + + def risk_evaluation=(str_) + end + + def external_id + end + + def external_id=(str_) + end + + def profile_picture + end + + def profile_picture=(str_) + end + + def external_link + end + + def external_link=(str_) + end + + def name + end + + def name=(str_) + end + + def email + end + + def email=(str_) + end + + def company + end + + def company=(str_) + end + + def last_incident + end + + def last_incident=(str_) + end +end diff --git a/lib/moderation_api/models/components/ratelimiterror_code.rb b/lib/moderation_api/models/components/ratelimiterror_code.rb new file mode 100644 index 00000000..b6c7767e --- /dev/null +++ b/lib/moderation_api/models/components/ratelimiterror_code.rb @@ -0,0 +1,22 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Components + # RateLimitErrorCode - Exactly what went wrong. Stable; safe to branch on. New codes may be added. + # + # - `rate_limit_exceeded`: Too many requests. Wait for the `Retry-After` seconds. + class RateLimitErrorCode + include ::Crystalline::Enum + enums do + RATE_LIMIT_EXCEEDED = new("rate_limit_exceeded") + end + + open! + end + end + end +end diff --git a/lib/moderation_api/models/components/ratelimiterror_code.rbi b/lib/moderation_api/models/components/ratelimiterror_code.rbi new file mode 100644 index 00000000..7ebe3a20 --- /dev/null +++ b/lib/moderation_api/models/components/ratelimiterror_code.rbi @@ -0,0 +1,9 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Components::RateLimitErrorCode + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Components::RateLimitErrorCode +end diff --git a/lib/moderation_api/models/components/risk_evaluation.rb b/lib/moderation_api/models/components/risk_evaluation.rb new file mode 100644 index 00000000..a4d8dce5 --- /dev/null +++ b/lib/moderation_api/models/components/risk_evaluation.rb @@ -0,0 +1,35 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Components + + class RiskEvaluation + extend T::Sig + include Crystalline::MetadataFields + + # Calculated risk level based on more than 10 behavioral signals. + field( + :risk_level, + Crystalline::Nilable.new(::Float), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("risk_level")}} + ) + + sig { params(risk_level: T.nilable(::Float)).void } + def initialize(risk_level: nil) + @risk_level = risk_level + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @risk_level == other.risk_level + true + end + end + end + end +end diff --git a/lib/moderation_api/models/components/risk_evaluation.rbi b/lib/moderation_api/models/components/risk_evaluation.rbi new file mode 100644 index 00000000..34a39a2e --- /dev/null +++ b/lib/moderation_api/models/components/risk_evaluation.rbi @@ -0,0 +1,14 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Components::RiskEvaluation + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Components::RiskEvaluation + def risk_level + end + + def risk_level=(str_) + end +end diff --git a/lib/moderation_api/models/components/security.rb b/lib/moderation_api/models/components/security.rb new file mode 100644 index 00000000..7ed2a893 --- /dev/null +++ b/lib/moderation_api/models/components/security.rb @@ -0,0 +1,34 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Components + + class Security + extend T::Sig + include Crystalline::MetadataFields + + field( + :secret_key, + ::String, + {'security': {'scheme': true, 'type': "http", 'sub_type': "bearer", 'field_name': "Authorization"}} + ) + + sig { params(secret_key: ::String).void } + def initialize(secret_key:) + @secret_key = secret_key + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @secret_key == other.secret_key + true + end + end + end + end +end diff --git a/lib/moderation_api/models/components/security.rbi b/lib/moderation_api/models/components/security.rbi new file mode 100644 index 00000000..5101fc24 --- /dev/null +++ b/lib/moderation_api/models/components/security.rbi @@ -0,0 +1,14 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Components::Security + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Components::Security + def secret_key + end + + def secret_key=(str_) + end +end diff --git a/lib/moderation_api/models/components/status.rb b/lib/moderation_api/models/components/status.rb new file mode 100644 index 00000000..d739f091 --- /dev/null +++ b/lib/moderation_api/models/components/status.rb @@ -0,0 +1,22 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Components + # Status - Current author status + class Status + include ::Crystalline::Enum + enums do + ENABLED = new("enabled") + SUSPENDED = new("suspended") + BLOCKED = new("blocked") + end + + open! + end + end + end +end diff --git a/lib/moderation_api/models/components/status.rbi b/lib/moderation_api/models/components/status.rbi new file mode 100644 index 00000000..548a323e --- /dev/null +++ b/lib/moderation_api/models/components/status.rbi @@ -0,0 +1,9 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Components::Status + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Components::Status +end diff --git a/lib/moderation_api/models/components/transcriptionquality.rb b/lib/moderation_api/models/components/transcriptionquality.rb new file mode 100644 index 00000000..2963b08f --- /dev/null +++ b/lib/moderation_api/models/components/transcriptionquality.rb @@ -0,0 +1,22 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Components + # TranscriptionQuality - Trade-off between transcription speed and accuracy. + class TranscriptionQuality + include ::Crystalline::Enum + enums do + SPEED = new("SPEED") + BALANCED = new("BALANCED") + ACCURACY = new("ACCURACY") + end + + open! + end + end + end +end diff --git a/lib/moderation_api/models/components/transcriptionquality.rbi b/lib/moderation_api/models/components/transcriptionquality.rbi new file mode 100644 index 00000000..5b69ea72 --- /dev/null +++ b/lib/moderation_api/models/components/transcriptionquality.rbi @@ -0,0 +1,9 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Components::TranscriptionQuality + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Components::TranscriptionQuality +end diff --git a/lib/moderation_api/models/components/trust_level.rb b/lib/moderation_api/models/components/trust_level.rb new file mode 100644 index 00000000..4f45e819 --- /dev/null +++ b/lib/moderation_api/models/components/trust_level.rb @@ -0,0 +1,43 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Components + + class TrustLevel + extend T::Sig + include Crystalline::MetadataFields + + # Author trust level (-1, 0, 1, 2, 3, or 4) + field( + :level, + ::Float, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("level"), required: true}} + ) + # True if the trust level was set manually by a moderator + field( + :manual, + Crystalline::Boolean.new, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("manual"), required: true}} + ) + + sig { params(level: ::Float, manual: T::Boolean).void } + def initialize(level:, manual:) + @level = level + @manual = manual + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @level == other.level + return false unless @manual == other.manual + true + end + end + end + end +end diff --git a/lib/moderation_api/models/components/trust_level.rbi b/lib/moderation_api/models/components/trust_level.rbi new file mode 100644 index 00000000..cd7cc1e1 --- /dev/null +++ b/lib/moderation_api/models/components/trust_level.rbi @@ -0,0 +1,20 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Components::TrustLevel + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Components::TrustLevel + def level + end + + def level=(str_) + end + + def manual + end + + def manual=(str_) + end +end diff --git a/lib/moderation_api/models/content_stream_params.rb b/lib/moderation_api/models/content_stream_params.rb deleted file mode 100644 index 0a40c396..00000000 --- a/lib/moderation_api/models/content_stream_params.rb +++ /dev/null @@ -1,29 +0,0 @@ -# frozen_string_literal: true - -module ModerationAPI - module Models - # @see ModerationAPI::Resources::Content#stream - class ContentStreamParams < ModerationAPI::Internal::Type::BaseModel - extend ModerationAPI::Internal::Type::RequestParameters::Converter - include ModerationAPI::Internal::Type::RequestParameters - - # @!attribute sec_web_socket_protocol - # - # @return [Symbol, ModerationAPI::Models::ContentStreamParams::SecWebSocketProtocol] - required :sec_web_socket_protocol, enum: -> { ModerationAPI::ContentStreamParams::SecWebSocketProtocol } - - # @!method initialize(sec_web_socket_protocol:, request_options: {}) - # @param sec_web_socket_protocol [Symbol, ModerationAPI::Models::ContentStreamParams::SecWebSocketProtocol] - # @param request_options [ModerationAPI::RequestOptions, Hash{Symbol=>Object}] - - module SecWebSocketProtocol - extend ModerationAPI::Internal::Type::Enum - - MODERATIONAPI_V1 = :"moderationapi.v1" - - # @!method self.values - # @return [Array] - end - end - end -end diff --git a/lib/moderation_api/models/content_submit_params.rb b/lib/moderation_api/models/content_submit_params.rb deleted file mode 100644 index 5b7fa6b7..00000000 --- a/lib/moderation_api/models/content_submit_params.rb +++ /dev/null @@ -1,1381 +0,0 @@ -# frozen_string_literal: true - -module ModerationAPI - module Models - # @see ModerationAPI::Resources::Content#submit - class ContentSubmitParams < ModerationAPI::Internal::Type::BaseModel - extend ModerationAPI::Internal::Type::RequestParameters::Converter - include ModerationAPI::Internal::Type::RequestParameters - - # @!attribute content - # The content sent for moderation - # - # @return [ModerationAPI::Models::ContentSubmitParams::Content::Text, ModerationAPI::Models::ContentSubmitParams::Content::Image, ModerationAPI::Models::ContentSubmitParams::Content::Video, ModerationAPI::Models::ContentSubmitParams::Content::Audio, ModerationAPI::Models::ContentSubmitParams::Content::Object] - required :content, union: -> { ModerationAPI::ContentSubmitParams::Content } - - # @!attribute author_id - # The author of the content. - # - # @return [String, nil] - optional :author_id, String, api_name: :authorId - - # @!attribute channel - # Provide a channel ID or key. Will use the project's default channel if not - # provided. - # - # @return [String, nil] - optional :channel, String - - # @!attribute client_action - # A recommendation from your own client-side flagging (e.g. a banned-IP list or a - # third-party tool). Feeds the rules engine and can escalate or override the - # recommended action. Does not change whether our analysis flagged the content. - # - # @return [ModerationAPI::Models::ContentSubmitParams::ClientAction, nil] - optional :client_action, - -> { - ModerationAPI::ContentSubmitParams::ClientAction - }, - api_name: :clientAction - - # @!attribute content_id - # The unique ID of the content in your database. - # - # @return [String, nil] - optional :content_id, String, api_name: :contentId - - # @!attribute conversation_id - # For example the ID of a chat room or a post - # - # @return [String, nil] - optional :conversation_id, String, api_name: :conversationId - - # @!attribute do_not_store - # Do not store the content. The content won't enter the review queue - # - # @return [Boolean, nil] - optional :do_not_store, ModerationAPI::Internal::Type::Boolean, api_name: :doNotStore - - # @!attribute metadata - # Any metadata you want to store with the content - # - # @return [Hash{Symbol=>Object}, nil] - optional :metadata, ModerationAPI::Internal::Type::HashOf[ModerationAPI::Internal::Type::Unknown] - - # @!attribute meta_type - # The meta type of content being moderated - # - # @return [Symbol, ModerationAPI::Models::ContentSubmitParams::MetaType, nil] - optional :meta_type, enum: -> { ModerationAPI::ContentSubmitParams::MetaType }, api_name: :metaType - - # @!attribute policies - # (Enterprise) override the channel policies for this moderation request only. - # - # @return [Array, nil] - optional :policies, - -> { ModerationAPI::Internal::Type::ArrayOf[union: ModerationAPI::ContentSubmitParams::Policy] } - - # @!attribute timestamp - # Unix timestamp (in milliseconds) of when the content was created. Use if content - # is not submitted in real-time. - # - # @return [Float, nil] - optional :timestamp, Float - - # @!method initialize(content:, author_id: nil, channel: nil, client_action: nil, content_id: nil, conversation_id: nil, do_not_store: nil, metadata: nil, meta_type: nil, policies: nil, timestamp: nil, request_options: {}) - # Some parameter documentations has been truncated, see - # {ModerationAPI::Models::ContentSubmitParams} for more details. - # - # @param content [ModerationAPI::Models::ContentSubmitParams::Content::Text, ModerationAPI::Models::ContentSubmitParams::Content::Image, ModerationAPI::Models::ContentSubmitParams::Content::Video, ModerationAPI::Models::ContentSubmitParams::Content::Audio, ModerationAPI::Models::ContentSubmitParams::Content::Object] The content sent for moderation - # - # @param author_id [String] The author of the content. - # - # @param channel [String] Provide a channel ID or key. Will use the project's default channel if not provi - # - # @param client_action [ModerationAPI::Models::ContentSubmitParams::ClientAction] A recommendation from your own client-side flagging (e.g. a banned-IP list or a - # - # @param content_id [String] The unique ID of the content in your database. - # - # @param conversation_id [String] For example the ID of a chat room or a post - # - # @param do_not_store [Boolean] Do not store the content. The content won't enter the review queue - # - # @param metadata [Hash{Symbol=>Object}] Any metadata you want to store with the content - # - # @param meta_type [Symbol, ModerationAPI::Models::ContentSubmitParams::MetaType] The meta type of content being moderated - # - # @param policies [Array] (Enterprise) override the channel policies for this moderation request only. - # - # @param timestamp [Float] Unix timestamp (in milliseconds) of when the content was created. Use if content - # - # @param request_options [ModerationAPI::RequestOptions, Hash{Symbol=>Object}] - - # The content sent for moderation - module Content - extend ModerationAPI::Internal::Type::Union - - # Text - variant -> { ModerationAPI::ContentSubmitParams::Content::Text } - - # Image - variant -> { ModerationAPI::ContentSubmitParams::Content::Image } - - # Video - variant -> { ModerationAPI::ContentSubmitParams::Content::Video } - - # Audio - variant -> { ModerationAPI::ContentSubmitParams::Content::Audio } - - # Object - variant -> { ModerationAPI::ContentSubmitParams::Content::Object } - - class Text < ModerationAPI::Internal::Type::BaseModel - # @!attribute text - # The content text - # - # @return [String] - required :text, String - - # @!attribute type - # - # @return [Symbol, :text] - required :type, const: :text - - # @!method initialize(text:, type: :text) - # Text - # - # @param text [String] The content text - # - # @param type [Symbol, :text] - end - - class Image < ModerationAPI::Internal::Type::BaseModel - # @!attribute type - # - # @return [Symbol, :image] - required :type, const: :image - - # @!attribute data - # Base64-encoded image data. Either url or data must be provided. Note: base64 - # images are not stored and will not appear in the review queue. - # - # @return [String, nil] - optional :data, String - - # @!attribute url - # A public URL of the image content. Either url or data must be provided. - # - # @return [String, nil] - optional :url, String - - # @!method initialize(data: nil, url: nil, type: :image) - # Some parameter documentations has been truncated, see - # {ModerationAPI::Models::ContentSubmitParams::Content::Image} for more details. - # - # Image - # - # @param data [String] Base64-encoded image data. Either url or data must be provided. Note: base64 ima - # - # @param url [String] A public URL of the image content. Either url or data must be provided. - # - # @param type [Symbol, :image] - end - - class Video < ModerationAPI::Internal::Type::BaseModel - # @!attribute type - # - # @return [Symbol, :video] - required :type, const: :video - - # @!attribute url - # A public URL of the video content - # - # @return [String] - required :url, String - - # @!method initialize(url:, type: :video) - # Video - # - # @param url [String] A public URL of the video content - # - # @param type [Symbol, :video] - end - - class Audio < ModerationAPI::Internal::Type::BaseModel - # @!attribute type - # - # @return [Symbol, :audio] - required :type, const: :audio - - # @!attribute url - # The URL of the audio content - # - # @return [String] - required :url, String - - # @!method initialize(url:, type: :audio) - # Audio - # - # @param url [String] The URL of the audio content - # - # @param type [Symbol, :audio] - end - - class Object < ModerationAPI::Internal::Type::BaseModel - # @!attribute data - # Values in the object. Can be mixed content types. - # - # @return [Hash{Symbol=>ModerationAPI::Models::ContentSubmitParams::Content::Object::Data::Text, ModerationAPI::Models::ContentSubmitParams::Content::Object::Data::Image, ModerationAPI::Models::ContentSubmitParams::Content::Object::Data::Video, ModerationAPI::Models::ContentSubmitParams::Content::Object::Data::Audio}] - required :data, - -> { ModerationAPI::Internal::Type::HashOf[union: ModerationAPI::ContentSubmitParams::Content::Object::Data] } - - # @!attribute type - # - # @return [Symbol, :object] - required :type, const: :object - - # @!method initialize(data:, type: :object) - # Object - # - # @param data [Hash{Symbol=>ModerationAPI::Models::ContentSubmitParams::Content::Object::Data::Text, ModerationAPI::Models::ContentSubmitParams::Content::Object::Data::Image, ModerationAPI::Models::ContentSubmitParams::Content::Object::Data::Video, ModerationAPI::Models::ContentSubmitParams::Content::Object::Data::Audio}] Values in the object. Can be mixed content types. - # - # @param type [Symbol, :object] - - # Text - module Data - extend ModerationAPI::Internal::Type::Union - - # Text - variant -> { ModerationAPI::ContentSubmitParams::Content::Object::Data::Text } - - # Image - variant -> { ModerationAPI::ContentSubmitParams::Content::Object::Data::Image } - - # Video - variant -> { ModerationAPI::ContentSubmitParams::Content::Object::Data::Video } - - # Audio - variant -> { ModerationAPI::ContentSubmitParams::Content::Object::Data::Audio } - - class Text < ModerationAPI::Internal::Type::BaseModel - # @!attribute text - # The content text - # - # @return [String] - required :text, String - - # @!attribute type - # - # @return [Symbol, :text] - required :type, const: :text - - # @!method initialize(text:, type: :text) - # Text - # - # @param text [String] The content text - # - # @param type [Symbol, :text] - end - - class Image < ModerationAPI::Internal::Type::BaseModel - # @!attribute type - # - # @return [Symbol, :image] - required :type, const: :image - - # @!attribute data - # Base64-encoded image data. Either url or data must be provided. Note: base64 - # images are not stored and will not appear in the review queue. - # - # @return [String, nil] - optional :data, String - - # @!attribute url - # A public URL of the image content. Either url or data must be provided. - # - # @return [String, nil] - optional :url, String - - # @!method initialize(data: nil, url: nil, type: :image) - # Some parameter documentations has been truncated, see - # {ModerationAPI::Models::ContentSubmitParams::Content::Object::Data::Image} for - # more details. - # - # Image - # - # @param data [String] Base64-encoded image data. Either url or data must be provided. Note: base64 ima - # - # @param url [String] A public URL of the image content. Either url or data must be provided. - # - # @param type [Symbol, :image] - end - - class Video < ModerationAPI::Internal::Type::BaseModel - # @!attribute type - # - # @return [Symbol, :video] - required :type, const: :video - - # @!attribute url - # A public URL of the video content - # - # @return [String] - required :url, String - - # @!method initialize(url:, type: :video) - # Video - # - # @param url [String] A public URL of the video content - # - # @param type [Symbol, :video] - end - - class Audio < ModerationAPI::Internal::Type::BaseModel - # @!attribute type - # - # @return [Symbol, :audio] - required :type, const: :audio - - # @!attribute url - # The URL of the audio content - # - # @return [String] - required :url, String - - # @!method initialize(url:, type: :audio) - # Audio - # - # @param url [String] The URL of the audio content - # - # @param type [Symbol, :audio] - end - - # @!method self.variants - # @return [Array(ModerationAPI::Models::ContentSubmitParams::Content::Object::Data::Text, ModerationAPI::Models::ContentSubmitParams::Content::Object::Data::Image, ModerationAPI::Models::ContentSubmitParams::Content::Object::Data::Video, ModerationAPI::Models::ContentSubmitParams::Content::Object::Data::Audio)] - end - end - - # @!method self.variants - # @return [Array(ModerationAPI::Models::ContentSubmitParams::Content::Text, ModerationAPI::Models::ContentSubmitParams::Content::Image, ModerationAPI::Models::ContentSubmitParams::Content::Video, ModerationAPI::Models::ContentSubmitParams::Content::Audio, ModerationAPI::Models::ContentSubmitParams::Content::Object)] - end - - class ClientAction < ModerationAPI::Internal::Type::BaseModel - # @!attribute action - # Your recommendation for the content: allow, review, or reject. - # - # @return [Symbol, ModerationAPI::Models::ContentSubmitParams::ClientAction::Action] - required :action, enum: -> { ModerationAPI::ContentSubmitParams::ClientAction::Action } - - # @!attribute behavior - # How your recommendation combines with ours. Defaults to 'escalate', which only - # applies it when stricter than ours; 'override' replaces ours outright. - # - # @return [Symbol, ModerationAPI::Models::ContentSubmitParams::ClientAction::Behavior, nil] - optional :behavior, enum: -> { ModerationAPI::ContentSubmitParams::ClientAction::Behavior } - - # @!attribute reason - # A human-readable explanation for your recommendation. - # - # @return [String, nil] - optional :reason, String - - # @!attribute source - # Where your recommendation came from, e.g. "banned-ip". - # - # @return [String, nil] - optional :source, String - - # @!method initialize(action:, behavior: nil, reason: nil, source: nil) - # Some parameter documentations has been truncated, see - # {ModerationAPI::Models::ContentSubmitParams::ClientAction} for more details. - # - # A recommendation from your own client-side flagging (e.g. a banned-IP list or a - # third-party tool). Feeds the rules engine and can escalate or override the - # recommended action. Does not change whether our analysis flagged the content. - # - # @param action [Symbol, ModerationAPI::Models::ContentSubmitParams::ClientAction::Action] Your recommendation for the content: allow, review, or reject. - # - # @param behavior [Symbol, ModerationAPI::Models::ContentSubmitParams::ClientAction::Behavior] How your recommendation combines with ours. Defaults to 'escalate', which only a - # - # @param reason [String] A human-readable explanation for your recommendation. - # - # @param source [String] Where your recommendation came from, e.g. "banned-ip". - - # Your recommendation for the content: allow, review, or reject. - # - # @see ModerationAPI::Models::ContentSubmitParams::ClientAction#action - module Action - extend ModerationAPI::Internal::Type::Enum - - REVIEW = :review - ALLOW = :allow - REJECT = :reject - - # @!method self.values - # @return [Array] - end - - # How your recommendation combines with ours. Defaults to 'escalate', which only - # applies it when stricter than ours; 'override' replaces ours outright. - # - # @see ModerationAPI::Models::ContentSubmitParams::ClientAction#behavior - module Behavior - extend ModerationAPI::Internal::Type::Enum - - OVERRIDE = :override - ESCALATE = :escalate - - # @!method self.values - # @return [Array] - end - end - - # The meta type of content being moderated - module MetaType - extend ModerationAPI::Internal::Type::Enum - - PROFILE = :profile - MESSAGE = :message - POST = :post - COMMENT = :comment - EVENT = :event - PRODUCT = :product - REVIEW = :review - VOICE = :voice - OTHER = :other - - # @!method self.values - # @return [Array] - end - - module Policy - extend ModerationAPI::Internal::Type::Union - - variant -> { ModerationAPI::ContentSubmitParams::Policy::Toxicity } - - variant -> { ModerationAPI::ContentSubmitParams::Policy::PersonalInformation } - - variant -> { ModerationAPI::ContentSubmitParams::Policy::ToxicitySevere } - - variant -> { ModerationAPI::ContentSubmitParams::Policy::Hate } - - variant -> { ModerationAPI::ContentSubmitParams::Policy::Illicit } - - variant -> { ModerationAPI::ContentSubmitParams::Policy::IllicitDrugs } - - variant -> { ModerationAPI::ContentSubmitParams::Policy::IllicitAlcohol } - - variant -> { ModerationAPI::ContentSubmitParams::Policy::IllicitFirearms } - - variant -> { ModerationAPI::ContentSubmitParams::Policy::IllicitTobacco } - - variant -> { ModerationAPI::ContentSubmitParams::Policy::IllicitGambling } - - variant -> { ModerationAPI::ContentSubmitParams::Policy::Cannabis } - - variant -> { ModerationAPI::ContentSubmitParams::Policy::Adult } - - variant -> { ModerationAPI::ContentSubmitParams::Policy::Crypto } - - variant -> { ModerationAPI::ContentSubmitParams::Policy::Sexual } - - variant -> { ModerationAPI::ContentSubmitParams::Policy::SexualMinors } - - variant -> { ModerationAPI::ContentSubmitParams::Policy::Flirtation } - - variant -> { ModerationAPI::ContentSubmitParams::Policy::Profanity } - - variant -> { ModerationAPI::ContentSubmitParams::Policy::Violence } - - variant -> { ModerationAPI::ContentSubmitParams::Policy::SelfHarm } - - variant -> { ModerationAPI::ContentSubmitParams::Policy::Spam } - - variant -> { ModerationAPI::ContentSubmitParams::Policy::LowQualityContent } - - variant -> { ModerationAPI::ContentSubmitParams::Policy::FaceDetection } - - variant -> { ModerationAPI::ContentSubmitParams::Policy::SelfPromotion } - - variant -> { ModerationAPI::ContentSubmitParams::Policy::Political } - - variant -> { ModerationAPI::ContentSubmitParams::Policy::Religion } - - variant -> { ModerationAPI::ContentSubmitParams::Policy::CodeAbuse } - - variant -> { ModerationAPI::ContentSubmitParams::Policy::UnicodeSpoofing } - - variant -> { ModerationAPI::ContentSubmitParams::Policy::PiiMasking } - - variant -> { ModerationAPI::ContentSubmitParams::Policy::URLMasking } - - variant -> { ModerationAPI::ContentSubmitParams::Policy::URLRisk } - - variant -> { ModerationAPI::ContentSubmitParams::Policy::Guideline } - - class Toxicity < ModerationAPI::Internal::Type::BaseModel - # @!attribute id - # - # @return [Symbol, :toxicity] - required :id, const: :toxicity - - # @!attribute flag - # - # @return [Boolean] - required :flag, ModerationAPI::Internal::Type::Boolean - - # @!attribute threshold - # - # @return [Float, nil] - optional :threshold, Float - - # @!method initialize(flag:, threshold: nil, id: :toxicity) - # @param flag [Boolean] - # @param threshold [Float] - # @param id [Symbol, :toxicity] - end - - class PersonalInformation < ModerationAPI::Internal::Type::BaseModel - # @!attribute id - # - # @return [Symbol, :personal_information] - required :id, const: :personal_information - - # @!attribute flag - # - # @return [Boolean] - required :flag, ModerationAPI::Internal::Type::Boolean - - # @!attribute threshold - # - # @return [Float, nil] - optional :threshold, Float - - # @!method initialize(flag:, threshold: nil, id: :personal_information) - # @param flag [Boolean] - # @param threshold [Float] - # @param id [Symbol, :personal_information] - end - - class ToxicitySevere < ModerationAPI::Internal::Type::BaseModel - # @!attribute id - # - # @return [Symbol, :toxicity_severe] - required :id, const: :toxicity_severe - - # @!attribute flag - # - # @return [Boolean] - required :flag, ModerationAPI::Internal::Type::Boolean - - # @!attribute threshold - # - # @return [Float, nil] - optional :threshold, Float - - # @!method initialize(flag:, threshold: nil, id: :toxicity_severe) - # @param flag [Boolean] - # @param threshold [Float] - # @param id [Symbol, :toxicity_severe] - end - - class Hate < ModerationAPI::Internal::Type::BaseModel - # @!attribute id - # - # @return [Symbol, :hate] - required :id, const: :hate - - # @!attribute flag - # - # @return [Boolean] - required :flag, ModerationAPI::Internal::Type::Boolean - - # @!attribute threshold - # - # @return [Float, nil] - optional :threshold, Float - - # @!method initialize(flag:, threshold: nil, id: :hate) - # @param flag [Boolean] - # @param threshold [Float] - # @param id [Symbol, :hate] - end - - class Illicit < ModerationAPI::Internal::Type::BaseModel - # @!attribute id - # - # @return [Symbol, :illicit] - required :id, const: :illicit - - # @!attribute flag - # - # @return [Boolean] - required :flag, ModerationAPI::Internal::Type::Boolean - - # @!attribute threshold - # - # @return [Float, nil] - optional :threshold, Float - - # @!method initialize(flag:, threshold: nil, id: :illicit) - # @param flag [Boolean] - # @param threshold [Float] - # @param id [Symbol, :illicit] - end - - class IllicitDrugs < ModerationAPI::Internal::Type::BaseModel - # @!attribute id - # - # @return [Symbol, :illicit_drugs] - required :id, const: :illicit_drugs - - # @!attribute flag - # - # @return [Boolean] - required :flag, ModerationAPI::Internal::Type::Boolean - - # @!attribute threshold - # - # @return [Float, nil] - optional :threshold, Float - - # @!method initialize(flag:, threshold: nil, id: :illicit_drugs) - # @param flag [Boolean] - # @param threshold [Float] - # @param id [Symbol, :illicit_drugs] - end - - class IllicitAlcohol < ModerationAPI::Internal::Type::BaseModel - # @!attribute id - # - # @return [Symbol, :illicit_alcohol] - required :id, const: :illicit_alcohol - - # @!attribute flag - # - # @return [Boolean] - required :flag, ModerationAPI::Internal::Type::Boolean - - # @!attribute threshold - # - # @return [Float, nil] - optional :threshold, Float - - # @!method initialize(flag:, threshold: nil, id: :illicit_alcohol) - # @param flag [Boolean] - # @param threshold [Float] - # @param id [Symbol, :illicit_alcohol] - end - - class IllicitFirearms < ModerationAPI::Internal::Type::BaseModel - # @!attribute id - # - # @return [Symbol, :illicit_firearms] - required :id, const: :illicit_firearms - - # @!attribute flag - # - # @return [Boolean] - required :flag, ModerationAPI::Internal::Type::Boolean - - # @!attribute threshold - # - # @return [Float, nil] - optional :threshold, Float - - # @!method initialize(flag:, threshold: nil, id: :illicit_firearms) - # @param flag [Boolean] - # @param threshold [Float] - # @param id [Symbol, :illicit_firearms] - end - - class IllicitTobacco < ModerationAPI::Internal::Type::BaseModel - # @!attribute id - # - # @return [Symbol, :illicit_tobacco] - required :id, const: :illicit_tobacco - - # @!attribute flag - # - # @return [Boolean] - required :flag, ModerationAPI::Internal::Type::Boolean - - # @!attribute threshold - # - # @return [Float, nil] - optional :threshold, Float - - # @!method initialize(flag:, threshold: nil, id: :illicit_tobacco) - # @param flag [Boolean] - # @param threshold [Float] - # @param id [Symbol, :illicit_tobacco] - end - - class IllicitGambling < ModerationAPI::Internal::Type::BaseModel - # @!attribute id - # - # @return [Symbol, :illicit_gambling] - required :id, const: :illicit_gambling - - # @!attribute flag - # - # @return [Boolean] - required :flag, ModerationAPI::Internal::Type::Boolean - - # @!attribute threshold - # - # @return [Float, nil] - optional :threshold, Float - - # @!method initialize(flag:, threshold: nil, id: :illicit_gambling) - # @param flag [Boolean] - # @param threshold [Float] - # @param id [Symbol, :illicit_gambling] - end - - class Cannabis < ModerationAPI::Internal::Type::BaseModel - # @!attribute id - # - # @return [Symbol, :cannabis] - required :id, const: :cannabis - - # @!attribute flag - # - # @return [Boolean] - required :flag, ModerationAPI::Internal::Type::Boolean - - # @!attribute threshold - # - # @return [Float, nil] - optional :threshold, Float - - # @!method initialize(flag:, threshold: nil, id: :cannabis) - # @param flag [Boolean] - # @param threshold [Float] - # @param id [Symbol, :cannabis] - end - - class Adult < ModerationAPI::Internal::Type::BaseModel - # @!attribute id - # - # @return [Symbol, :adult] - required :id, const: :adult - - # @!attribute flag - # - # @return [Boolean] - required :flag, ModerationAPI::Internal::Type::Boolean - - # @!attribute threshold - # - # @return [Float, nil] - optional :threshold, Float - - # @!method initialize(flag:, threshold: nil, id: :adult) - # @param flag [Boolean] - # @param threshold [Float] - # @param id [Symbol, :adult] - end - - class Crypto < ModerationAPI::Internal::Type::BaseModel - # @!attribute id - # - # @return [Symbol, :crypto] - required :id, const: :crypto - - # @!attribute flag - # - # @return [Boolean] - required :flag, ModerationAPI::Internal::Type::Boolean - - # @!attribute threshold - # - # @return [Float, nil] - optional :threshold, Float - - # @!method initialize(flag:, threshold: nil, id: :crypto) - # @param flag [Boolean] - # @param threshold [Float] - # @param id [Symbol, :crypto] - end - - class Sexual < ModerationAPI::Internal::Type::BaseModel - # @!attribute id - # - # @return [Symbol, :sexual] - required :id, const: :sexual - - # @!attribute flag - # - # @return [Boolean] - required :flag, ModerationAPI::Internal::Type::Boolean - - # @!attribute threshold - # - # @return [Float, nil] - optional :threshold, Float - - # @!method initialize(flag:, threshold: nil, id: :sexual) - # @param flag [Boolean] - # @param threshold [Float] - # @param id [Symbol, :sexual] - end - - class SexualMinors < ModerationAPI::Internal::Type::BaseModel - # @!attribute id - # - # @return [Symbol, :sexual_minors] - required :id, const: :sexual_minors - - # @!attribute flag - # - # @return [Boolean] - required :flag, ModerationAPI::Internal::Type::Boolean - - # @!attribute threshold - # - # @return [Float, nil] - optional :threshold, Float - - # @!method initialize(flag:, threshold: nil, id: :sexual_minors) - # @param flag [Boolean] - # @param threshold [Float] - # @param id [Symbol, :sexual_minors] - end - - class Flirtation < ModerationAPI::Internal::Type::BaseModel - # @!attribute id - # - # @return [Symbol, :flirtation] - required :id, const: :flirtation - - # @!attribute flag - # - # @return [Boolean] - required :flag, ModerationAPI::Internal::Type::Boolean - - # @!attribute threshold - # - # @return [Float, nil] - optional :threshold, Float - - # @!method initialize(flag:, threshold: nil, id: :flirtation) - # @param flag [Boolean] - # @param threshold [Float] - # @param id [Symbol, :flirtation] - end - - class Profanity < ModerationAPI::Internal::Type::BaseModel - # @!attribute id - # - # @return [Symbol, :profanity] - required :id, const: :profanity - - # @!attribute flag - # - # @return [Boolean] - required :flag, ModerationAPI::Internal::Type::Boolean - - # @!attribute threshold - # - # @return [Float, nil] - optional :threshold, Float - - # @!method initialize(flag:, threshold: nil, id: :profanity) - # @param flag [Boolean] - # @param threshold [Float] - # @param id [Symbol, :profanity] - end - - class Violence < ModerationAPI::Internal::Type::BaseModel - # @!attribute id - # - # @return [Symbol, :violence] - required :id, const: :violence - - # @!attribute flag - # - # @return [Boolean] - required :flag, ModerationAPI::Internal::Type::Boolean - - # @!attribute threshold - # - # @return [Float, nil] - optional :threshold, Float - - # @!method initialize(flag:, threshold: nil, id: :violence) - # @param flag [Boolean] - # @param threshold [Float] - # @param id [Symbol, :violence] - end - - class SelfHarm < ModerationAPI::Internal::Type::BaseModel - # @!attribute id - # - # @return [Symbol, :self_harm] - required :id, const: :self_harm - - # @!attribute flag - # - # @return [Boolean] - required :flag, ModerationAPI::Internal::Type::Boolean - - # @!attribute threshold - # - # @return [Float, nil] - optional :threshold, Float - - # @!method initialize(flag:, threshold: nil, id: :self_harm) - # @param flag [Boolean] - # @param threshold [Float] - # @param id [Symbol, :self_harm] - end - - class Spam < ModerationAPI::Internal::Type::BaseModel - # @!attribute id - # - # @return [Symbol, :spam] - required :id, const: :spam - - # @!attribute flag - # - # @return [Boolean] - required :flag, ModerationAPI::Internal::Type::Boolean - - # @!attribute threshold - # - # @return [Float, nil] - optional :threshold, Float - - # @!method initialize(flag:, threshold: nil, id: :spam) - # @param flag [Boolean] - # @param threshold [Float] - # @param id [Symbol, :spam] - end - - class LowQualityContent < ModerationAPI::Internal::Type::BaseModel - # @!attribute id - # - # @return [Symbol, :low_quality] - required :id, const: :low_quality - - # @!attribute flag - # - # @return [Boolean] - required :flag, ModerationAPI::Internal::Type::Boolean - - # @!attribute min_words - # Flag content with fewer than this many words as low-effort. Defaults to 3. Set - # to disable by omitting. - # - # @return [Integer, nil] - optional :min_words, Integer, api_name: :minWords - - # @!attribute threshold - # - # @return [Float, nil] - optional :threshold, Float - - # @!method initialize(flag:, min_words: nil, threshold: nil, id: :low_quality) - # Some parameter documentations has been truncated, see - # {ModerationAPI::Models::ContentSubmitParams::Policy::LowQualityContent} for more - # details. - # - # @param flag [Boolean] - # - # @param min_words [Integer] Flag content with fewer than this many words as low-effort. Defaults to 3. Set t - # - # @param threshold [Float] - # - # @param id [Symbol, :low_quality] - end - - class FaceDetection < ModerationAPI::Internal::Type::BaseModel - # @!attribute id - # - # @return [Symbol, :face_detection] - required :id, const: :face_detection - - # @!attribute flag - # - # @return [Boolean] - required :flag, ModerationAPI::Internal::Type::Boolean - - # @!attribute comparator - # Flag images that contain "at least" or "fewer than" the configured number of - # faces. Defaults to at_least. - # - # @return [Symbol, ModerationAPI::Models::ContentSubmitParams::Policy::FaceDetection::Comparator, nil] - optional :comparator, enum: -> { ModerationAPI::ContentSubmitParams::Policy::FaceDetection::Comparator } - - # @!attribute count - # Number of faces the comparator applies to. Defaults to 1, so the default rule - # flags any image containing a face. - # - # @return [Integer, nil] - optional :count, Integer - - # @!attribute threshold - # - # @return [Float, nil] - optional :threshold, Float - - # @!method initialize(flag:, comparator: nil, count: nil, threshold: nil, id: :face_detection) - # Some parameter documentations has been truncated, see - # {ModerationAPI::Models::ContentSubmitParams::Policy::FaceDetection} for more - # details. - # - # @param flag [Boolean] - # - # @param comparator [Symbol, ModerationAPI::Models::ContentSubmitParams::Policy::FaceDetection::Comparator] Flag images that contain "at least" or "fewer than" the configured number of fac - # - # @param count [Integer] Number of faces the comparator applies to. Defaults to 1, so the default rule fl - # - # @param threshold [Float] - # - # @param id [Symbol, :face_detection] - - # Flag images that contain "at least" or "fewer than" the configured number of - # faces. Defaults to at_least. - # - # @see ModerationAPI::Models::ContentSubmitParams::Policy::FaceDetection#comparator - module Comparator - extend ModerationAPI::Internal::Type::Enum - - AT_LEAST = :at_least - FEWER_THAN = :fewer_than - - # @!method self.values - # @return [Array] - end - end - - class SelfPromotion < ModerationAPI::Internal::Type::BaseModel - # @!attribute id - # - # @return [Symbol, :self_promotion] - required :id, const: :self_promotion - - # @!attribute flag - # - # @return [Boolean] - required :flag, ModerationAPI::Internal::Type::Boolean - - # @!attribute threshold - # - # @return [Float, nil] - optional :threshold, Float - - # @!method initialize(flag:, threshold: nil, id: :self_promotion) - # @param flag [Boolean] - # @param threshold [Float] - # @param id [Symbol, :self_promotion] - end - - class Political < ModerationAPI::Internal::Type::BaseModel - # @!attribute id - # - # @return [Symbol, :political] - required :id, const: :political - - # @!attribute flag - # - # @return [Boolean] - required :flag, ModerationAPI::Internal::Type::Boolean - - # @!attribute threshold - # - # @return [Float, nil] - optional :threshold, Float - - # @!method initialize(flag:, threshold: nil, id: :political) - # @param flag [Boolean] - # @param threshold [Float] - # @param id [Symbol, :political] - end - - class Religion < ModerationAPI::Internal::Type::BaseModel - # @!attribute id - # - # @return [Symbol, :religion] - required :id, const: :religion - - # @!attribute flag - # - # @return [Boolean] - required :flag, ModerationAPI::Internal::Type::Boolean - - # @!attribute threshold - # - # @return [Float, nil] - optional :threshold, Float - - # @!method initialize(flag:, threshold: nil, id: :religion) - # @param flag [Boolean] - # @param threshold [Float] - # @param id [Symbol, :religion] - end - - class CodeAbuse < ModerationAPI::Internal::Type::BaseModel - # @!attribute id - # - # @return [Symbol, :code_abuse] - required :id, const: :code_abuse - - # @!attribute flag - # - # @return [Boolean] - required :flag, ModerationAPI::Internal::Type::Boolean - - # @!attribute threshold - # - # @return [Float, nil] - optional :threshold, Float - - # @!method initialize(flag:, threshold: nil, id: :code_abuse) - # @param flag [Boolean] - # @param threshold [Float] - # @param id [Symbol, :code_abuse] - end - - class UnicodeSpoofing < ModerationAPI::Internal::Type::BaseModel - # @!attribute id - # - # @return [Symbol, :unicode_spoofing] - required :id, const: :unicode_spoofing - - # @!attribute flag - # - # @return [Boolean] - required :flag, ModerationAPI::Internal::Type::Boolean - - # @!attribute signals - # Per-signal flag toggles. Omitted spoofing signals are enabled; encoding_damage - # defaults to off because decode damage (U+FFFD) marks a broken pipeline, not an - # attack. A disabled signal is still detected and reported as a label, but does - # not by itself flag the policy. - # - # @return [Hash{Symbol=>ModerationAPI::Models::ContentSubmitParams::Policy::UnicodeSpoofing::Signal}, nil] - optional :signals, - -> { ModerationAPI::Internal::Type::HashOf[ModerationAPI::ContentSubmitParams::Policy::UnicodeSpoofing::Signal] } - - # @!attribute threshold - # - # @return [Float, nil] - optional :threshold, Float - - # @!method initialize(flag:, signals: nil, threshold: nil, id: :unicode_spoofing) - # Some parameter documentations has been truncated, see - # {ModerationAPI::Models::ContentSubmitParams::Policy::UnicodeSpoofing} for more - # details. - # - # @param flag [Boolean] - # - # @param signals [Hash{Symbol=>ModerationAPI::Models::ContentSubmitParams::Policy::UnicodeSpoofing::Signal}] Per-signal flag toggles. Omitted spoofing signals are enabled; encoding_damage d - # - # @param threshold [Float] - # - # @param id [Symbol, :unicode_spoofing] - - class Signal < ModerationAPI::Internal::Type::BaseModel - # @!attribute flag - # - # @return [Boolean, nil] - optional :flag, ModerationAPI::Internal::Type::Boolean - - # @!method initialize(flag: nil) - # @param flag [Boolean] - end - end - - class PiiMasking < ModerationAPI::Internal::Type::BaseModel - # @!attribute id - # - # @return [Symbol, :pii] - required :id, const: :pii - - # @!attribute entities - # - # @return [Hash{Symbol=>ModerationAPI::Models::ContentSubmitParams::Policy::PiiMasking::Entity}] - required :entities, - -> { ModerationAPI::Internal::Type::HashOf[ModerationAPI::ContentSubmitParams::Policy::PiiMasking::Entity] } - - # @!method initialize(entities:, id: :pii) - # @param entities [Hash{Symbol=>ModerationAPI::Models::ContentSubmitParams::Policy::PiiMasking::Entity}] - # @param id [Symbol, :pii] - - class Entity < ModerationAPI::Internal::Type::BaseModel - # @!attribute enable - # - # @return [Boolean, nil] - optional :enable, ModerationAPI::Internal::Type::Boolean - - # @!attribute flag - # - # @return [Boolean, nil] - optional :flag, ModerationAPI::Internal::Type::Boolean - - # @!attribute mask - # - # @return [String, nil] - optional :mask, String - - # @!attribute should_mask - # - # @return [Boolean, nil] - optional :should_mask, ModerationAPI::Internal::Type::Boolean, api_name: :shouldMask - - # @!method initialize(enable: nil, flag: nil, mask: nil, should_mask: nil) - # @param enable [Boolean] - # @param flag [Boolean] - # @param mask [String] - # @param should_mask [Boolean] - end - end - - class URLMasking < ModerationAPI::Internal::Type::BaseModel - # @!attribute id - # - # @return [Symbol, :url] - required :id, const: :url - - # @!attribute entities - # - # @return [Hash{Symbol=>ModerationAPI::Models::ContentSubmitParams::Policy::URLMasking::Entity}] - required :entities, - -> { ModerationAPI::Internal::Type::HashOf[ModerationAPI::ContentSubmitParams::Policy::URLMasking::Entity] } - - # @!method initialize(entities:, id: :url) - # @param entities [Hash{Symbol=>ModerationAPI::Models::ContentSubmitParams::Policy::URLMasking::Entity}] - # @param id [Symbol, :url] - - class Entity < ModerationAPI::Internal::Type::BaseModel - # @!attribute enable - # - # @return [Boolean, nil] - optional :enable, ModerationAPI::Internal::Type::Boolean - - # @!attribute flag - # - # @return [Boolean, nil] - optional :flag, ModerationAPI::Internal::Type::Boolean - - # @!attribute mask - # - # @return [String, nil] - optional :mask, String - - # @!attribute should_mask - # - # @return [Boolean, nil] - optional :should_mask, ModerationAPI::Internal::Type::Boolean, api_name: :shouldMask - - # @!method initialize(enable: nil, flag: nil, mask: nil, should_mask: nil) - # @param enable [Boolean] - # @param flag [Boolean] - # @param mask [String] - # @param should_mask [Boolean] - end - end - - class URLRisk < ModerationAPI::Internal::Type::BaseModel - # @!attribute id - # - # @return [Symbol, :url_risk] - required :id, const: :url_risk - - # @!attribute flag - # - # @return [Boolean] - required :flag, ModerationAPI::Internal::Type::Boolean - - # @!attribute allowlist_wordlist_ids - # IDs of wordlists whose entries are treated as allowed URL domains. Matches - # short-circuit the risk model and are never flagged. - # - # @return [Array, nil] - optional :allowlist_wordlist_ids, - ModerationAPI::Internal::Type::ArrayOf[String], - api_name: :allowlistWordlistIds - - # @!attribute blocklist_wordlist_ids - # IDs of wordlists whose entries are treated as blocked URL domains. Matches - # short-circuit the risk model and are always flagged. Blocklists take precedence - # over allowlists. - # - # @return [Array, nil] - optional :blocklist_wordlist_ids, - ModerationAPI::Internal::Type::ArrayOf[String], - api_name: :blocklistWordlistIds - - # @!attribute flag_link_shorteners - # When true, any URL detected as a free link shortener (bit.ly, t.co, tinyurl, - # etc.) is always flagged regardless of risk score. Allowlist matches still win. - # - # @return [Boolean, nil] - optional :flag_link_shorteners, - ModerationAPI::Internal::Type::Boolean, - api_name: :flagLinkShorteners - - # @!attribute threshold - # - # @return [Float, nil] - optional :threshold, Float - - # @!method initialize(flag:, allowlist_wordlist_ids: nil, blocklist_wordlist_ids: nil, flag_link_shorteners: nil, threshold: nil, id: :url_risk) - # Some parameter documentations has been truncated, see - # {ModerationAPI::Models::ContentSubmitParams::Policy::URLRisk} for more details. - # - # @param flag [Boolean] - # - # @param allowlist_wordlist_ids [Array] IDs of wordlists whose entries are treated as allowed URL domains. Matches short - # - # @param blocklist_wordlist_ids [Array] IDs of wordlists whose entries are treated as blocked URL domains. Matches short - # - # @param flag_link_shorteners [Boolean] When true, any URL detected as a free link shortener (bit.ly, t.co, tinyurl, etc - # - # @param threshold [Float] - # - # @param id [Symbol, :url_risk] - end - - class Guideline < ModerationAPI::Internal::Type::BaseModel - # @!attribute id - # - # @return [Symbol, :guideline] - required :id, const: :guideline - - # @!attribute flag - # - # @return [Boolean] - required :flag, ModerationAPI::Internal::Type::Boolean - - # @!attribute guideline_key - # - # @return [String] - required :guideline_key, String, api_name: :guidelineKey - - # @!attribute instructions - # - # @return [String] - required :instructions, String - - # @!attribute threshold - # - # @return [Float, nil] - optional :threshold, Float - - # @!method initialize(flag:, guideline_key:, instructions:, threshold: nil, id: :guideline) - # @param flag [Boolean] - # @param guideline_key [String] - # @param instructions [String] - # @param threshold [Float] - # @param id [Symbol, :guideline] - end - - # @!method self.variants - # @return [Array(ModerationAPI::Models::ContentSubmitParams::Policy::Toxicity, ModerationAPI::Models::ContentSubmitParams::Policy::PersonalInformation, ModerationAPI::Models::ContentSubmitParams::Policy::ToxicitySevere, ModerationAPI::Models::ContentSubmitParams::Policy::Hate, ModerationAPI::Models::ContentSubmitParams::Policy::Illicit, ModerationAPI::Models::ContentSubmitParams::Policy::IllicitDrugs, ModerationAPI::Models::ContentSubmitParams::Policy::IllicitAlcohol, ModerationAPI::Models::ContentSubmitParams::Policy::IllicitFirearms, ModerationAPI::Models::ContentSubmitParams::Policy::IllicitTobacco, ModerationAPI::Models::ContentSubmitParams::Policy::IllicitGambling, ModerationAPI::Models::ContentSubmitParams::Policy::Cannabis, ModerationAPI::Models::ContentSubmitParams::Policy::Adult, ModerationAPI::Models::ContentSubmitParams::Policy::Crypto, ModerationAPI::Models::ContentSubmitParams::Policy::Sexual, ModerationAPI::Models::ContentSubmitParams::Policy::SexualMinors, ModerationAPI::Models::ContentSubmitParams::Policy::Flirtation, ModerationAPI::Models::ContentSubmitParams::Policy::Profanity, ModerationAPI::Models::ContentSubmitParams::Policy::Violence, ModerationAPI::Models::ContentSubmitParams::Policy::SelfHarm, ModerationAPI::Models::ContentSubmitParams::Policy::Spam, ModerationAPI::Models::ContentSubmitParams::Policy::LowQualityContent, ModerationAPI::Models::ContentSubmitParams::Policy::FaceDetection, ModerationAPI::Models::ContentSubmitParams::Policy::SelfPromotion, ModerationAPI::Models::ContentSubmitParams::Policy::Political, ModerationAPI::Models::ContentSubmitParams::Policy::Religion, ModerationAPI::Models::ContentSubmitParams::Policy::CodeAbuse, ModerationAPI::Models::ContentSubmitParams::Policy::UnicodeSpoofing, ModerationAPI::Models::ContentSubmitParams::Policy::PiiMasking, ModerationAPI::Models::ContentSubmitParams::Policy::URLMasking, ModerationAPI::Models::ContentSubmitParams::Policy::URLRisk, ModerationAPI::Models::ContentSubmitParams::Policy::Guideline)] - end - end - end -end diff --git a/lib/moderation_api/models/content_submit_response.rb b/lib/moderation_api/models/content_submit_response.rb deleted file mode 100644 index 2b80dd4f..00000000 --- a/lib/moderation_api/models/content_submit_response.rb +++ /dev/null @@ -1,1115 +0,0 @@ -# frozen_string_literal: true - -module ModerationAPI - module Models - # @see ModerationAPI::Resources::Content#submit - class ContentSubmitResponse < ModerationAPI::Internal::Type::BaseModel - # @!attribute author - # The author of the content if your account has authors enabled. Requires you to - # send authorId when submitting content. - # - # @return [ModerationAPI::Models::ContentSubmitResponse::Author, nil] - required :author, -> { ModerationAPI::Models::ContentSubmitResponse::Author }, nil?: true - - # @!attribute casebook - # What your casebook — the record of your past moderation decisions — found for - # this content, or null when it had nothing close enough to say, when the matching - # cases disagreed, or when casebook lookups are not switched on for this channel. - # Reports what the casebook found; whether it decided the outcome is shown in - # `recommendation`, where a higher-priority rule may have settled the item first. - # - # @return [ModerationAPI::Models::ContentSubmitResponse::Casebook, nil] - required :casebook, -> { ModerationAPI::Models::ContentSubmitResponse::Casebook }, nil?: true - - # @!attribute content - # Potentially modified content. - # - # @return [ModerationAPI::Models::ContentSubmitResponse::Content] - required :content, -> { ModerationAPI::Models::ContentSubmitResponse::Content } - - # @!attribute evaluation - # The evaluation of the content after running the channel policies. - # - # @return [ModerationAPI::Models::ContentSubmitResponse::Evaluation] - required :evaluation, -> { ModerationAPI::Models::ContentSubmitResponse::Evaluation } - - # @!attribute insights - # Results of all insights enabled in the channel. - # - # @return [Array] - required :insights, - -> { ModerationAPI::Internal::Type::ArrayOf[union: ModerationAPI::Models::ContentSubmitResponse::Insight] } - - # @!attribute meta - # Metadata about the moderation request - # - # @return [ModerationAPI::Models::ContentSubmitResponse::Meta] - required :meta, -> { ModerationAPI::Models::ContentSubmitResponse::Meta } - - # @!attribute policies - # Results of all policies in the channel. Sorted by highest probability. - # - # @return [Array] - required :policies, - -> { ModerationAPI::Internal::Type::ArrayOf[union: ModerationAPI::Models::ContentSubmitResponse::Policy] } - - # @!attribute recommendation - # The recommendation for the content based on the evaluation. - # - # @return [ModerationAPI::Models::ContentSubmitResponse::Recommendation] - required :recommendation, -> { ModerationAPI::Models::ContentSubmitResponse::Recommendation } - - # @!attribute errors - # Policies that had errors - # - # @return [Array, nil] - optional :errors, - -> { ModerationAPI::Internal::Type::ArrayOf[ModerationAPI::Models::ContentSubmitResponse::Error] } - - # @!method initialize(author:, casebook:, content:, evaluation:, insights:, meta:, policies:, recommendation:, errors: nil) - # Some parameter documentations has been truncated, see - # {ModerationAPI::Models::ContentSubmitResponse} for more details. - # - # @param author [ModerationAPI::Models::ContentSubmitResponse::Author, nil] The author of the content if your account has authors enabled. Requires you to s - # - # @param casebook [ModerationAPI::Models::ContentSubmitResponse::Casebook, nil] What your casebook — the record of your past moderation decisions — found for th - # - # @param content [ModerationAPI::Models::ContentSubmitResponse::Content] Potentially modified content. - # - # @param evaluation [ModerationAPI::Models::ContentSubmitResponse::Evaluation] The evaluation of the content after running the channel policies. - # - # @param insights [Array] Results of all insights enabled in the channel. - # - # @param meta [ModerationAPI::Models::ContentSubmitResponse::Meta] Metadata about the moderation request - # - # @param policies [Array] Results of all policies in the channel. Sorted by highest probability. - # - # @param recommendation [ModerationAPI::Models::ContentSubmitResponse::Recommendation] The recommendation for the content based on the evaluation. - # - # @param errors [Array] Policies that had errors - - # @see ModerationAPI::Models::ContentSubmitResponse#author - class Author < ModerationAPI::Internal::Type::BaseModel - # @!attribute id - # Author ID in Moderation API - # - # @return [String] - required :id, String - - # @!attribute block - # Block or suspension details, if applicable. Null if the author is enabled. - # - # @return [ModerationAPI::Models::ContentSubmitResponse::Author::Block, nil] - required :block, -> { ModerationAPI::Models::ContentSubmitResponse::Author::Block }, nil?: true - - # @!attribute status - # Current author status - # - # @return [Symbol, ModerationAPI::Models::ContentSubmitResponse::Author::Status] - required :status, enum: -> { ModerationAPI::Models::ContentSubmitResponse::Author::Status } - - # @!attribute trust_level - # - # @return [ModerationAPI::Models::ContentSubmitResponse::Author::TrustLevel] - required :trust_level, -> { ModerationAPI::Models::ContentSubmitResponse::Author::TrustLevel } - - # @!attribute external_id - # The author's ID from your system - # - # @return [String, nil] - optional :external_id, String, nil?: true - - # @!method initialize(id:, block:, status:, trust_level:, external_id: nil) - # The author of the content if your account has authors enabled. Requires you to - # send authorId when submitting content. - # - # @param id [String] Author ID in Moderation API - # - # @param block [ModerationAPI::Models::ContentSubmitResponse::Author::Block, nil] Block or suspension details, if applicable. Null if the author is enabled. - # - # @param status [Symbol, ModerationAPI::Models::ContentSubmitResponse::Author::Status] Current author status - # - # @param trust_level [ModerationAPI::Models::ContentSubmitResponse::Author::TrustLevel] - # - # @param external_id [String, nil] The author's ID from your system - - # @see ModerationAPI::Models::ContentSubmitResponse::Author#block - class Block < ModerationAPI::Internal::Type::BaseModel - # @!attribute reason - # The moderators reason why the author was blocked or suspended. - # - # @return [String, nil] - optional :reason, String, nil?: true - - # @!attribute until_ - # The timestamp until which they are blocked if the author is suspended. - # - # @return [Float, nil] - optional :until_, Float, api_name: :until, nil?: true - - # @!method initialize(reason: nil, until_: nil) - # Block or suspension details, if applicable. Null if the author is enabled. - # - # @param reason [String, nil] The moderators reason why the author was blocked or suspended. - # - # @param until_ [Float, nil] The timestamp until which they are blocked if the author is suspended. - end - - # Current author status - # - # @see ModerationAPI::Models::ContentSubmitResponse::Author#status - module Status - extend ModerationAPI::Internal::Type::Enum - - ENABLED = :enabled - SUSPENDED = :suspended - BLOCKED = :blocked - - # @!method self.values - # @return [Array] - end - - # @see ModerationAPI::Models::ContentSubmitResponse::Author#trust_level - class TrustLevel < ModerationAPI::Internal::Type::BaseModel - # @!attribute level - # Author trust level (-1, 0, 1, 2, 3, or 4) - # - # @return [Float] - required :level, Float - - # @!attribute manual - # True if the trust level was set manually by a moderator - # - # @return [Boolean] - required :manual, ModerationAPI::Internal::Type::Boolean - - # @!method initialize(level:, manual:) - # @param level [Float] Author trust level (-1, 0, 1, 2, 3, or 4) - # - # @param manual [Boolean] True if the trust level was set manually by a moderator - end - end - - # @see ModerationAPI::Models::ContentSubmitResponse#casebook - class Casebook < ModerationAPI::Internal::Type::BaseModel - # @!attribute agreement - # How unanimous the matching cases are, from 0 to 1: the share of them that - # decided this way, ignoring how many there are. Always at least 0.8 when a ruling - # is returned — below that the casebook reports a disagreement instead of picking - # a side — so it tells you how clean the consensus was, and is not a threshold to - # re-apply yourself. - # - # @return [Float] - required :agreement, Float - - # @!attribute case_count - # How many of your past cases backed this ruling. - # - # @return [Float] - required :case_count, Float - - # @!attribute confidence - # How strongly the casebook holds this ruling, from 0 to 1: the agreement scaled - # by how much evidence backs it, so a handful of close, recent cases outweighs one - # distant one. Older cases count for less, halving in weight roughly every 180 - # days. This is the number to use in rules when you want a strength condition. - # - # @return [Float] - required :confidence, Float - - # @!attribute similarity - # How close the nearest matching case is, from 0 to 1. 1 means the content is - # identical to something you have already decided. - # - # @return [Float] - required :similarity, Float - - # @!attribute topic - # The topic the closest matching case is filed under, or null when it has not been - # grouped into one yet. - # - # @return [ModerationAPI::Models::ContentSubmitResponse::Casebook::Topic, nil] - required :topic, -> { ModerationAPI::Models::ContentSubmitResponse::Casebook::Topic }, nil?: true - - # @!attribute verdict - # The ruling your past decisions point to for this content. - # - # @return [Symbol, ModerationAPI::Models::ContentSubmitResponse::Casebook::Verdict] - required :verdict, enum: -> { ModerationAPI::Models::ContentSubmitResponse::Casebook::Verdict } - - # @!method initialize(agreement:, case_count:, confidence:, similarity:, topic:, verdict:) - # Some parameter documentations has been truncated, see - # {ModerationAPI::Models::ContentSubmitResponse::Casebook} for more details. - # - # What your casebook — the record of your past moderation decisions — found for - # this content, or null when it had nothing close enough to say, when the matching - # cases disagreed, or when casebook lookups are not switched on for this channel. - # Reports what the casebook found; whether it decided the outcome is shown in - # `recommendation`, where a higher-priority rule may have settled the item first. - # - # @param agreement [Float] How unanimous the matching cases are, from 0 to 1: the share of them that decide - # - # @param case_count [Float] How many of your past cases backed this ruling. - # - # @param confidence [Float] How strongly the casebook holds this ruling, from 0 to 1: the agreement scaled b - # - # @param similarity [Float] How close the nearest matching case is, from 0 to 1. 1 means the content is iden - # - # @param topic [ModerationAPI::Models::ContentSubmitResponse::Casebook::Topic, nil] The topic the closest matching case is filed under, or null when it has not been - # - # @param verdict [Symbol, ModerationAPI::Models::ContentSubmitResponse::Casebook::Verdict] The ruling your past decisions point to for this content. - - # @see ModerationAPI::Models::ContentSubmitResponse::Casebook#topic - class Topic < ModerationAPI::Internal::Type::BaseModel - # @!attribute id - # - # @return [String] - required :id, String - - # @!attribute label - # - # @return [String] - required :label, String - - # @!method initialize(id:, label:) - # The topic the closest matching case is filed under, or null when it has not been - # grouped into one yet. - # - # @param id [String] - # @param label [String] - end - - # The ruling your past decisions point to for this content. - # - # @see ModerationAPI::Models::ContentSubmitResponse::Casebook#verdict - module Verdict - extend ModerationAPI::Internal::Type::Enum - - ALLOW = :allow - REJECT = :reject - - # @!method self.values - # @return [Array] - end - end - - # @see ModerationAPI::Models::ContentSubmitResponse#content - class Content < ModerationAPI::Internal::Type::BaseModel - # @!attribute id - # The unique identifier for the content. Either the contentId provided by you or - # an autogenerated ID. - # - # @return [String] - required :id, String - - # @!attribute masked - # Whether any values have been masked. - # - # @return [Boolean] - required :masked, ModerationAPI::Internal::Type::Boolean - - # @!attribute modified - # The modified content, if any. - # - # @return [String, Hash{Symbol=>Object}, Hash{Symbol=>ModerationAPI::Models::ContentSubmitResponse::Content::Modified::ModifiedNestedObjectContent::Text, ModerationAPI::Models::ContentSubmitResponse::Content::Modified::ModifiedNestedObjectContent::Image, ModerationAPI::Models::ContentSubmitResponse::Content::Modified::ModifiedNestedObjectContent::Video, ModerationAPI::Models::ContentSubmitResponse::Content::Modified::ModifiedNestedObjectContent::Audio}, nil] - required :modified, - union: -> { ModerationAPI::Models::ContentSubmitResponse::Content::Modified }, - nil?: true - - # @!attribute unicode_cleaned - # Whether Unicode spoofing normalization rewrote the content — confusables folded - # to their Latin lookalikes, invisible characters and combining-mark abuse - # stripped. - # - # @return [Boolean] - required :unicode_cleaned, ModerationAPI::Internal::Type::Boolean - - # @!attribute transcript - # The transcribed text from audio content. Only present when audio moderation is - # used and transcript inclusion is enabled on the channel. - # - # @return [String, nil] - optional :transcript, String, nil?: true - - # @!method initialize(id:, masked:, modified:, unicode_cleaned:, transcript: nil) - # Some parameter documentations has been truncated, see - # {ModerationAPI::Models::ContentSubmitResponse::Content} for more details. - # - # Potentially modified content. - # - # @param id [String] The unique identifier for the content. Either the contentId provided by you or a - # - # @param masked [Boolean] Whether any values have been masked. - # - # @param modified [String, Hash{Symbol=>Object}, Hash{Symbol=>ModerationAPI::Models::ContentSubmitResponse::Content::Modified::ModifiedNestedObjectContent::Text, ModerationAPI::Models::ContentSubmitResponse::Content::Modified::ModifiedNestedObjectContent::Image, ModerationAPI::Models::ContentSubmitResponse::Content::Modified::ModifiedNestedObjectContent::Video, ModerationAPI::Models::ContentSubmitResponse::Content::Modified::ModifiedNestedObjectContent::Audio}, nil] The modified content, if any. - # - # @param unicode_cleaned [Boolean] Whether Unicode spoofing normalization rewrote the content — confusables folded - # - # @param transcript [String, nil] The transcribed text from audio content. Only present when audio moderation is u - - # The modified content, if any. - # - # @see ModerationAPI::Models::ContentSubmitResponse::Content#modified - module Modified - extend ModerationAPI::Internal::Type::Union - - variant String - - variant -> { ModerationAPI::Models::ContentSubmitResponse::Content::Modified::ModifiedObjectContentMap } - - variant -> { ModerationAPI::Models::ContentSubmitResponse::Content::Modified::ModifiedNestedObjectContentMap } - - # Text - module ModifiedNestedObjectContent - extend ModerationAPI::Internal::Type::Union - - # Text - variant -> { ModerationAPI::Models::ContentSubmitResponse::Content::Modified::ModifiedNestedObjectContent::Text } - - # Image - variant -> { ModerationAPI::Models::ContentSubmitResponse::Content::Modified::ModifiedNestedObjectContent::Image } - - # Video - variant -> { ModerationAPI::Models::ContentSubmitResponse::Content::Modified::ModifiedNestedObjectContent::Video } - - # Audio - variant -> { ModerationAPI::Models::ContentSubmitResponse::Content::Modified::ModifiedNestedObjectContent::Audio } - - class Text < ModerationAPI::Internal::Type::BaseModel - # @!attribute text - # The content text - # - # @return [String] - required :text, String - - # @!attribute type - # - # @return [Symbol, :text] - required :type, const: :text - - # @!method initialize(text:, type: :text) - # Text - # - # @param text [String] The content text - # - # @param type [Symbol, :text] - end - - class Image < ModerationAPI::Internal::Type::BaseModel - # @!attribute type - # - # @return [Symbol, :image] - required :type, const: :image - - # @!attribute data - # Base64-encoded image data. Either url or data must be provided. Note: base64 - # images are not stored and will not appear in the review queue. - # - # @return [String, nil] - optional :data, String - - # @!attribute url - # A public URL of the image content. Either url or data must be provided. - # - # @return [String, nil] - optional :url, String - - # @!method initialize(data: nil, url: nil, type: :image) - # Some parameter documentations has been truncated, see - # {ModerationAPI::Models::ContentSubmitResponse::Content::Modified::ModifiedNestedObjectContent::Image} - # for more details. - # - # Image - # - # @param data [String] Base64-encoded image data. Either url or data must be provided. Note: base64 ima - # - # @param url [String] A public URL of the image content. Either url or data must be provided. - # - # @param type [Symbol, :image] - end - - class Video < ModerationAPI::Internal::Type::BaseModel - # @!attribute type - # - # @return [Symbol, :video] - required :type, const: :video - - # @!attribute url - # A public URL of the video content - # - # @return [String] - required :url, String - - # @!method initialize(url:, type: :video) - # Video - # - # @param url [String] A public URL of the video content - # - # @param type [Symbol, :video] - end - - class Audio < ModerationAPI::Internal::Type::BaseModel - # @!attribute type - # - # @return [Symbol, :audio] - required :type, const: :audio - - # @!attribute url - # The URL of the audio content - # - # @return [String] - required :url, String - - # @!method initialize(url:, type: :audio) - # Audio - # - # @param url [String] The URL of the audio content - # - # @param type [Symbol, :audio] - end - - # @!method self.variants - # @return [Array(ModerationAPI::Models::ContentSubmitResponse::Content::Modified::ModifiedNestedObjectContent::Text, ModerationAPI::Models::ContentSubmitResponse::Content::Modified::ModifiedNestedObjectContent::Image, ModerationAPI::Models::ContentSubmitResponse::Content::Modified::ModifiedNestedObjectContent::Video, ModerationAPI::Models::ContentSubmitResponse::Content::Modified::ModifiedNestedObjectContent::Audio)] - end - - # @!method self.variants - # @return [Array(String, Hash{Symbol=>Object}, Hash{Symbol=>ModerationAPI::Models::ContentSubmitResponse::Content::Modified::ModifiedNestedObjectContent::Text, ModerationAPI::Models::ContentSubmitResponse::Content::Modified::ModifiedNestedObjectContent::Image, ModerationAPI::Models::ContentSubmitResponse::Content::Modified::ModifiedNestedObjectContent::Video, ModerationAPI::Models::ContentSubmitResponse::Content::Modified::ModifiedNestedObjectContent::Audio})] - - # @type [ModerationAPI::Internal::Type::Converter] - ModifiedObjectContentMap = ModerationAPI::Internal::Type::HashOf[ModerationAPI::Internal::Type::Unknown] - - # @type [ModerationAPI::Internal::Type::Converter] - ModifiedNestedObjectContentMap = - ModerationAPI::Internal::Type::HashOf[union: -> { ModerationAPI::Models::ContentSubmitResponse::Content::Modified::ModifiedNestedObjectContent }] - end - end - - # @see ModerationAPI::Models::ContentSubmitResponse#evaluation - class Evaluation < ModerationAPI::Internal::Type::BaseModel - # @!attribute flag_probability - # The probability that the content should be flagged. - # - # @return [Float] - required :flag_probability, Float - - # @!attribute flagged - # Whether the content was flagged by any policy. - # - # @return [Boolean] - required :flagged, ModerationAPI::Internal::Type::Boolean - - # @!attribute severity_score - # The severity score of the content. A higher score indicates more severe content. - # - # @return [Float] - required :severity_score, Float - - # @!attribute shadow_flagged - # Whether the content would have been flagged by analyze-only policies (flag: - # false). - # - # @return [Boolean, nil] - optional :shadow_flagged, ModerationAPI::Internal::Type::Boolean - - # @!attribute unicode_spoofed - # Whether the content was flagged for Unicode spoofing. - # - # @return [Boolean, nil] - optional :unicode_spoofed, ModerationAPI::Internal::Type::Boolean - - # @!method initialize(flag_probability:, flagged:, severity_score:, shadow_flagged: nil, unicode_spoofed: nil) - # Some parameter documentations has been truncated, see - # {ModerationAPI::Models::ContentSubmitResponse::Evaluation} for more details. - # - # The evaluation of the content after running the channel policies. - # - # @param flag_probability [Float] The probability that the content should be flagged. - # - # @param flagged [Boolean] Whether the content was flagged by any policy. - # - # @param severity_score [Float] The severity score of the content. A higher score indicates more severe content. - # - # @param shadow_flagged [Boolean] Whether the content would have been flagged by analyze-only policies (flag: fals - # - # @param unicode_spoofed [Boolean] Whether the content was flagged for Unicode spoofing. - end - - # Sentiment insight - module Insight - extend ModerationAPI::Internal::Type::Union - - # Sentiment insight - variant -> { ModerationAPI::Models::ContentSubmitResponse::Insight::SentimentInsight } - - # Language insight - variant -> { ModerationAPI::Models::ContentSubmitResponse::Insight::LanguageInsight } - - class SentimentInsight < ModerationAPI::Internal::Type::BaseModel - # @!attribute id - # - # @return [Symbol, :sentiment] - required :id, const: :sentiment - - # @!attribute probability - # - # @return [Float] - required :probability, Float - - # @!attribute type - # - # @return [Symbol, :insight] - required :type, const: :insight - - # @!attribute value - # - # @return [Symbol, ModerationAPI::Models::ContentSubmitResponse::Insight::SentimentInsight::Value, nil] - required :value, - enum: -> { ModerationAPI::Models::ContentSubmitResponse::Insight::SentimentInsight::Value }, - nil?: true - - # @!method initialize(probability:, value:, id: :sentiment, type: :insight) - # Sentiment insight - # - # @param probability [Float] - # @param value [Symbol, ModerationAPI::Models::ContentSubmitResponse::Insight::SentimentInsight::Value, nil] - # @param id [Symbol, :sentiment] - # @param type [Symbol, :insight] - - # @see ModerationAPI::Models::ContentSubmitResponse::Insight::SentimentInsight#value - module Value - extend ModerationAPI::Internal::Type::Enum - - POSITIVE = :positive - NEUTRAL = :neutral - NEGATIVE = :negative - - # @!method self.values - # @return [Array] - end - end - - class LanguageInsight < ModerationAPI::Internal::Type::BaseModel - # @!attribute id - # - # @return [Symbol, :language] - required :id, const: :language - - # @!attribute probability - # - # @return [Float] - required :probability, Float - - # @!attribute type - # - # @return [Symbol, :insight] - required :type, const: :insight - - # @!attribute value - # - # @return [String, nil] - required :value, String, nil?: true - - # @!method initialize(probability:, value:, id: :language, type: :insight) - # Language insight - # - # @param probability [Float] - # @param value [String, nil] - # @param id [Symbol, :language] - # @param type [Symbol, :insight] - end - - # @!method self.variants - # @return [Array(ModerationAPI::Models::ContentSubmitResponse::Insight::SentimentInsight, ModerationAPI::Models::ContentSubmitResponse::Insight::LanguageInsight)] - end - - # @see ModerationAPI::Models::ContentSubmitResponse#meta - class Meta < ModerationAPI::Internal::Type::BaseModel - # @!attribute channel_key - # The unique key of the channel where the content was handled. Either the channel - # provided by you or automatically routed. - # - # @return [String] - required :channel_key, String - - # @!attribute status - # - # @return [Symbol, ModerationAPI::Models::ContentSubmitResponse::Meta::Status] - required :status, enum: -> { ModerationAPI::Models::ContentSubmitResponse::Meta::Status } - - # @!attribute timestamp - # - # @return [Float] - required :timestamp, Float - - # @!attribute usage - # - # @return [Float] - required :usage, Float - - # @!attribute processing_time - # - # @return [String, nil] - optional :processing_time, String - - # @!method initialize(channel_key:, status:, timestamp:, usage:, processing_time: nil) - # Some parameter documentations has been truncated, see - # {ModerationAPI::Models::ContentSubmitResponse::Meta} for more details. - # - # Metadata about the moderation request - # - # @param channel_key [String] The unique key of the channel where the content was handled. Either the channel - # - # @param status [Symbol, ModerationAPI::Models::ContentSubmitResponse::Meta::Status] - # - # @param timestamp [Float] - # - # @param usage [Float] - # - # @param processing_time [String] - - # @see ModerationAPI::Models::ContentSubmitResponse::Meta#status - module Status - extend ModerationAPI::Internal::Type::Enum - - SUCCESS = :success - PARTIAL_SUCCESS = :partial_success - - # @!method self.values - # @return [Array] - end - end - - # Policy output schema. - module Policy - extend ModerationAPI::Internal::Type::Union - - # Classifier policy. - variant -> { ModerationAPI::Models::ContentSubmitResponse::Policy::ClassifierOutput } - - # Entity matcher policy. - variant -> { ModerationAPI::Models::ContentSubmitResponse::Policy::EntityMatcherOutput } - - class ClassifierOutput < ModerationAPI::Internal::Type::BaseModel - # @!attribute id - # The unique identifier for the classifier output. - # - # @return [String] - required :id, String - - # @!attribute flagged - # - # @return [Boolean] - required :flagged, ModerationAPI::Internal::Type::Boolean - - # @!attribute probability - # - # @return [Float] - required :probability, Float - - # @!attribute type - # - # @return [Symbol, :classifier] - required :type, const: :classifier - - # @!attribute data - # Optional structured data produced by the policy. For face detection: { count, - # faces: [{ confidence, gender, age }] }. - # - # @return [Hash{Symbol=>Object}, nil] - optional :data, ModerationAPI::Internal::Type::HashOf[ModerationAPI::Internal::Type::Unknown] - - # @!attribute flagged_fields - # The keys of the flagged fields if submitting an object. - # - # @return [Array, nil] - optional :flagged_fields, ModerationAPI::Internal::Type::ArrayOf[String] - - # @!attribute labels - # - # @return [Array, nil] - optional :labels, - -> { ModerationAPI::Internal::Type::ArrayOf[ModerationAPI::Models::ContentSubmitResponse::Policy::ClassifierOutput::Label] } - - # @!method initialize(id:, flagged:, probability:, data: nil, flagged_fields: nil, labels: nil, type: :classifier) - # Some parameter documentations has been truncated, see - # {ModerationAPI::Models::ContentSubmitResponse::Policy::ClassifierOutput} for - # more details. - # - # Classifier policy. - # - # @param id [String] The unique identifier for the classifier output. - # - # @param flagged [Boolean] - # - # @param probability [Float] - # - # @param data [Hash{Symbol=>Object}] Optional structured data produced by the policy. For face detection: { count, fa - # - # @param flagged_fields [Array] The keys of the flagged fields if submitting an object. - # - # @param labels [Array] - # - # @param type [Symbol, :classifier] - - class Label < ModerationAPI::Internal::Type::BaseModel - # @!attribute id - # - # @return [String] - required :id, String - - # @!attribute flagged - # - # @return [Boolean] - required :flagged, ModerationAPI::Internal::Type::Boolean - - # @!attribute probability - # - # @return [Float] - required :probability, Float - - # @!attribute shadow_flagged - # - # @return [Boolean, nil] - optional :shadow_flagged, ModerationAPI::Internal::Type::Boolean, api_name: :shadowFlagged - - # @!method initialize(id:, flagged:, probability:, shadow_flagged: nil) - # @param id [String] - # @param flagged [Boolean] - # @param probability [Float] - # @param shadow_flagged [Boolean] - end - end - - class EntityMatcherOutput < ModerationAPI::Internal::Type::BaseModel - # @!attribute id - # - # @return [String] - required :id, String - - # @!attribute flagged - # - # @return [Boolean] - required :flagged, ModerationAPI::Internal::Type::Boolean - - # @!attribute matches - # - # @return [Array] - required :matches, - -> { ModerationAPI::Internal::Type::ArrayOf[ModerationAPI::Models::ContentSubmitResponse::Policy::EntityMatcherOutput::Match] } - - # @!attribute probability - # - # @return [Float] - required :probability, Float - - # @!attribute type - # - # @return [Symbol, :entity_matcher] - required :type, const: :entity_matcher - - # @!attribute flagged_fields - # - # @return [Array, nil] - optional :flagged_fields, ModerationAPI::Internal::Type::ArrayOf[String] - - # @!method initialize(id:, flagged:, matches:, probability:, flagged_fields: nil, type: :entity_matcher) - # Entity matcher policy. - # - # @param id [String] - # @param flagged [Boolean] - # @param matches [Array] - # @param probability [Float] - # @param flagged_fields [Array] - # @param type [Symbol, :entity_matcher] - - class Match < ModerationAPI::Internal::Type::BaseModel - # @!attribute match - # - # @return [String] - required :match, String - - # @!attribute probability - # - # @return [Float] - required :probability, Float - - # @!attribute span - # - # @return [Array] - required :span, ModerationAPI::Internal::Type::ArrayOf[Integer] - - # @!attribute entity_type - # Sub-type of the entity match — e.g. the NER key (email, phone, name, …) for PII - # matches. Absent for URL Risk and wordlist matches where the type is already - # encoded in the parent label. - # - # @return [String, nil] - optional :entity_type, String - - # @!attribute reasons - # Stable codes explaining why a URL was flagged (URL Risk only). - # - # @return [Array, nil] - optional :reasons, ModerationAPI::Internal::Type::ArrayOf[String] - - # @!attribute signals - # Observable properties of a URL (URL Risk only). Absent for allow/block list - # matches. - # - # @return [ModerationAPI::Models::ContentSubmitResponse::Policy::EntityMatcherOutput::Match::Signals, nil] - optional :signals, - -> { ModerationAPI::Models::ContentSubmitResponse::Policy::EntityMatcherOutput::Match::Signals } - - # @!method initialize(match:, probability:, span:, entity_type: nil, reasons: nil, signals: nil) - # Some parameter documentations has been truncated, see - # {ModerationAPI::Models::ContentSubmitResponse::Policy::EntityMatcherOutput::Match} - # for more details. - # - # @param match [String] - # - # @param probability [Float] - # - # @param span [Array] - # - # @param entity_type [String] Sub-type of the entity match — e.g. the NER key (email, phone, name, …) for PII - # - # @param reasons [Array] Stable codes explaining why a URL was flagged (URL Risk only). - # - # @param signals [ModerationAPI::Models::ContentSubmitResponse::Policy::EntityMatcherOutput::Match::Signals] Observable properties of a URL (URL Risk only). Absent for allow/block list matc - - # @see ModerationAPI::Models::ContentSubmitResponse::Policy::EntityMatcherOutput::Match#signals - class Signals < ModerationAPI::Internal::Type::BaseModel - # @!attribute bot_protection - # - # @return [Boolean, nil] - required :bot_protection, ModerationAPI::Internal::Type::Boolean, nil?: true - - # @!attribute brand_impersonation - # - # @return [ModerationAPI::Models::ContentSubmitResponse::Policy::EntityMatcherOutput::Match::Signals::BrandImpersonation, nil] - required :brand_impersonation, - -> { ModerationAPI::Models::ContentSubmitResponse::Policy::EntityMatcherOutput::Match::Signals::BrandImpersonation }, - nil?: true - - # @!attribute domain_age_days - # - # @return [Integer, nil] - required :domain_age_days, Integer, nil?: true - - # @!attribute final_url - # - # @return [String, nil] - required :final_url, String, nil?: true - - # @!attribute has_email_setup - # - # @return [Boolean, nil] - required :has_email_setup, ModerationAPI::Internal::Type::Boolean, nil?: true - - # @!attribute has_suspicious_characters - # - # @return [Boolean] - required :has_suspicious_characters, ModerationAPI::Internal::Type::Boolean - - # @!attribute is_link_shortener - # - # @return [Boolean] - required :is_link_shortener, ModerationAPI::Internal::Type::Boolean - - # @!attribute is_reported - # - # @return [Boolean] - required :is_reported, ModerationAPI::Internal::Type::Boolean - - # @!attribute redirect_count - # - # @return [Integer, nil] - required :redirect_count, Integer, nil?: true - - # @!method initialize(bot_protection:, brand_impersonation:, domain_age_days:, final_url:, has_email_setup:, has_suspicious_characters:, is_link_shortener:, is_reported:, redirect_count:) - # Observable properties of a URL (URL Risk only). Absent for allow/block list - # matches. - # - # @param bot_protection [Boolean, nil] - # @param brand_impersonation [ModerationAPI::Models::ContentSubmitResponse::Policy::EntityMatcherOutput::Match::Signals::BrandImpersonation, nil] - # @param domain_age_days [Integer, nil] - # @param final_url [String, nil] - # @param has_email_setup [Boolean, nil] - # @param has_suspicious_characters [Boolean] - # @param is_link_shortener [Boolean] - # @param is_reported [Boolean] - # @param redirect_count [Integer, nil] - - # @see ModerationAPI::Models::ContentSubmitResponse::Policy::EntityMatcherOutput::Match::Signals#brand_impersonation - class BrandImpersonation < ModerationAPI::Internal::Type::BaseModel - # @!attribute brand - # - # @return [String] - required :brand, String - - # @!attribute method_ - # - # @return [Symbol, ModerationAPI::Models::ContentSubmitResponse::Policy::EntityMatcherOutput::Match::Signals::BrandImpersonation::Method] - required :method_, - enum: -> { ModerationAPI::Models::ContentSubmitResponse::Policy::EntityMatcherOutput::Match::Signals::BrandImpersonation::Method }, - api_name: :method - - # @!method initialize(brand:, method_:) - # @param brand [String] - # @param method_ [Symbol, ModerationAPI::Models::ContentSubmitResponse::Policy::EntityMatcherOutput::Match::Signals::BrandImpersonation::Method] - - # @see ModerationAPI::Models::ContentSubmitResponse::Policy::EntityMatcherOutput::Match::Signals::BrandImpersonation#method_ - module Method - extend ModerationAPI::Internal::Type::Enum - - REGISTERED_DOMAIN_TOKEN = :registered_domain_token - SUBDOMAIN_TOKEN = :subdomain_token - - # @!method self.values - # @return [Array] - end - end - end - end - end - - # @!method self.variants - # @return [Array(ModerationAPI::Models::ContentSubmitResponse::Policy::ClassifierOutput, ModerationAPI::Models::ContentSubmitResponse::Policy::EntityMatcherOutput)] - end - - # @see ModerationAPI::Models::ContentSubmitResponse#recommendation - class Recommendation < ModerationAPI::Internal::Type::BaseModel - # @!attribute action - # The action to take based on the recommendation - # - # @return [Symbol, ModerationAPI::Models::ContentSubmitResponse::Recommendation::Action] - required :action, enum: -> { ModerationAPI::Models::ContentSubmitResponse::Recommendation::Action } - - # @!attribute reason_codes - # Reason codes for the recommendation. Standard codes plus a `rule:` code - # identifying the rule that produced the action. Can be used to display a reason - # to the user. - # - # @return [Array] - required :reason_codes, - -> { ModerationAPI::Internal::Type::ArrayOf[union: ModerationAPI::Models::ContentSubmitResponse::Recommendation::ReasonCode] } - - # @!attribute matched_rules - # Rules that matched during evaluation, if rules engine is active. - # - # @return [Array, nil] - optional :matched_rules, - -> { ModerationAPI::Internal::Type::ArrayOf[ModerationAPI::Models::ContentSubmitResponse::Recommendation::MatchedRule] } - - # @!method initialize(action:, reason_codes:, matched_rules: nil) - # Some parameter documentations has been truncated, see - # {ModerationAPI::Models::ContentSubmitResponse::Recommendation} for more details. - # - # The recommendation for the content based on the evaluation. - # - # @param action [Symbol, ModerationAPI::Models::ContentSubmitResponse::Recommendation::Action] The action to take based on the recommendation - # - # @param reason_codes [Array] Reason codes for the recommendation. Standard codes plus a `rule:` code ide - # - # @param matched_rules [Array] Rules that matched during evaluation, if rules engine is active. - - # The action to take based on the recommendation - # - # @see ModerationAPI::Models::ContentSubmitResponse::Recommendation#action - module Action - extend ModerationAPI::Internal::Type::Enum - - REVIEW = :review - ALLOW = :allow - REJECT = :reject - - # @!method self.values - # @return [Array] - end - - module ReasonCode - extend ModerationAPI::Internal::Type::Union - - variant const: -> { ModerationAPI::Models::ContentSubmitResponse::Recommendation::ReasonCode::SEVERITY_REJECT } - - variant const: -> { ModerationAPI::Models::ContentSubmitResponse::Recommendation::ReasonCode::SEVERITY_REVIEW } - - variant const: -> { ModerationAPI::Models::ContentSubmitResponse::Recommendation::ReasonCode::AUTHOR_BLOCK } - - variant const: -> { ModerationAPI::Models::ContentSubmitResponse::Recommendation::ReasonCode::DRY_RUN } - - variant const: -> { ModerationAPI::Models::ContentSubmitResponse::Recommendation::ReasonCode::TRUSTED_ALLOW } - - variant const: -> { ModerationAPI::Models::ContentSubmitResponse::Recommendation::ReasonCode::UNTRUSTED_SEVERITY } - - variant const: -> { ModerationAPI::Models::ContentSubmitResponse::Recommendation::ReasonCode::RULE_MATCH } - - variant const: -> { ModerationAPI::Models::ContentSubmitResponse::Recommendation::ReasonCode::RULE_DEFAULT } - - variant const: -> { ModerationAPI::Models::ContentSubmitResponse::Recommendation::ReasonCode::RULE_FALLBACK } - - variant const: -> { ModerationAPI::Models::ContentSubmitResponse::Recommendation::ReasonCode::CLIENT_OVERRIDE } - - variant const: -> { ModerationAPI::Models::ContentSubmitResponse::Recommendation::ReasonCode::CASEBOOK_MATCH } - - variant String - - # @!method self.variants - # @return [Array(Symbol, String)] - - define_sorbet_constant!(:Variants) do - T.type_alias { T.any(ModerationAPI::Models::ContentSubmitResponse::Recommendation::ReasonCode::TaggedSymbol, String) } - end - - # @!group - - SEVERITY_REJECT = :severity_reject - SEVERITY_REVIEW = :severity_review - AUTHOR_BLOCK = :author_block - DRY_RUN = :dry_run - TRUSTED_ALLOW = :trusted_allow - UNTRUSTED_SEVERITY = :untrusted_severity - RULE_MATCH = :rule_match - RULE_DEFAULT = :rule_default - RULE_FALLBACK = :rule_fallback - CLIENT_OVERRIDE = :client_override - CASEBOOK_MATCH = :casebook_match - - # @!endgroup - end - - class MatchedRule < ModerationAPI::Internal::Type::BaseModel - # @!attribute key - # - # @return [String] - required :key, String - - # @!attribute name - # - # @return [String] - required :name, String - - # @!method initialize(key:, name:) - # @param key [String] - # @param name [String] - end - end - - class Error < ModerationAPI::Internal::Type::BaseModel - # @!attribute id - # - # @return [String] - required :id, String - - # @!attribute message - # - # @return [String] - required :message, String - - # @!method initialize(id:, message:) - # @param id [String] - # @param message [String] - end - end - end -end diff --git a/lib/moderation_api/models/errors.rb b/lib/moderation_api/models/errors.rb new file mode 100644 index 00000000..4b8d3a0f --- /dev/null +++ b/lib/moderation_api/models/errors.rb @@ -0,0 +1,19 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Errors + autoload :APIError, "moderation_api/models/errors/apierror.rb" + autoload :AuthenticationError, "moderation_api/models/errors/authenticationerror.rb" + autoload :BadRequestError, "moderation_api/models/errors/badrequesterror.rb" + autoload :ConflictError, "moderation_api/models/errors/conflicterror.rb" + autoload :InternalServerError, "moderation_api/models/errors/internalservererror.rb" + autoload :NotFoundError, "moderation_api/models/errors/notfounderror.rb" + autoload :PermissionDeniedError, "moderation_api/models/errors/permissiondeniederror.rb" + autoload :RateLimitError, "moderation_api/models/errors/ratelimiterror.rb" + end + end +end diff --git a/lib/moderation_api/models/errors/apierror.rb b/lib/moderation_api/models/errors/apierror.rb new file mode 100644 index 00000000..fc3ffdf5 --- /dev/null +++ b/lib/moderation_api/models/errors/apierror.rb @@ -0,0 +1,39 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Errors + + class APIError < StandardError + include Crystalline::MetadataFields + extend T::Sig + + field :body, T.nilable(::String), {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("body")}} + field :raw_response, T.nilable(Faraday::Response), {} + field( + :status_code, + T.nilable(::Integer), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("status_code")}} + ) + + sig { params(status_code: ::Integer, body: ::String, raw_response: Faraday::Response).void } + def initialize(status_code:, body:, raw_response:) + @status_code = status_code + @body = body + @raw_response = raw_response + end + + def ==(other) + return false unless other.is_a?(self.class) + return false unless @status_code == other.status_code + return false unless @body == other.body + return false unless @raw_response == other.raw_response + true + end + end + end + end +end diff --git a/lib/moderation_api/models/errors/apierror.rbi b/lib/moderation_api/models/errors/apierror.rbi new file mode 100644 index 00000000..9cabed5b --- /dev/null +++ b/lib/moderation_api/models/errors/apierror.rbi @@ -0,0 +1,27 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Errors::APIError + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Errors::APIError + + def body + end + + def body=(body) + end + + def raw_response + end + + def raw_response=(raw_response) + end + + def status_code + end + + def status_code=(status_code) + end +end diff --git a/lib/moderation_api/models/errors/authenticationerror.rb b/lib/moderation_api/models/errors/authenticationerror.rb new file mode 100644 index 00000000..3ad5f950 --- /dev/null +++ b/lib/moderation_api/models/errors/authenticationerror.rb @@ -0,0 +1,120 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Errors + # The API key is missing, invalid or revoked. + class AuthenticationError < StandardError + extend T::Sig + include Crystalline::MetadataFields + + # Exactly what went wrong. Stable; safe to branch on. New codes may be added. + # + # - `unauthorized`: Authentication failed. + # - `missing_api_key`: No API key in the `Authorization` header. + # - `malformed_api_key`: The `Authorization` header does not contain a valid key format. + # - `invalid_api_key`: The API key does not exist or was revoked. + field( + :code, + Models::Components::AuthenticationErrorCode, + { + 'format_json': { + 'letter_case': ::ModerationApi::Utils.field_name("code"), + required: true, + 'decoder': ::ModerationApi::Utils.open_enum_from_string( + Models::Components::AuthenticationErrorCode, + false + ) + } + } + ) + # Human-readable explanation. + field( + :message, + ::String, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("message"), required: true}} + ) + # Identifies this request. Include it when you contact support. + field( + :request_id, + ::String, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("request_id"), required: true}} + ) + # Documentation for this `code`. + field( + :doc_url, + ::String, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("doc_url"), required: true}} + ) + # Broad error category. Stable; safe to switch on. + field( + :type, + ::String, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("type"), required: true}} + ) + # Validation problems, when the request body is invalid. + field( + :issues, + Crystalline::Nilable.new(Crystalline::Array.new(Models::Components::ErrorIssue)), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("issues")}} + ) + # Raw HTTP response; suitable for custom response parsing + field( + :raw_response, + Crystalline::Nilable.new(::Faraday::Response), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("-")}} + ) + + sig { + params( + code: Models::Components::AuthenticationErrorCode, + message: ::String, + request_id: ::String, + doc_url: ::String, + type: ::String, + issues: T.nilable(T::Array[Models::Components::ErrorIssue]), + raw_response: T.nilable(::Faraday::Response) + ) + .void + } + def initialize( + code:, + message:, + request_id:, + doc_url:, + type: "authentication_error", + issues: nil, + raw_response: nil + ) + @code = code + @message = message + @request_id = request_id + @doc_url = doc_url + unless type == "authentication_error" + raise ArgumentError, "Invalid value for type" + end + + @type = "authentication_error" + @issues = issues + @raw_response = raw_response + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @code == other.code + return false unless @message == other.message + return false unless @request_id == other.request_id + return false unless @doc_url == other.doc_url + return false unless @type == other.type + return false unless @issues == other.issues + return false unless @raw_response == other.raw_response + true + end + end + end + end +end diff --git a/lib/moderation_api/models/errors/authenticationerror.rbi b/lib/moderation_api/models/errors/authenticationerror.rbi new file mode 100644 index 00000000..7b8ec6fa --- /dev/null +++ b/lib/moderation_api/models/errors/authenticationerror.rbi @@ -0,0 +1,50 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Errors::AuthenticationError + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Errors::AuthenticationError + def code + end + + def code=(str_) + end + + def message + end + + def message=(str_) + end + + def request_id + end + + def request_id=(str_) + end + + def doc_url + end + + def doc_url=(str_) + end + + def type + end + + def type=(str_) + end + + def issues + end + + def issues=(str_) + end + + def raw_response + end + + def raw_response=(str_) + end +end diff --git a/lib/moderation_api/models/errors/badrequesterror.rb b/lib/moderation_api/models/errors/badrequesterror.rb new file mode 100644 index 00000000..dcba2196 --- /dev/null +++ b/lib/moderation_api/models/errors/badrequesterror.rb @@ -0,0 +1,115 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Errors + # The request is malformed or a parameter is invalid. + class BadRequestError < StandardError + extend T::Sig + include Crystalline::MetadataFields + + # Exactly what went wrong. Stable; safe to branch on. New codes may be added. + # + # - `invalid_request`: A parameter is invalid. `message` says which one. + # - `validation_failed`: The request body does not match the schema. `issues` lists each problem with its `path`. + field( + :code, + Models::Components::BadRequestErrorCode, + { + 'format_json': { + 'letter_case': ::ModerationApi::Utils.field_name("code"), + required: true, + 'decoder': ::ModerationApi::Utils.open_enum_from_string(Models::Components::BadRequestErrorCode, false) + } + } + ) + # Human-readable explanation. + field( + :message, + ::String, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("message"), required: true}} + ) + # Identifies this request. Include it when you contact support. + field( + :request_id, + ::String, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("request_id"), required: true}} + ) + # Documentation for this `code`. + field( + :doc_url, + ::String, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("doc_url"), required: true}} + ) + # Broad error category. Stable; safe to switch on. + field( + :type, + ::String, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("type"), required: true}} + ) + # Validation problems, when the request body is invalid. + field( + :issues, + Crystalline::Nilable.new(Crystalline::Array.new(Models::Components::ErrorIssue)), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("issues")}} + ) + # Raw HTTP response; suitable for custom response parsing + field( + :raw_response, + Crystalline::Nilable.new(::Faraday::Response), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("-")}} + ) + + sig { + params( + code: Models::Components::BadRequestErrorCode, + message: ::String, + request_id: ::String, + doc_url: ::String, + type: ::String, + issues: T.nilable(T::Array[Models::Components::ErrorIssue]), + raw_response: T.nilable(::Faraday::Response) + ) + .void + } + def initialize( + code:, + message:, + request_id:, + doc_url:, + type: "invalid_request_error", + issues: nil, + raw_response: nil + ) + @code = code + @message = message + @request_id = request_id + @doc_url = doc_url + unless type == "invalid_request_error" + raise ArgumentError, "Invalid value for type" + end + + @type = "invalid_request_error" + @issues = issues + @raw_response = raw_response + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @code == other.code + return false unless @message == other.message + return false unless @request_id == other.request_id + return false unless @doc_url == other.doc_url + return false unless @type == other.type + return false unless @issues == other.issues + return false unless @raw_response == other.raw_response + true + end + end + end + end +end diff --git a/lib/moderation_api/models/errors/badrequesterror.rbi b/lib/moderation_api/models/errors/badrequesterror.rbi new file mode 100644 index 00000000..0fc6ff5d --- /dev/null +++ b/lib/moderation_api/models/errors/badrequesterror.rbi @@ -0,0 +1,50 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Errors::BadRequestError + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Errors::BadRequestError + def code + end + + def code=(str_) + end + + def message + end + + def message=(str_) + end + + def request_id + end + + def request_id=(str_) + end + + def doc_url + end + + def doc_url=(str_) + end + + def type + end + + def type=(str_) + end + + def issues + end + + def issues=(str_) + end + + def raw_response + end + + def raw_response=(str_) + end +end diff --git a/lib/moderation_api/models/errors/conflicterror.rb b/lib/moderation_api/models/errors/conflicterror.rb new file mode 100644 index 00000000..d60912e6 --- /dev/null +++ b/lib/moderation_api/models/errors/conflicterror.rb @@ -0,0 +1,106 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Errors + # The request conflicts with the current state of a resource. + class ConflictError < StandardError + extend T::Sig + include Crystalline::MetadataFields + + # Exactly what went wrong. Stable; safe to branch on. New codes may be added. + # + # - `resource_conflict`: The request conflicts with an existing resource. + field( + :code, + Models::Components::ConflictErrorCode, + { + 'format_json': { + 'letter_case': ::ModerationApi::Utils.field_name("code"), + required: true, + 'decoder': ::ModerationApi::Utils.open_enum_from_string(Models::Components::ConflictErrorCode, false) + } + } + ) + # Human-readable explanation. + field( + :message, + ::String, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("message"), required: true}} + ) + # Identifies this request. Include it when you contact support. + field( + :request_id, + ::String, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("request_id"), required: true}} + ) + # Documentation for this `code`. + field( + :doc_url, + ::String, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("doc_url"), required: true}} + ) + # Broad error category. Stable; safe to switch on. + field( + :type, + ::String, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("type"), required: true}} + ) + # Validation problems, when the request body is invalid. + field( + :issues, + Crystalline::Nilable.new(Crystalline::Array.new(Models::Components::ErrorIssue)), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("issues")}} + ) + # Raw HTTP response; suitable for custom response parsing + field( + :raw_response, + Crystalline::Nilable.new(::Faraday::Response), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("-")}} + ) + + sig { + params( + code: Models::Components::ConflictErrorCode, + message: ::String, + request_id: ::String, + doc_url: ::String, + type: ::String, + issues: T.nilable(T::Array[Models::Components::ErrorIssue]), + raw_response: T.nilable(::Faraday::Response) + ) + .void + } + def initialize(code:, message:, request_id:, doc_url:, type: "conflict_error", issues: nil, raw_response: nil) + @code = code + @message = message + @request_id = request_id + @doc_url = doc_url + unless type == "conflict_error" + raise ArgumentError, "Invalid value for type" + end + + @type = "conflict_error" + @issues = issues + @raw_response = raw_response + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @code == other.code + return false unless @message == other.message + return false unless @request_id == other.request_id + return false unless @doc_url == other.doc_url + return false unless @type == other.type + return false unless @issues == other.issues + return false unless @raw_response == other.raw_response + true + end + end + end + end +end diff --git a/lib/moderation_api/models/errors/conflicterror.rbi b/lib/moderation_api/models/errors/conflicterror.rbi new file mode 100644 index 00000000..acd4fe8d --- /dev/null +++ b/lib/moderation_api/models/errors/conflicterror.rbi @@ -0,0 +1,50 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Errors::ConflictError + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Errors::ConflictError + def code + end + + def code=(str_) + end + + def message + end + + def message=(str_) + end + + def request_id + end + + def request_id=(str_) + end + + def doc_url + end + + def doc_url=(str_) + end + + def type + end + + def type=(str_) + end + + def issues + end + + def issues=(str_) + end + + def raw_response + end + + def raw_response=(str_) + end +end diff --git a/lib/moderation_api/models/errors/internalservererror.rb b/lib/moderation_api/models/errors/internalservererror.rb new file mode 100644 index 00000000..0bae9475 --- /dev/null +++ b/lib/moderation_api/models/errors/internalservererror.rb @@ -0,0 +1,109 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Errors + # Something went wrong on our side. Retry with backoff. + class InternalServerError < StandardError + extend T::Sig + include Crystalline::MetadataFields + + # Exactly what went wrong. Stable; safe to branch on. New codes may be added. + # + # - `internal_error`: Something went wrong on our side. Retry with backoff. + field( + :code, + Models::Components::InternalServerErrorCode, + { + 'format_json': { + 'letter_case': ::ModerationApi::Utils.field_name("code"), + required: true, + 'decoder': ::ModerationApi::Utils.open_enum_from_string( + Models::Components::InternalServerErrorCode, + false + ) + } + } + ) + # Human-readable explanation. + field( + :message, + ::String, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("message"), required: true}} + ) + # Identifies this request. Include it when you contact support. + field( + :request_id, + ::String, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("request_id"), required: true}} + ) + # Documentation for this `code`. + field( + :doc_url, + ::String, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("doc_url"), required: true}} + ) + # Broad error category. Stable; safe to switch on. + field( + :type, + ::String, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("type"), required: true}} + ) + # Validation problems, when the request body is invalid. + field( + :issues, + Crystalline::Nilable.new(Crystalline::Array.new(Models::Components::ErrorIssue)), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("issues")}} + ) + # Raw HTTP response; suitable for custom response parsing + field( + :raw_response, + Crystalline::Nilable.new(::Faraday::Response), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("-")}} + ) + + sig { + params( + code: Models::Components::InternalServerErrorCode, + message: ::String, + request_id: ::String, + doc_url: ::String, + type: ::String, + issues: T.nilable(T::Array[Models::Components::ErrorIssue]), + raw_response: T.nilable(::Faraday::Response) + ) + .void + } + def initialize(code:, message:, request_id:, doc_url:, type: "api_error", issues: nil, raw_response: nil) + @code = code + @message = message + @request_id = request_id + @doc_url = doc_url + unless type == "api_error" + raise ArgumentError, "Invalid value for type" + end + + @type = "api_error" + @issues = issues + @raw_response = raw_response + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @code == other.code + return false unless @message == other.message + return false unless @request_id == other.request_id + return false unless @doc_url == other.doc_url + return false unless @type == other.type + return false unless @issues == other.issues + return false unless @raw_response == other.raw_response + true + end + end + end + end +end diff --git a/lib/moderation_api/models/errors/internalservererror.rbi b/lib/moderation_api/models/errors/internalservererror.rbi new file mode 100644 index 00000000..93f51577 --- /dev/null +++ b/lib/moderation_api/models/errors/internalservererror.rbi @@ -0,0 +1,50 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Errors::InternalServerError + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Errors::InternalServerError + def code + end + + def code=(str_) + end + + def message + end + + def message=(str_) + end + + def request_id + end + + def request_id=(str_) + end + + def doc_url + end + + def doc_url=(str_) + end + + def type + end + + def type=(str_) + end + + def issues + end + + def issues=(str_) + end + + def raw_response + end + + def raw_response=(str_) + end +end diff --git a/lib/moderation_api/models/errors/notfounderror.rb b/lib/moderation_api/models/errors/notfounderror.rb new file mode 100644 index 00000000..45057c8e --- /dev/null +++ b/lib/moderation_api/models/errors/notfounderror.rb @@ -0,0 +1,113 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Errors + # The resource does not exist or the key cannot see it. + class NotFoundError < StandardError + extend T::Sig + include Crystalline::MetadataFields + + # Exactly what went wrong. Stable; safe to branch on. New codes may be added. + # + # - `resource_not_found`: The resource does not exist. + # - `action_not_found`: The action does not exist. + # - `author_not_found`: The author does not exist. + # - `queue_not_found`: The review queue does not exist. + # - `wordlist_not_found`: The wordlist does not exist. + # - `webhook_not_found`: The webhook does not exist. + # - `project_not_found`: The project does not exist. + # - `channel_not_found`: The channel does not exist. + field( + :code, + Models::Components::NotFoundErrorCode, + { + 'format_json': { + 'letter_case': ::ModerationApi::Utils.field_name("code"), + required: true, + 'decoder': ::ModerationApi::Utils.open_enum_from_string(Models::Components::NotFoundErrorCode, false) + } + } + ) + # Human-readable explanation. + field( + :message, + ::String, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("message"), required: true}} + ) + # Identifies this request. Include it when you contact support. + field( + :request_id, + ::String, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("request_id"), required: true}} + ) + # Documentation for this `code`. + field( + :doc_url, + ::String, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("doc_url"), required: true}} + ) + # Broad error category. Stable; safe to switch on. + field( + :type, + ::String, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("type"), required: true}} + ) + # Validation problems, when the request body is invalid. + field( + :issues, + Crystalline::Nilable.new(Crystalline::Array.new(Models::Components::ErrorIssue)), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("issues")}} + ) + # Raw HTTP response; suitable for custom response parsing + field( + :raw_response, + Crystalline::Nilable.new(::Faraday::Response), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("-")}} + ) + + sig { + params( + code: Models::Components::NotFoundErrorCode, + message: ::String, + request_id: ::String, + doc_url: ::String, + type: ::String, + issues: T.nilable(T::Array[Models::Components::ErrorIssue]), + raw_response: T.nilable(::Faraday::Response) + ) + .void + } + def initialize(code:, message:, request_id:, doc_url:, type: "not_found_error", issues: nil, raw_response: nil) + @code = code + @message = message + @request_id = request_id + @doc_url = doc_url + unless type == "not_found_error" + raise ArgumentError, "Invalid value for type" + end + + @type = "not_found_error" + @issues = issues + @raw_response = raw_response + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @code == other.code + return false unless @message == other.message + return false unless @request_id == other.request_id + return false unless @doc_url == other.doc_url + return false unless @type == other.type + return false unless @issues == other.issues + return false unless @raw_response == other.raw_response + true + end + end + end + end +end diff --git a/lib/moderation_api/models/errors/notfounderror.rbi b/lib/moderation_api/models/errors/notfounderror.rbi new file mode 100644 index 00000000..2ba7a99b --- /dev/null +++ b/lib/moderation_api/models/errors/notfounderror.rbi @@ -0,0 +1,50 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Errors::NotFoundError + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Errors::NotFoundError + def code + end + + def code=(str_) + end + + def message + end + + def message=(str_) + end + + def request_id + end + + def request_id=(str_) + end + + def doc_url + end + + def doc_url=(str_) + end + + def type + end + + def type=(str_) + end + + def issues + end + + def issues=(str_) + end + + def raw_response + end + + def raw_response=(str_) + end +end diff --git a/lib/moderation_api/models/errors/permissiondeniederror.rb b/lib/moderation_api/models/errors/permissiondeniederror.rb new file mode 100644 index 00000000..61e1a26e --- /dev/null +++ b/lib/moderation_api/models/errors/permissiondeniederror.rb @@ -0,0 +1,117 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Errors + # The API key cannot do this, or the plan limit for this resource is reached. + class PermissionDeniedError < StandardError + extend T::Sig + include Crystalline::MetadataFields + + # Exactly what went wrong. Stable; safe to branch on. New codes may be added. + # + # - `permission_denied`: The API key cannot perform this request. + # - `account_disabled`: The organization account is disabled. + # - `quota_exceeded`: The organization has used all API requests on its plan. + # - `plan_feature_unavailable`: The current plan does not include this feature. + # - `plan_limit_exceeded`: The request goes over a limit of the current plan. + # - `project_key_required`: This endpoint needs a project API key, but an organization key was used. + # - `organization_key_required`: This endpoint needs an organization API key, but a project key was used. + # - `missing_key_permission`: The organization key does not have the permission this endpoint needs. + # - `project_not_reachable`: The organization key is limited to other projects. + field( + :code, + Models::Components::PermissionDeniedErrorCode, + { + 'format_json': { + 'letter_case': ::ModerationApi::Utils.field_name("code"), + required: true, + 'decoder': ::ModerationApi::Utils.open_enum_from_string( + Models::Components::PermissionDeniedErrorCode, + false + ) + } + } + ) + # Human-readable explanation. + field( + :message, + ::String, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("message"), required: true}} + ) + # Identifies this request. Include it when you contact support. + field( + :request_id, + ::String, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("request_id"), required: true}} + ) + # Documentation for this `code`. + field( + :doc_url, + ::String, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("doc_url"), required: true}} + ) + # Broad error category. Stable; safe to switch on. + field( + :type, + ::String, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("type"), required: true}} + ) + # Validation problems, when the request body is invalid. + field( + :issues, + Crystalline::Nilable.new(Crystalline::Array.new(Models::Components::ErrorIssue)), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("issues")}} + ) + # Raw HTTP response; suitable for custom response parsing + field( + :raw_response, + Crystalline::Nilable.new(::Faraday::Response), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("-")}} + ) + + sig { + params( + code: Models::Components::PermissionDeniedErrorCode, + message: ::String, + request_id: ::String, + doc_url: ::String, + type: ::String, + issues: T.nilable(T::Array[Models::Components::ErrorIssue]), + raw_response: T.nilable(::Faraday::Response) + ) + .void + } + def initialize(code:, message:, request_id:, doc_url:, type: "permission_error", issues: nil, raw_response: nil) + @code = code + @message = message + @request_id = request_id + @doc_url = doc_url + unless type == "permission_error" + raise ArgumentError, "Invalid value for type" + end + + @type = "permission_error" + @issues = issues + @raw_response = raw_response + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @code == other.code + return false unless @message == other.message + return false unless @request_id == other.request_id + return false unless @doc_url == other.doc_url + return false unless @type == other.type + return false unless @issues == other.issues + return false unless @raw_response == other.raw_response + true + end + end + end + end +end diff --git a/lib/moderation_api/models/errors/permissiondeniederror.rbi b/lib/moderation_api/models/errors/permissiondeniederror.rbi new file mode 100644 index 00000000..9ca006bc --- /dev/null +++ b/lib/moderation_api/models/errors/permissiondeniederror.rbi @@ -0,0 +1,50 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Errors::PermissionDeniedError + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Errors::PermissionDeniedError + def code + end + + def code=(str_) + end + + def message + end + + def message=(str_) + end + + def request_id + end + + def request_id=(str_) + end + + def doc_url + end + + def doc_url=(str_) + end + + def type + end + + def type=(str_) + end + + def issues + end + + def issues=(str_) + end + + def raw_response + end + + def raw_response=(str_) + end +end diff --git a/lib/moderation_api/models/errors/ratelimiterror.rb b/lib/moderation_api/models/errors/ratelimiterror.rb new file mode 100644 index 00000000..505dd665 --- /dev/null +++ b/lib/moderation_api/models/errors/ratelimiterror.rb @@ -0,0 +1,106 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Errors + # Too many requests. Retry after the number of seconds in the `Retry-After` header. + class RateLimitError < StandardError + extend T::Sig + include Crystalline::MetadataFields + + # Exactly what went wrong. Stable; safe to branch on. New codes may be added. + # + # - `rate_limit_exceeded`: Too many requests. Wait for the `Retry-After` seconds. + field( + :code, + Models::Components::RateLimitErrorCode, + { + 'format_json': { + 'letter_case': ::ModerationApi::Utils.field_name("code"), + required: true, + 'decoder': ::ModerationApi::Utils.open_enum_from_string(Models::Components::RateLimitErrorCode, false) + } + } + ) + # Human-readable explanation. + field( + :message, + ::String, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("message"), required: true}} + ) + # Identifies this request. Include it when you contact support. + field( + :request_id, + ::String, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("request_id"), required: true}} + ) + # Documentation for this `code`. + field( + :doc_url, + ::String, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("doc_url"), required: true}} + ) + # Broad error category. Stable; safe to switch on. + field( + :type, + ::String, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("type"), required: true}} + ) + # Validation problems, when the request body is invalid. + field( + :issues, + Crystalline::Nilable.new(Crystalline::Array.new(Models::Components::ErrorIssue)), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("issues")}} + ) + # Raw HTTP response; suitable for custom response parsing + field( + :raw_response, + Crystalline::Nilable.new(::Faraday::Response), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("-")}} + ) + + sig { + params( + code: Models::Components::RateLimitErrorCode, + message: ::String, + request_id: ::String, + doc_url: ::String, + type: ::String, + issues: T.nilable(T::Array[Models::Components::ErrorIssue]), + raw_response: T.nilable(::Faraday::Response) + ) + .void + } + def initialize(code:, message:, request_id:, doc_url:, type: "rate_limit_error", issues: nil, raw_response: nil) + @code = code + @message = message + @request_id = request_id + @doc_url = doc_url + unless type == "rate_limit_error" + raise ArgumentError, "Invalid value for type" + end + + @type = "rate_limit_error" + @issues = issues + @raw_response = raw_response + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @code == other.code + return false unless @message == other.message + return false unless @request_id == other.request_id + return false unless @doc_url == other.doc_url + return false unless @type == other.type + return false unless @issues == other.issues + return false unless @raw_response == other.raw_response + true + end + end + end + end +end diff --git a/lib/moderation_api/models/errors/ratelimiterror.rbi b/lib/moderation_api/models/errors/ratelimiterror.rbi new file mode 100644 index 00000000..3b9cbccc --- /dev/null +++ b/lib/moderation_api/models/errors/ratelimiterror.rbi @@ -0,0 +1,50 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Errors::RateLimitError + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Errors::RateLimitError + def code + end + + def code=(str_) + end + + def message + end + + def message=(str_) + end + + def request_id + end + + def request_id=(str_) + end + + def doc_url + end + + def doc_url=(str_) + end + + def type + end + + def type=(str_) + end + + def issues + end + + def issues=(str_) + end + + def raw_response + end + + def raw_response=(str_) + end +end diff --git a/lib/moderation_api/models/operations.rb b/lib/moderation_api/models/operations.rb new file mode 100644 index 00000000..280b8126 --- /dev/null +++ b/lib/moderation_api/models/operations.rb @@ -0,0 +1,345 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + autoload :Adult, "moderation_api/models/operations/adult.rb" + autoload :Alcohol, "moderation_api/models/operations/alcohol.rb" + autoload :AudioRequest, "moderation_api/models/operations/audio_request.rb" + autoload :AudioResponse, "moderation_api/models/operations/audio_response.rb" + autoload :Cannabis, "moderation_api/models/operations/cannabis.rb" + autoload :ChannelCircumvention, "moderation_api/models/operations/channel_circumvention.rb" + autoload :ClassifierOutput, "moderation_api/models/operations/classifier_output.rb" + autoload :CodeAbuse, "moderation_api/models/operations/code_abuse.rb" + autoload :CompassionInsight, "moderation_api/models/operations/compassion_insight.rb" + autoload :ContentLeafRequest, "moderation_api/models/operations/content_leaf_request.rb" + autoload :ContentLeafResponse, "moderation_api/models/operations/content_leaf_response.rb" + autoload :Crypto, "moderation_api/models/operations/crypto.rb" + autoload :CuriosityInsight, "moderation_api/models/operations/curiosity_insight.rb" + autoload :Drugs, "moderation_api/models/operations/drugs.rb" + autoload :EntityMatcherOutput, "moderation_api/models/operations/entity_matcher_output.rb" + autoload :Extremism, "moderation_api/models/operations/extremism.rb" + autoload :FaceDetection, "moderation_api/models/operations/face_detection.rb" + autoload :Gambling, "moderation_api/models/operations/gambling.rb" + autoload :Guideline, "moderation_api/models/operations/guideline.rb" + autoload :Hate, "moderation_api/models/operations/hate.rb" + autoload :IllegalTrade, "moderation_api/models/operations/illegal_trade.rb" + autoload :Illicit, "moderation_api/models/operations/illicit.rb" + autoload :IllicitAlcohol, "moderation_api/models/operations/illicit_alcohol.rb" + autoload :IllicitDrugs, "moderation_api/models/operations/illicit_drugs.rb" + autoload :IllicitFirearms, "moderation_api/models/operations/illicit_firearms.rb" + autoload :IllicitGambling, "moderation_api/models/operations/illicit_gambling.rb" + autoload :IllicitTobacco, "moderation_api/models/operations/illicit_tobacco.rb" + autoload :ImageRequest, "moderation_api/models/operations/image_request.rb" + autoload :ImageResponse, "moderation_api/models/operations/image_response.rb" + autoload :LanguageInsight, "moderation_api/models/operations/language_insight.rb" + autoload :LowQualityContent, "moderation_api/models/operations/low_quality_content.rb" + autoload :Object, "moderation_api/models/operations/object.rb" + autoload :PIIMasking, "moderation_api/models/operations/pii_masking.rb" + autoload :PersonalInformation, "moderation_api/models/operations/personal_information.rb" + autoload :PersonalStoryInsight, "moderation_api/models/operations/personal_story_insight.rb" + autoload :Political, "moderation_api/models/operations/political.rb" + autoload :Profanity, "moderation_api/models/operations/profanity.rb" + autoload :Promotion, "moderation_api/models/operations/promotion.rb" + autoload :Religion, "moderation_api/models/operations/religion.rb" + autoload :RespectInsight, "moderation_api/models/operations/respect_insight.rb" + autoload :SelfHarm, "moderation_api/models/operations/self_harm.rb" + autoload :SelfPromotion, "moderation_api/models/operations/self_promotion.rb" + autoload :SentimentInsight, "moderation_api/models/operations/sentiment_insight.rb" + autoload :Sexual, "moderation_api/models/operations/sexual.rb" + autoload :SexualMinors, "moderation_api/models/operations/sexual_minors.rb" + autoload :SexualSolicitation, "moderation_api/models/operations/sexual_solicitation.rb" + autoload :Spam, "moderation_api/models/operations/spam.rb" + autoload :TextRequest, "moderation_api/models/operations/text_request.rb" + autoload :TextResponse, "moderation_api/models/operations/text_response.rb" + autoload :Threat, "moderation_api/models/operations/threat.rb" + autoload :Tobacco, "moderation_api/models/operations/tobacco.rb" + autoload :Toxicity, "moderation_api/models/operations/toxicity.rb" + autoload :URLMasking, "moderation_api/models/operations/url_masking.rb" + autoload :URLRisk, "moderation_api/models/operations/url_risk.rb" + autoload :UnicodeSpoofing, "moderation_api/models/operations/unicode_spoofing.rb" + autoload :VideoRequest, "moderation_api/models/operations/video_request.rb" + autoload :VideoResponse, "moderation_api/models/operations/video_response.rb" + autoload :Violence, "moderation_api/models/operations/violence.rb" + autoload :Weapons, "moderation_api/models/operations/weapons.rb" + autoload :ActionStat, "moderation_api/models/operations/actionstat.rb" + autoload :ActionRequest, "moderation_api/models/operations/action_request.rb" + autoload :AddWordlistWordsRequestBody, "moderation_api/models/operations/addwordlistwords_requestbody.rb" + autoload :AddWordlistWordsResponseBody, "moderation_api/models/operations/addwordlistwords_responsebody.rb" + autoload :AddWordlistWordsRequest, "moderation_api/models/operations/addwordlistwords_request.rb" + autoload :AddWordlistWordsResponse, "moderation_api/models/operations/addwordlistwords_response.rb" + autoload :Author, "moderation_api/models/operations/author.rb" + autoload :AuthorStatus, "moderation_api/models/operations/author_status.rb" + autoload :Behavior, "moderation_api/models/operations/behavior.rb" + autoload :Block, "moderation_api/models/operations/block.rb" + autoload :BrandImpersonation, "moderation_api/models/operations/brand_impersonation.rb" + autoload :Casebook, "moderation_api/models/operations/casebook.rb" + autoload :CasebookAgreement, "moderation_api/models/operations/casebookagreement.rb" + autoload :CasebookAnswer, "moderation_api/models/operations/casebookanswer.rb" + autoload :CheckStatus, "moderation_api/models/operations/checkstatus.rb" + autoload :ClientAction, "moderation_api/models/operations/clientaction.rb" + autoload :Comparator, "moderation_api/models/operations/comparator.rb" + autoload :ContentRequest, "moderation_api/models/operations/content_request.rb" + autoload :ContentResponse, "moderation_api/models/operations/content_response.rb" + autoload :CreateActionResponseBody, "moderation_api/models/operations/createaction_responsebody.rb" + autoload :CreateActionPositionRequest, "moderation_api/models/operations/createaction_position_request.rb" + autoload :CreateActionPositionResponse, "moderation_api/models/operations/createaction_position_response.rb" + autoload( + :CreateActionPossibleValueRequest, + "moderation_api/models/operations/createaction_possiblevalue_request.rb" + ) + autoload( + :CreateActionPossibleValueResponse, + "moderation_api/models/operations/createaction_possiblevalue_response.rb" + ) + autoload( + :CreateActionQueueBehaviourRequest, + "moderation_api/models/operations/createaction_queuebehaviour_request.rb" + ) + autoload( + :CreateActionQueueBehaviourResponse, + "moderation_api/models/operations/createaction_queuebehaviour_response.rb" + ) + autoload :CreateActionRequest, "moderation_api/models/operations/createaction_request.rb" + autoload :CreateActionResponse, "moderation_api/models/operations/createaction_response.rb" + autoload :CreateActionTypeRequest, "moderation_api/models/operations/createaction_type_request.rb" + autoload :CreateActionTypeResponse, "moderation_api/models/operations/createaction_type_response.rb" + autoload :CreateAuthorMetadata, "moderation_api/models/operations/createauthor_metadata.rb" + autoload :CreateAuthorRequest, "moderation_api/models/operations/createauthor_request.rb" + autoload :CreateAuthorResponse, "moderation_api/models/operations/createauthor_response.rb" + autoload :CreateChannelRequestBody, "moderation_api/models/operations/createchannel_requestbody.rb" + autoload :CreateChannelContentType, "moderation_api/models/operations/createchannel_contenttype.rb" + autoload :CreateChannelRequest, "moderation_api/models/operations/createchannel_request.rb" + autoload :CreateChannelResponse, "moderation_api/models/operations/createchannel_response.rb" + autoload :CreateProjectRequest, "moderation_api/models/operations/createproject_request.rb" + autoload :CreateProjectResponse, "moderation_api/models/operations/createproject_response.rb" + autoload :CreateWebhookResponseBody, "moderation_api/models/operations/createwebhook_responsebody.rb" + autoload :CreateWebhookEventTypeRequest, "moderation_api/models/operations/createwebhook_eventtype_request.rb" + autoload :CreateWebhookEventTypeResponse, "moderation_api/models/operations/createwebhook_eventtype_response.rb" + autoload :CreateWebhookPayloadVersion, "moderation_api/models/operations/createwebhook_payloadversion.rb" + autoload :CreateWebhookRequest, "moderation_api/models/operations/createwebhook_request.rb" + autoload :CreateWebhookResponse, "moderation_api/models/operations/createwebhook_response.rb" + autoload :CurrentProject, "moderation_api/models/operations/current_project.rb" + autoload :DailyReviewCount, "moderation_api/models/operations/dailyreviewcount.rb" + autoload :DataAudio, "moderation_api/models/operations/data_audio.rb" + autoload :DataImage, "moderation_api/models/operations/data_image.rb" + autoload :DataText, "moderation_api/models/operations/data_text.rb" + autoload :DataVideo, "moderation_api/models/operations/data_video.rb" + autoload :DeleteActionResponseBody, "moderation_api/models/operations/deleteaction_responsebody.rb" + autoload :DeleteActionRequest, "moderation_api/models/operations/deleteaction_request.rb" + autoload :DeleteActionResponse, "moderation_api/models/operations/deleteaction_response.rb" + autoload :DeleteAuthorResponseBody, "moderation_api/models/operations/deleteauthor_responsebody.rb" + autoload :DeleteAuthorRequest, "moderation_api/models/operations/deleteauthor_request.rb" + autoload :DeleteAuthorResponse, "moderation_api/models/operations/deleteauthor_response.rb" + autoload :DeleteChannelResponseBody, "moderation_api/models/operations/deletechannel_responsebody.rb" + autoload :DeleteChannelRequest, "moderation_api/models/operations/deletechannel_request.rb" + autoload :DeleteChannelResponse, "moderation_api/models/operations/deletechannel_response.rb" + autoload :DeleteProjectResponseBody, "moderation_api/models/operations/deleteproject_responsebody.rb" + autoload :DeleteProjectRequest, "moderation_api/models/operations/deleteproject_request.rb" + autoload :DeleteProjectResponse, "moderation_api/models/operations/deleteproject_response.rb" + autoload :DeleteWebhookResponseBody, "moderation_api/models/operations/deletewebhook_responsebody.rb" + autoload :DeleteWebhookRequest, "moderation_api/models/operations/deletewebhook_request.rb" + autoload :DeleteWebhookResponse, "moderation_api/models/operations/deletewebhook_response.rb" + autoload :DuplicateChannelRequestBody, "moderation_api/models/operations/duplicatechannel_requestbody.rb" + autoload :DuplicateChannelRequest, "moderation_api/models/operations/duplicatechannel_request.rb" + autoload :DuplicateChannelResponse, "moderation_api/models/operations/duplicatechannel_response.rb" + autoload :DuplicateProjectRequestBody, "moderation_api/models/operations/duplicateproject_requestbody.rb" + autoload :DuplicateProjectRequest, "moderation_api/models/operations/duplicateproject_request.rb" + autoload :DuplicateProjectResponse, "moderation_api/models/operations/duplicateproject_response.rb" + autoload :Entities1, "moderation_api/models/operations/entities_1.rb" + autoload :Entities2, "moderation_api/models/operations/entities_2.rb" + autoload :Error, "moderation_api/models/operations/error.rb" + autoload :Evaluation, "moderation_api/models/operations/evaluation.rb" + autoload :ExecuteActionResponseBody, "moderation_api/models/operations/executeaction_responsebody.rb" + autoload :ExecuteActionRequest, "moderation_api/models/operations/executeaction_request.rb" + autoload :ExecuteActionResponse, "moderation_api/models/operations/executeaction_response.rb" + autoload :Filter, "moderation_api/models/operations/filter.rb" + autoload :FilterLabel, "moderation_api/models/operations/filterlabel.rb" + autoload :FlaggedContentTrend, "moderation_api/models/operations/flaggedcontenttrend.rb" + autoload :FlaggingMode, "moderation_api/models/operations/flaggingmode.rb" + autoload :GetAccountResponseBody, "moderation_api/models/operations/getaccount_responsebody.rb" + autoload :GetAccountResponse, "moderation_api/models/operations/getaccount_response.rb" + autoload :GetActionResponseBody, "moderation_api/models/operations/getaction_responsebody.rb" + autoload :GetActionPosition, "moderation_api/models/operations/getaction_position.rb" + autoload :GetActionPossibleValue, "moderation_api/models/operations/getaction_possiblevalue.rb" + autoload :GetActionQueueBehaviour, "moderation_api/models/operations/getaction_queuebehaviour.rb" + autoload :GetActionRequest, "moderation_api/models/operations/getaction_request.rb" + autoload :GetActionResponse, "moderation_api/models/operations/getaction_response.rb" + autoload :GetActionType, "moderation_api/models/operations/getaction_type.rb" + autoload :GetAuthorRequest, "moderation_api/models/operations/getauthor_request.rb" + autoload :GetAuthorResponse, "moderation_api/models/operations/getauthor_response.rb" + autoload :GetChannelRequest, "moderation_api/models/operations/getchannel_request.rb" + autoload :GetChannelResponse, "moderation_api/models/operations/getchannel_response.rb" + autoload :GetProjectRequest, "moderation_api/models/operations/getproject_request.rb" + autoload :GetProjectResponse, "moderation_api/models/operations/getproject_response.rb" + autoload :GetQueueStatsResponseBody, "moderation_api/models/operations/getqueuestats_responsebody.rb" + autoload :GetQueueStatsRequest, "moderation_api/models/operations/getqueuestats_request.rb" + autoload :GetQueueStatsResponse, "moderation_api/models/operations/getqueuestats_response.rb" + autoload :GetQueueResponseBody, "moderation_api/models/operations/getqueue_responsebody.rb" + autoload :GetQueueContentType, "moderation_api/models/operations/getqueue_contenttype.rb" + autoload :GetQueueRecommendationAction, "moderation_api/models/operations/getqueue_recommendationaction.rb" + autoload :GetQueueRequest, "moderation_api/models/operations/getqueue_request.rb" + autoload :GetQueueResponse, "moderation_api/models/operations/getqueue_response.rb" + autoload :GetQueueType, "moderation_api/models/operations/getqueue_type.rb" + autoload :GetWebhookSecretResponseBody, "moderation_api/models/operations/getwebhooksecret_responsebody.rb" + autoload :GetWebhookSecretResponse, "moderation_api/models/operations/getwebhooksecret_response.rb" + autoload :GetWebhookResponseBody, "moderation_api/models/operations/getwebhook_responsebody.rb" + autoload :GetWebhookEventType, "moderation_api/models/operations/getwebhook_eventtype.rb" + autoload :GetWebhookPayloadVersion, "moderation_api/models/operations/getwebhook_payloadversion.rb" + autoload :GetWebhookRequest, "moderation_api/models/operations/getwebhook_request.rb" + autoload :GetWebhookResponse, "moderation_api/models/operations/getwebhook_response.rb" + autoload( + :GetWordlistEmbeddingStatusResponseBody, + "moderation_api/models/operations/getwordlistembeddingstatus_responsebody.rb" + ) + autoload( + :GetWordlistEmbeddingStatusRequest, + "moderation_api/models/operations/getwordlistembeddingstatus_request.rb" + ) + autoload( + :GetWordlistEmbeddingStatusResponse, + "moderation_api/models/operations/getwordlistembeddingstatus_response.rb" + ) + autoload :GetWordlistResponseBody, "moderation_api/models/operations/getwordlist_responsebody.rb" + autoload :GetWordlistRequest, "moderation_api/models/operations/getwordlist_request.rb" + autoload :GetWordlistResponse, "moderation_api/models/operations/getwordlist_response.rb" + autoload :GlobalFlaggingMode, "moderation_api/models/operations/globalflaggingmode.rb" + autoload :Insight, "moderation_api/models/operations/insight.rb" + autoload :IsFlagged, "moderation_api/models/operations/isflagged.rb" + autoload :ListActionsResponseBody, "moderation_api/models/operations/listactions_responsebody.rb" + autoload :ListActionsData, "moderation_api/models/operations/listactions_data.rb" + autoload :ListActionsPosition, "moderation_api/models/operations/listactions_position.rb" + autoload :ListActionsPossibleValue, "moderation_api/models/operations/listactions_possiblevalue.rb" + autoload :ListActionsQueueBehaviour, "moderation_api/models/operations/listactions_queuebehaviour.rb" + autoload :ListActionsRequest, "moderation_api/models/operations/listactions_request.rb" + autoload :ListActionsResponse, "moderation_api/models/operations/listactions_response.rb" + autoload :ListActionsType, "moderation_api/models/operations/listactions_type.rb" + autoload :ListAuthorsResponseBody, "moderation_api/models/operations/listauthors_responsebody.rb" + autoload :ListAuthorsRequest, "moderation_api/models/operations/listauthors_request.rb" + autoload :ListAuthorsResponse, "moderation_api/models/operations/listauthors_response.rb" + autoload :ListAuthorsSortDirection, "moderation_api/models/operations/listauthors_sortdirection.rb" + autoload :ListChannelsResponseBody, "moderation_api/models/operations/listchannels_responsebody.rb" + autoload :ListChannelsRequest, "moderation_api/models/operations/listchannels_request.rb" + autoload :ListChannelsResponse, "moderation_api/models/operations/listchannels_response.rb" + autoload :ListProjectsResponseBody, "moderation_api/models/operations/listprojects_responsebody.rb" + autoload :ListProjectsRequest, "moderation_api/models/operations/listprojects_request.rb" + autoload :ListProjectsResponse, "moderation_api/models/operations/listprojects_response.rb" + autoload :ListQueueItemsResponseBody, "moderation_api/models/operations/listqueueitems_responsebody.rb" + autoload :ListQueueItemsAction, "moderation_api/models/operations/listqueueitems_action.rb" + autoload :ListQueueItemsData, "moderation_api/models/operations/listqueueitems_data.rb" + autoload :ListQueueItemsLabel, "moderation_api/models/operations/listqueueitems_label.rb" + autoload :ListQueueItemsRequest, "moderation_api/models/operations/listqueueitems_request.rb" + autoload :ListQueueItemsResponse, "moderation_api/models/operations/listqueueitems_response.rb" + autoload :ListQueueItemsSortDirection, "moderation_api/models/operations/listqueueitems_sortdirection.rb" + autoload :ListQueueItemsStatus, "moderation_api/models/operations/listqueueitems_status.rb" + autoload :ListWebhooksResponseBody, "moderation_api/models/operations/listwebhooks_responsebody.rb" + autoload :ListWebhooksData, "moderation_api/models/operations/listwebhooks_data.rb" + autoload :ListWebhooksEventType, "moderation_api/models/operations/listwebhooks_eventtype.rb" + autoload :ListWebhooksPayloadVersion, "moderation_api/models/operations/listwebhooks_payloadversion.rb" + autoload :ListWebhooksRequest, "moderation_api/models/operations/listwebhooks_request.rb" + autoload :ListWebhooksResponse, "moderation_api/models/operations/listwebhooks_response.rb" + autoload :ListWordlistsResponseBody, "moderation_api/models/operations/listwordlists_responsebody.rb" + autoload :ListWordlistsData, "moderation_api/models/operations/listwordlists_data.rb" + autoload :ListWordlistsRequest, "moderation_api/models/operations/listwordlists_request.rb" + autoload :ListWordlistsResponse, "moderation_api/models/operations/listwordlists_response.rb" + autoload :Match, "moderation_api/models/operations/match.rb" + autoload :MatchedRule, "moderation_api/models/operations/matched_rule.rb" + autoload :MediaType, "moderation_api/models/operations/mediatype.rb" + autoload :Meta, "moderation_api/models/operations/meta.rb" + autoload :MetaType, "moderation_api/models/operations/metatype.rb" + autoload :MetaStatus, "moderation_api/models/operations/meta_status.rb" + autoload :MetadataFilter, "moderation_api/models/operations/metadatafilter.rb" + autoload :Method, "moderation_api/models/operations/method.rb" + autoload :Modified, "moderation_api/models/operations/modified.rb" + autoload :PolicyRequest, "moderation_api/models/operations/policy_request.rb" + autoload :PolicyResponse, "moderation_api/models/operations/policy_response.rb" + autoload :Queue, "moderation_api/models/operations/queue.rb" + autoload :ReasonCode, "moderation_api/models/operations/reason_code.rb" + autoload :ReasonCodeEnum, "moderation_api/models/operations/reason_code_enum.rb" + autoload :Recommendation, "moderation_api/models/operations/recommendation.rb" + autoload :RemoveWordlistWordsResponseBody, "moderation_api/models/operations/removewordlistwords_responsebody.rb" + autoload :RemoveWordlistWordsRequest, "moderation_api/models/operations/removewordlistwords_request.rb" + autoload :RemoveWordlistWordsResponse, "moderation_api/models/operations/removewordlistwords_response.rb" + autoload :ResolveQueueItemRequestBody, "moderation_api/models/operations/resolvequeueitem_requestbody.rb" + autoload :ResolveQueueItemResponseBody, "moderation_api/models/operations/resolvequeueitem_responsebody.rb" + autoload :ResolveQueueItemRequest, "moderation_api/models/operations/resolvequeueitem_request.rb" + autoload :ResolveQueueItemResponse, "moderation_api/models/operations/resolvequeueitem_response.rb" + autoload :ReviewStats, "moderation_api/models/operations/reviewstats.rb" + autoload :Scores, "moderation_api/models/operations/scores.rb" + autoload :SignalsRequest, "moderation_api/models/operations/signals_request.rb" + autoload :SignalsResponse, "moderation_api/models/operations/signals_response.rb" + autoload :SortBy, "moderation_api/models/operations/sortby.rb" + autoload :SortField, "moderation_api/models/operations/sortfield.rb" + autoload :SubmitContentResponseBody, "moderation_api/models/operations/submitcontent_responsebody.rb" + autoload :SubmitContentLabel, "moderation_api/models/operations/submitcontent_label.rb" + autoload( + :SubmitContentRecommendationAction, + "moderation_api/models/operations/submitcontent_recommendation_action.rb" + ) + autoload :SubmitContentRequest, "moderation_api/models/operations/submitcontent_request.rb" + autoload :SubmitContentResponse, "moderation_api/models/operations/submitcontent_response.rb" + autoload :TopAction, "moderation_api/models/operations/topaction.rb" + autoload :TopReviewer, "moderation_api/models/operations/topreviewer.rb" + autoload :Topic, "moderation_api/models/operations/topic.rb" + autoload :TranscriptionQuality, "moderation_api/models/operations/transcriptionquality.rb" + autoload :Trends, "moderation_api/models/operations/trends.rb" + autoload :TrustLevel, "moderation_api/models/operations/trust_level.rb" + autoload :UnresolveQueueItemRequestBody, "moderation_api/models/operations/unresolvequeueitem_requestbody.rb" + autoload :UnresolveQueueItemResponseBody, "moderation_api/models/operations/unresolvequeueitem_responsebody.rb" + autoload :UnresolveQueueItemRequest, "moderation_api/models/operations/unresolvequeueitem_request.rb" + autoload :UnresolveQueueItemResponse, "moderation_api/models/operations/unresolvequeueitem_response.rb" + autoload :UpdateActionRequestBody, "moderation_api/models/operations/updateaction_requestbody.rb" + autoload :UpdateActionResponseBody, "moderation_api/models/operations/updateaction_responsebody.rb" + autoload :UpdateActionPositionRequest, "moderation_api/models/operations/updateaction_position_request.rb" + autoload :UpdateActionPositionResponse, "moderation_api/models/operations/updateaction_position_response.rb" + autoload( + :UpdateActionPossibleValueRequest, + "moderation_api/models/operations/updateaction_possiblevalue_request.rb" + ) + autoload( + :UpdateActionPossibleValueResponse, + "moderation_api/models/operations/updateaction_possiblevalue_response.rb" + ) + autoload( + :UpdateActionQueueBehaviourRequest, + "moderation_api/models/operations/updateaction_queuebehaviour_request.rb" + ) + autoload( + :UpdateActionQueueBehaviourResponse, + "moderation_api/models/operations/updateaction_queuebehaviour_response.rb" + ) + autoload :UpdateActionRequest, "moderation_api/models/operations/updateaction_request.rb" + autoload :UpdateActionResponse, "moderation_api/models/operations/updateaction_response.rb" + autoload :UpdateActionTypeRequest, "moderation_api/models/operations/updateaction_type_request.rb" + autoload :UpdateActionTypeResponse, "moderation_api/models/operations/updateaction_type_response.rb" + autoload :UpdateAuthorRequestBody, "moderation_api/models/operations/updateauthor_requestbody.rb" + autoload :UpdateAuthorMetadata, "moderation_api/models/operations/updateauthor_metadata.rb" + autoload :UpdateAuthorRequest, "moderation_api/models/operations/updateauthor_request.rb" + autoload :UpdateAuthorResponse, "moderation_api/models/operations/updateauthor_response.rb" + autoload :UpdateChannelRequestBody, "moderation_api/models/operations/updatechannel_requestbody.rb" + autoload :UpdateChannelContentType, "moderation_api/models/operations/updatechannel_contenttype.rb" + autoload :UpdateChannelRequest, "moderation_api/models/operations/updatechannel_request.rb" + autoload :UpdateChannelResponse, "moderation_api/models/operations/updatechannel_response.rb" + autoload :UpdateProjectRequestBody, "moderation_api/models/operations/updateproject_requestbody.rb" + autoload :UpdateProjectRequest, "moderation_api/models/operations/updateproject_request.rb" + autoload :UpdateProjectResponse, "moderation_api/models/operations/updateproject_response.rb" + autoload :UpdateWebhookRequestBody, "moderation_api/models/operations/updatewebhook_requestbody.rb" + autoload :UpdateWebhookResponseBody, "moderation_api/models/operations/updatewebhook_responsebody.rb" + autoload :UpdateWebhookEventTypeRequest, "moderation_api/models/operations/updatewebhook_eventtype_request.rb" + autoload :UpdateWebhookEventTypeResponse, "moderation_api/models/operations/updatewebhook_eventtype_response.rb" + autoload :UpdateWebhookPayloadVersion, "moderation_api/models/operations/updatewebhook_payloadversion.rb" + autoload :UpdateWebhookRequest, "moderation_api/models/operations/updatewebhook_request.rb" + autoload :UpdateWebhookResponse, "moderation_api/models/operations/updatewebhook_response.rb" + autoload :UpdateWordlistRequestBody, "moderation_api/models/operations/updatewordlist_requestbody.rb" + autoload :UpdateWordlistResponseBody, "moderation_api/models/operations/updatewordlist_responsebody.rb" + autoload :UpdateWordlistRequest, "moderation_api/models/operations/updatewordlist_request.rb" + autoload :UpdateWordlistResponse, "moderation_api/models/operations/updatewordlist_response.rb" + autoload :Value, "moderation_api/models/operations/value.rb" + autoload :Verdict, "moderation_api/models/operations/verdict.rb" + autoload :WithinUnit, "moderation_api/models/operations/withinunit.rb" + end + end +end diff --git a/lib/moderation_api/models/operations/action_request.rb b/lib/moderation_api/models/operations/action_request.rb new file mode 100644 index 00000000..d09bbcb0 --- /dev/null +++ b/lib/moderation_api/models/operations/action_request.rb @@ -0,0 +1,19 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + # ActionRequest - Your recommendation for the content: allow, review, or reject. + class ActionRequest < T::Enum + enums do + REVIEW = new("review") + ALLOW = new("allow") + REJECT = new("reject") + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/action_request.rbi b/lib/moderation_api/models/operations/action_request.rbi new file mode 100644 index 00000000..7ea9af25 --- /dev/null +++ b/lib/moderation_api/models/operations/action_request.rbi @@ -0,0 +1,9 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::ActionRequest + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::ActionRequest +end diff --git a/lib/moderation_api/models/operations/actionstat.rb b/lib/moderation_api/models/operations/actionstat.rb new file mode 100644 index 00000000..686a3700 --- /dev/null +++ b/lib/moderation_api/models/operations/actionstat.rb @@ -0,0 +1,59 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class ActionStat + extend T::Sig + include Crystalline::MetadataFields + + # ID of the moderation action + field( + :action_id, + ::String, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("actionId"), required: true}} + ) + # Name of the moderation action + field( + :action_name, + ::String, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("actionName"), required: true}} + ) + # Number of times this action was taken + field( + :count, + ::Float, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("count"), required: true}} + ) + # Percentage this action represents of all actions + field( + :percentage_of_total, + ::Float, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("percentageOfTotal"), required: true}} + ) + + sig { params(action_id: ::String, action_name: ::String, count: ::Float, percentage_of_total: ::Float).void } + def initialize(action_id:, action_name:, count:, percentage_of_total:) + @action_id = action_id + @action_name = action_name + @count = count + @percentage_of_total = percentage_of_total + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @action_id == other.action_id + return false unless @action_name == other.action_name + return false unless @count == other.count + return false unless @percentage_of_total == other.percentage_of_total + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/actionstat.rbi b/lib/moderation_api/models/operations/actionstat.rbi new file mode 100644 index 00000000..a5714a5b --- /dev/null +++ b/lib/moderation_api/models/operations/actionstat.rbi @@ -0,0 +1,32 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::ActionStat + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::ActionStat + def action_id + end + + def action_id=(str_) + end + + def action_name + end + + def action_name=(str_) + end + + def count + end + + def count=(str_) + end + + def percentage_of_total + end + + def percentage_of_total=(str_) + end +end diff --git a/lib/moderation_api/models/operations/addwordlistwords_request.rb b/lib/moderation_api/models/operations/addwordlistwords_request.rb new file mode 100644 index 00000000..a8a3bf98 --- /dev/null +++ b/lib/moderation_api/models/operations/addwordlistwords_request.rb @@ -0,0 +1,35 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class AddWordlistWordsRequest + extend T::Sig + include Crystalline::MetadataFields + + # ID of the wordlist to add words to + field :id, ::String, {'path_param': {'field_name': "id", 'style': "simple", 'explode': false}} + + field :body, Models::Operations::AddWordlistWordsRequestBody, {'request': {'media_type': "application/json"}} + + sig { params(id: ::String, body: Models::Operations::AddWordlistWordsRequestBody).void } + def initialize(id:, body:) + @id = id + @body = body + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @id == other.id + return false unless @body == other.body + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/addwordlistwords_request.rbi b/lib/moderation_api/models/operations/addwordlistwords_request.rbi new file mode 100644 index 00000000..5c4585ed --- /dev/null +++ b/lib/moderation_api/models/operations/addwordlistwords_request.rbi @@ -0,0 +1,20 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::AddWordlistWordsRequest + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::AddWordlistWordsRequest + def id + end + + def id=(str_) + end + + def body + end + + def body=(str_) + end +end diff --git a/lib/moderation_api/models/operations/addwordlistwords_requestbody.rb b/lib/moderation_api/models/operations/addwordlistwords_requestbody.rb new file mode 100644 index 00000000..fd944904 --- /dev/null +++ b/lib/moderation_api/models/operations/addwordlistwords_requestbody.rb @@ -0,0 +1,35 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class AddWordlistWordsRequestBody + extend T::Sig + include Crystalline::MetadataFields + + # Array of words to add to the wordlist. Duplicate words will be ignored. + field( + :words, + Crystalline::Array.new(::String), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("words"), required: true}} + ) + + sig { params(words: T::Array[::String]).void } + def initialize(words:) + @words = words + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @words == other.words + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/addwordlistwords_requestbody.rbi b/lib/moderation_api/models/operations/addwordlistwords_requestbody.rbi new file mode 100644 index 00000000..b913b8d8 --- /dev/null +++ b/lib/moderation_api/models/operations/addwordlistwords_requestbody.rbi @@ -0,0 +1,14 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::AddWordlistWordsRequestBody + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::AddWordlistWordsRequestBody + def words + end + + def words=(str_) + end +end diff --git a/lib/moderation_api/models/operations/addwordlistwords_response.rb b/lib/moderation_api/models/operations/addwordlistwords_response.rb new file mode 100644 index 00000000..5db5a0c2 --- /dev/null +++ b/lib/moderation_api/models/operations/addwordlistwords_response.rb @@ -0,0 +1,51 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class AddWordlistWordsResponse + extend T::Sig + include Crystalline::MetadataFields + + # HTTP response content type for this operation + field :content_type, ::String + # HTTP response status code for this operation + field :status_code, ::Integer + # Raw HTTP response; suitable for custom response parsing + field :raw_response, ::Faraday::Response + # Words successfully added to wordlist + field :object, Crystalline::Nilable.new(Models::Operations::AddWordlistWordsResponseBody) + + sig { + params( + content_type: ::String, + status_code: ::Integer, + raw_response: ::Faraday::Response, + object: T.nilable(Models::Operations::AddWordlistWordsResponseBody) + ) + .void + } + def initialize(content_type:, status_code:, raw_response:, object: nil) + @content_type = content_type + @status_code = status_code + @raw_response = raw_response + @object = object + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @content_type == other.content_type + return false unless @status_code == other.status_code + return false unless @raw_response == other.raw_response + return false unless @object == other.object + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/addwordlistwords_response.rbi b/lib/moderation_api/models/operations/addwordlistwords_response.rbi new file mode 100644 index 00000000..640eadd1 --- /dev/null +++ b/lib/moderation_api/models/operations/addwordlistwords_response.rbi @@ -0,0 +1,32 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::AddWordlistWordsResponse + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::AddWordlistWordsResponse + def content_type + end + + def content_type=(str_) + end + + def status_code + end + + def status_code=(str_) + end + + def raw_response + end + + def raw_response=(str_) + end + + def object + end + + def object=(str_) + end +end diff --git a/lib/moderation_api/models/operations/addwordlistwords_responsebody.rb b/lib/moderation_api/models/operations/addwordlistwords_responsebody.rb new file mode 100644 index 00000000..a0db0516 --- /dev/null +++ b/lib/moderation_api/models/operations/addwordlistwords_responsebody.rb @@ -0,0 +1,51 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + # Words successfully added to wordlist + class AddWordlistWordsResponseBody + extend T::Sig + include Crystalline::MetadataFields + + # Number of words added + field( + :added_count, + ::Float, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("addedCount"), required: true}} + ) + # Total number of words in wordlist + field( + :total_count, + ::Float, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("totalCount"), required: true}} + ) + # List of words that were added + field( + :added_words, + Crystalline::Array.new(::String), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("addedWords"), required: true}} + ) + + sig { params(added_count: ::Float, total_count: ::Float, added_words: T::Array[::String]).void } + def initialize(added_count:, total_count:, added_words:) + @added_count = added_count + @total_count = total_count + @added_words = added_words + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @added_count == other.added_count + return false unless @total_count == other.total_count + return false unless @added_words == other.added_words + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/addwordlistwords_responsebody.rbi b/lib/moderation_api/models/operations/addwordlistwords_responsebody.rbi new file mode 100644 index 00000000..8ee51f6f --- /dev/null +++ b/lib/moderation_api/models/operations/addwordlistwords_responsebody.rbi @@ -0,0 +1,26 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::AddWordlistWordsResponseBody + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::AddWordlistWordsResponseBody + def added_count + end + + def added_count=(str_) + end + + def total_count + end + + def total_count=(str_) + end + + def added_words + end + + def added_words=(str_) + end +end diff --git a/lib/moderation_api/models/operations/adult.rb b/lib/moderation_api/models/operations/adult.rb new file mode 100644 index 00000000..4b028be2 --- /dev/null +++ b/lib/moderation_api/models/operations/adult.rb @@ -0,0 +1,50 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class Adult + extend T::Sig + include Crystalline::MetadataFields + + field( + :flag, + Crystalline::Boolean.new, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("flag"), required: true}} + ) + + field( + :threshold, + Crystalline::Nilable.new(::Float), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("threshold")}} + ) + + field :id, ::String, {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("id"), required: true}} + + sig { params(flag: T::Boolean, threshold: T.nilable(::Float), id: ::String).void } + def initialize(flag:, threshold: nil, id: "adult") + @flag = flag + @threshold = threshold + unless id == "adult" + raise ArgumentError, "Invalid value for id" + end + + @id = "adult" + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @flag == other.flag + return false unless @threshold == other.threshold + return false unless @id == other.id + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/adult.rbi b/lib/moderation_api/models/operations/adult.rbi new file mode 100644 index 00000000..030b7eb1 --- /dev/null +++ b/lib/moderation_api/models/operations/adult.rbi @@ -0,0 +1,26 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::Adult + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::Adult + def flag + end + + def flag=(str_) + end + + def threshold + end + + def threshold=(str_) + end + + def id + end + + def id=(str_) + end +end diff --git a/lib/moderation_api/models/operations/alcohol.rb b/lib/moderation_api/models/operations/alcohol.rb new file mode 100644 index 00000000..7ada7361 --- /dev/null +++ b/lib/moderation_api/models/operations/alcohol.rb @@ -0,0 +1,50 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class Alcohol + extend T::Sig + include Crystalline::MetadataFields + + field( + :flag, + Crystalline::Boolean.new, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("flag"), required: true}} + ) + + field( + :threshold, + Crystalline::Nilable.new(::Float), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("threshold")}} + ) + + field :id, ::String, {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("id"), required: true}} + + sig { params(flag: T::Boolean, threshold: T.nilable(::Float), id: ::String).void } + def initialize(flag:, threshold: nil, id: "alcohol") + @flag = flag + @threshold = threshold + unless id == "alcohol" + raise ArgumentError, "Invalid value for id" + end + + @id = "alcohol" + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @flag == other.flag + return false unless @threshold == other.threshold + return false unless @id == other.id + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/alcohol.rbi b/lib/moderation_api/models/operations/alcohol.rbi new file mode 100644 index 00000000..18c0302f --- /dev/null +++ b/lib/moderation_api/models/operations/alcohol.rbi @@ -0,0 +1,26 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::Alcohol + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::Alcohol + def flag + end + + def flag=(str_) + end + + def threshold + end + + def threshold=(str_) + end + + def id + end + + def id=(str_) + end +end diff --git a/lib/moderation_api/models/operations/audio_request.rb b/lib/moderation_api/models/operations/audio_request.rb new file mode 100644 index 00000000..62f235a7 --- /dev/null +++ b/lib/moderation_api/models/operations/audio_request.rb @@ -0,0 +1,43 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + # Audio + class AudioRequest + extend T::Sig + include Crystalline::MetadataFields + + # The URL of the audio content + field :url, ::String, {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("url"), required: true}} + + field( + :type, + ::String, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("type"), required: true}} + ) + + sig { params(url: ::String, type: ::String).void } + def initialize(url:, type: "audio") + @url = url + unless type == "audio" + raise ArgumentError, "Invalid value for type" + end + + @type = "audio" + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @url == other.url + return false unless @type == other.type + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/audio_request.rbi b/lib/moderation_api/models/operations/audio_request.rbi new file mode 100644 index 00000000..66fb50cc --- /dev/null +++ b/lib/moderation_api/models/operations/audio_request.rbi @@ -0,0 +1,20 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::AudioRequest + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::AudioRequest + def url + end + + def url=(str_) + end + + def type + end + + def type=(str_) + end +end diff --git a/lib/moderation_api/models/operations/audio_response.rb b/lib/moderation_api/models/operations/audio_response.rb new file mode 100644 index 00000000..1bd3bb4f --- /dev/null +++ b/lib/moderation_api/models/operations/audio_response.rb @@ -0,0 +1,43 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + # Audio + class AudioResponse + extend T::Sig + include Crystalline::MetadataFields + + # The URL of the audio content + field :url, ::String, {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("url"), required: true}} + + field( + :type, + ::String, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("type"), required: true}} + ) + + sig { params(url: ::String, type: ::String).void } + def initialize(url:, type: "audio") + @url = url + unless type == "audio" + raise ArgumentError, "Invalid value for type" + end + + @type = "audio" + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @url == other.url + return false unless @type == other.type + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/audio_response.rbi b/lib/moderation_api/models/operations/audio_response.rbi new file mode 100644 index 00000000..bf46b003 --- /dev/null +++ b/lib/moderation_api/models/operations/audio_response.rbi @@ -0,0 +1,20 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::AudioResponse + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::AudioResponse + def url + end + + def url=(str_) + end + + def type + end + + def type=(str_) + end +end diff --git a/lib/moderation_api/models/operations/author.rb b/lib/moderation_api/models/operations/author.rb new file mode 100644 index 00000000..7c1afef8 --- /dev/null +++ b/lib/moderation_api/models/operations/author.rb @@ -0,0 +1,78 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class Author + extend T::Sig + include Crystalline::MetadataFields + + # Author ID in Moderation API + field :id, ::String, {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("id"), required: true}} + # Current author status + field( + :status, + Models::Operations::AuthorStatus, + { + 'format_json': { + 'letter_case': ::ModerationApi::Utils.field_name("status"), + required: true, + 'decoder': ::ModerationApi::Utils.open_enum_from_string(Models::Operations::AuthorStatus, false) + } + } + ) + + field( + :trust_level, + Models::Operations::TrustLevel, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("trust_level"), required: true}} + ) + # Block or suspension details, if applicable. Null if the author is enabled. + field( + :block, + Crystalline::Nilable.new(Models::Operations::Block), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("block"), required: true}} + ) + # The author's ID from your system + field( + :external_id, + Crystalline::Nilable.new(::String), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("external_id")}} + ) + + sig { + params( + id: ::String, + status: Models::Operations::AuthorStatus, + trust_level: Models::Operations::TrustLevel, + block: T.nilable(Models::Operations::Block), + external_id: T.nilable(::String) + ) + .void + } + def initialize(id:, status:, trust_level:, block: nil, external_id: nil) + @id = id + @status = status + @trust_level = trust_level + @block = block + @external_id = external_id + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @id == other.id + return false unless @status == other.status + return false unless @trust_level == other.trust_level + return false unless @block == other.block + return false unless @external_id == other.external_id + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/author.rbi b/lib/moderation_api/models/operations/author.rbi new file mode 100644 index 00000000..6879cb80 --- /dev/null +++ b/lib/moderation_api/models/operations/author.rbi @@ -0,0 +1,38 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::Author + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::Author + def id + end + + def id=(str_) + end + + def status + end + + def status=(str_) + end + + def trust_level + end + + def trust_level=(str_) + end + + def block + end + + def block=(str_) + end + + def external_id + end + + def external_id=(str_) + end +end diff --git a/lib/moderation_api/models/operations/author_status.rb b/lib/moderation_api/models/operations/author_status.rb new file mode 100644 index 00000000..232bb070 --- /dev/null +++ b/lib/moderation_api/models/operations/author_status.rb @@ -0,0 +1,22 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + # AuthorStatus - Current author status + class AuthorStatus + include ::Crystalline::Enum + enums do + ENABLED = new("enabled") + SUSPENDED = new("suspended") + BLOCKED = new("blocked") + end + + open! + end + end + end +end diff --git a/lib/moderation_api/models/operations/author_status.rbi b/lib/moderation_api/models/operations/author_status.rbi new file mode 100644 index 00000000..3e38c04f --- /dev/null +++ b/lib/moderation_api/models/operations/author_status.rbi @@ -0,0 +1,9 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::AuthorStatus + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::AuthorStatus +end diff --git a/lib/moderation_api/models/operations/behavior.rb b/lib/moderation_api/models/operations/behavior.rb new file mode 100644 index 00000000..6764a55d --- /dev/null +++ b/lib/moderation_api/models/operations/behavior.rb @@ -0,0 +1,18 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + # Behavior - How your recommendation combines with ours. Defaults to 'escalate', which only applies it when stricter than ours; 'override' replaces ours outright. + class Behavior < T::Enum + enums do + OVERRIDE = new("override") + ESCALATE = new("escalate") + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/behavior.rbi b/lib/moderation_api/models/operations/behavior.rbi new file mode 100644 index 00000000..9988848c --- /dev/null +++ b/lib/moderation_api/models/operations/behavior.rbi @@ -0,0 +1,9 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::Behavior + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::Behavior +end diff --git a/lib/moderation_api/models/operations/block.rb b/lib/moderation_api/models/operations/block.rb new file mode 100644 index 00000000..4b9dcff9 --- /dev/null +++ b/lib/moderation_api/models/operations/block.rb @@ -0,0 +1,43 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class Block + extend T::Sig + include Crystalline::MetadataFields + + # The timestamp until which they are blocked if the author is suspended. + field( + :until_, + Crystalline::Nilable.new(::Float), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("until")}} + ) + # The moderators reason why the author was blocked or suspended. + field( + :reason, + Crystalline::Nilable.new(::String), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("reason")}} + ) + + sig { params(until_: T.nilable(::Float), reason: T.nilable(::String)).void } + def initialize(until_: nil, reason: nil) + @until_ = until_ + @reason = reason + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @until_ == other.until_ + return false unless @reason == other.reason + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/block.rbi b/lib/moderation_api/models/operations/block.rbi new file mode 100644 index 00000000..eb2feb95 --- /dev/null +++ b/lib/moderation_api/models/operations/block.rbi @@ -0,0 +1,20 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::Block + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::Block + def until_ + end + + def until_=(str_) + end + + def reason + end + + def reason=(str_) + end +end diff --git a/lib/moderation_api/models/operations/brand_impersonation.rb b/lib/moderation_api/models/operations/brand_impersonation.rb new file mode 100644 index 00000000..8065a4b4 --- /dev/null +++ b/lib/moderation_api/models/operations/brand_impersonation.rb @@ -0,0 +1,48 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class BrandImpersonation + extend T::Sig + include Crystalline::MetadataFields + + field( + :brand, + ::String, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("brand"), required: true}} + ) + + field( + :method, + Models::Operations::Method, + { + 'format_json': { + 'letter_case': ::ModerationApi::Utils.field_name("method"), + required: true, + 'decoder': ::ModerationApi::Utils.open_enum_from_string(Models::Operations::Method, false) + } + } + ) + + sig { params(brand: ::String, method: Models::Operations::Method).void } + def initialize(brand:, method:) + @brand = brand + @method = method + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @brand == other.brand + return false unless @method == other.method + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/brand_impersonation.rbi b/lib/moderation_api/models/operations/brand_impersonation.rbi new file mode 100644 index 00000000..bfa94143 --- /dev/null +++ b/lib/moderation_api/models/operations/brand_impersonation.rbi @@ -0,0 +1,20 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::BrandImpersonation + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::BrandImpersonation + def brand + end + + def brand=(str_) + end + + def method + end + + def method=(str_) + end +end diff --git a/lib/moderation_api/models/operations/cannabis.rb b/lib/moderation_api/models/operations/cannabis.rb new file mode 100644 index 00000000..7d857851 --- /dev/null +++ b/lib/moderation_api/models/operations/cannabis.rb @@ -0,0 +1,50 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class Cannabis + extend T::Sig + include Crystalline::MetadataFields + + field( + :flag, + Crystalline::Boolean.new, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("flag"), required: true}} + ) + + field( + :threshold, + Crystalline::Nilable.new(::Float), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("threshold")}} + ) + + field :id, ::String, {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("id"), required: true}} + + sig { params(flag: T::Boolean, threshold: T.nilable(::Float), id: ::String).void } + def initialize(flag:, threshold: nil, id: "cannabis") + @flag = flag + @threshold = threshold + unless id == "cannabis" + raise ArgumentError, "Invalid value for id" + end + + @id = "cannabis" + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @flag == other.flag + return false unless @threshold == other.threshold + return false unless @id == other.id + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/cannabis.rbi b/lib/moderation_api/models/operations/cannabis.rbi new file mode 100644 index 00000000..060843f3 --- /dev/null +++ b/lib/moderation_api/models/operations/cannabis.rbi @@ -0,0 +1,26 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::Cannabis + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::Cannabis + def flag + end + + def flag=(str_) + end + + def threshold + end + + def threshold=(str_) + end + + def id + end + + def id=(str_) + end +end diff --git a/lib/moderation_api/models/operations/casebook.rb b/lib/moderation_api/models/operations/casebook.rb new file mode 100644 index 00000000..8f03141a --- /dev/null +++ b/lib/moderation_api/models/operations/casebook.rb @@ -0,0 +1,91 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class Casebook + extend T::Sig + include Crystalline::MetadataFields + + # The ruling your past decisions point to for this content. + field( + :verdict, + Models::Operations::Verdict, + { + 'format_json': { + 'letter_case': ::ModerationApi::Utils.field_name("verdict"), + required: true, + 'decoder': ::ModerationApi::Utils.open_enum_from_string(Models::Operations::Verdict, false) + } + } + ) + # How close the nearest matching case is, from 0 to 1. 1 means the content is identical to something you have already decided. + field( + :similarity, + ::Float, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("similarity"), required: true}} + ) + # How unanimous the matching cases are, from 0 to 1: the share of them that decided this way, ignoring how many there are. Always at least 0.8 when a ruling is returned — below that the casebook reports a disagreement instead of picking a side — so it tells you how clean the consensus was, and is not a threshold to re-apply yourself. + field( + :agreement, + ::Float, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("agreement"), required: true}} + ) + # How strongly the casebook holds this ruling, from 0 to 1: the agreement scaled by how much evidence backs it, so a handful of close, recent cases outweighs one distant one. Older cases count for less, halving in weight roughly every 180 days. This is the number to use in rules when you want a strength condition. + field( + :confidence, + ::Float, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("confidence"), required: true}} + ) + # How many of your past cases backed this ruling. + field( + :case_count, + ::Float, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("case_count"), required: true}} + ) + # The topic the closest matching case is filed under, or null when it has not been grouped into one yet. + field( + :topic, + Crystalline::Nilable.new(Models::Operations::Topic), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("topic"), required: true}} + ) + + sig { + params( + verdict: Models::Operations::Verdict, + similarity: ::Float, + agreement: ::Float, + confidence: ::Float, + case_count: ::Float, + topic: T.nilable(Models::Operations::Topic) + ) + .void + } + def initialize(verdict:, similarity:, agreement:, confidence:, case_count:, topic: nil) + @verdict = verdict + @similarity = similarity + @agreement = agreement + @confidence = confidence + @case_count = case_count + @topic = topic + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @verdict == other.verdict + return false unless @similarity == other.similarity + return false unless @agreement == other.agreement + return false unless @confidence == other.confidence + return false unless @case_count == other.case_count + return false unless @topic == other.topic + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/casebook.rbi b/lib/moderation_api/models/operations/casebook.rbi new file mode 100644 index 00000000..e78f86d0 --- /dev/null +++ b/lib/moderation_api/models/operations/casebook.rbi @@ -0,0 +1,44 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::Casebook + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::Casebook + def verdict + end + + def verdict=(str_) + end + + def similarity + end + + def similarity=(str_) + end + + def agreement + end + + def agreement=(str_) + end + + def confidence + end + + def confidence=(str_) + end + + def case_count + end + + def case_count=(str_) + end + + def topic + end + + def topic=(str_) + end +end diff --git a/lib/moderation_api/models/operations/casebookagreement.rb b/lib/moderation_api/models/operations/casebookagreement.rb new file mode 100644 index 00000000..65d631a5 --- /dev/null +++ b/lib/moderation_api/models/operations/casebookagreement.rb @@ -0,0 +1,22 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class CasebookAgreement + include ::Crystalline::Enum + enums do + ALL = new("ALL") + OVERRULED = new("OVERRULED") + AGREED = new("AGREED") + end + + open! + end + end + end +end diff --git a/lib/moderation_api/models/operations/casebookagreement.rbi b/lib/moderation_api/models/operations/casebookagreement.rbi new file mode 100644 index 00000000..b8f55890 --- /dev/null +++ b/lib/moderation_api/models/operations/casebookagreement.rbi @@ -0,0 +1,9 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::CasebookAgreement + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::CasebookAgreement +end diff --git a/lib/moderation_api/models/operations/casebookanswer.rb b/lib/moderation_api/models/operations/casebookanswer.rb new file mode 100644 index 00000000..1466a606 --- /dev/null +++ b/lib/moderation_api/models/operations/casebookanswer.rb @@ -0,0 +1,23 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class CasebookAnswer + include ::Crystalline::Enum + enums do + ALL = new("ALL") + ALLOWED = new("ALLOWED") + REJECTED = new("REJECTED") + NO_ANSWER = new("NO_ANSWER") + end + + open! + end + end + end +end diff --git a/lib/moderation_api/models/operations/casebookanswer.rbi b/lib/moderation_api/models/operations/casebookanswer.rbi new file mode 100644 index 00000000..a095365c --- /dev/null +++ b/lib/moderation_api/models/operations/casebookanswer.rbi @@ -0,0 +1,9 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::CasebookAnswer + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::CasebookAnswer +end diff --git a/lib/moderation_api/models/operations/channel_circumvention.rb b/lib/moderation_api/models/operations/channel_circumvention.rb new file mode 100644 index 00000000..82f5491c --- /dev/null +++ b/lib/moderation_api/models/operations/channel_circumvention.rb @@ -0,0 +1,50 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class ChannelCircumvention + extend T::Sig + include Crystalline::MetadataFields + + field( + :flag, + Crystalline::Boolean.new, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("flag"), required: true}} + ) + + field( + :threshold, + Crystalline::Nilable.new(::Float), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("threshold")}} + ) + + field :id, ::String, {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("id"), required: true}} + + sig { params(flag: T::Boolean, threshold: T.nilable(::Float), id: ::String).void } + def initialize(flag:, threshold: nil, id: "channel_circumvent") + @flag = flag + @threshold = threshold + unless id == "channel_circumvent" + raise ArgumentError, "Invalid value for id" + end + + @id = "channel_circumvent" + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @flag == other.flag + return false unless @threshold == other.threshold + return false unless @id == other.id + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/channel_circumvention.rbi b/lib/moderation_api/models/operations/channel_circumvention.rbi new file mode 100644 index 00000000..72edd178 --- /dev/null +++ b/lib/moderation_api/models/operations/channel_circumvention.rbi @@ -0,0 +1,26 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::ChannelCircumvention + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::ChannelCircumvention + def flag + end + + def flag=(str_) + end + + def threshold + end + + def threshold=(str_) + end + + def id + end + + def id=(str_) + end +end diff --git a/lib/moderation_api/models/operations/checkstatus.rb b/lib/moderation_api/models/operations/checkstatus.rb new file mode 100644 index 00000000..2238ba00 --- /dev/null +++ b/lib/moderation_api/models/operations/checkstatus.rb @@ -0,0 +1,22 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class CheckStatus + include ::Crystalline::Enum + enums do + ALL = new("all") + CHECKED = new("checked") + UNCHECKED = new("unchecked") + end + + open! + end + end + end +end diff --git a/lib/moderation_api/models/operations/checkstatus.rbi b/lib/moderation_api/models/operations/checkstatus.rbi new file mode 100644 index 00000000..5bd82375 --- /dev/null +++ b/lib/moderation_api/models/operations/checkstatus.rbi @@ -0,0 +1,9 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::CheckStatus + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::CheckStatus +end diff --git a/lib/moderation_api/models/operations/classifier_output.rb b/lib/moderation_api/models/operations/classifier_output.rb new file mode 100644 index 00000000..c47e0406 --- /dev/null +++ b/lib/moderation_api/models/operations/classifier_output.rb @@ -0,0 +1,94 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + # Classifier policy. + class ClassifierOutput + extend T::Sig + include Crystalline::MetadataFields + + # The unique identifier for the classifier output. + field :id, ::String, {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("id"), required: true}} + + field( + :probability, + ::Float, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("probability"), required: true}} + ) + + field( + :flagged, + Crystalline::Boolean.new, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("flagged"), required: true}} + ) + + field( + :type, + ::String, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("type"), required: true}} + ) + # The keys of the flagged fields if submitting an object. + field( + :flagged_fields, + Crystalline::Nilable.new(Crystalline::Array.new(::String)), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("flagged_fields")}} + ) + + field( + :labels, + Crystalline::Nilable.new(Crystalline::Array.new(Models::Operations::SubmitContentLabel)), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("labels")}} + ) + # Optional structured data produced by the policy. For face detection: { count, faces: [{ confidence, gender, age }] }. + field( + :data, + Crystalline::Nilable.new(Crystalline::Hash.new(Symbol, ::Object)), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("data")}} + ) + + sig { + params( + id: ::String, + probability: ::Float, + flagged: T::Boolean, + type: ::String, + flagged_fields: T.nilable(T::Array[::String]), + labels: T.nilable(T::Array[Models::Operations::SubmitContentLabel]), + data: T.nilable(T::Hash[Symbol, ::Object]) + ) + .void + } + def initialize(id:, probability:, flagged:, type: "classifier", flagged_fields: nil, labels: nil, data: nil) + @id = id + @probability = probability + @flagged = flagged + unless type == "classifier" + raise ArgumentError, "Invalid value for type" + end + + @type = "classifier" + @flagged_fields = flagged_fields + @labels = labels + @data = data + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @id == other.id + return false unless @probability == other.probability + return false unless @flagged == other.flagged + return false unless @type == other.type + return false unless @flagged_fields == other.flagged_fields + return false unless @labels == other.labels + return false unless @data == other.data + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/classifier_output.rbi b/lib/moderation_api/models/operations/classifier_output.rbi new file mode 100644 index 00000000..24a0e2ad --- /dev/null +++ b/lib/moderation_api/models/operations/classifier_output.rbi @@ -0,0 +1,50 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::ClassifierOutput + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::ClassifierOutput + def id + end + + def id=(str_) + end + + def probability + end + + def probability=(str_) + end + + def flagged + end + + def flagged=(str_) + end + + def type + end + + def type=(str_) + end + + def flagged_fields + end + + def flagged_fields=(str_) + end + + def labels + end + + def labels=(str_) + end + + def data + end + + def data=(str_) + end +end diff --git a/lib/moderation_api/models/operations/clientaction.rb b/lib/moderation_api/models/operations/clientaction.rb new file mode 100644 index 00000000..927c8802 --- /dev/null +++ b/lib/moderation_api/models/operations/clientaction.rb @@ -0,0 +1,78 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + # A recommendation from your own client-side flagging (e.g. a banned-IP list or a third-party tool). Feeds the rules engine and can escalate or override the recommended action. Does not change whether our analysis flagged the content. + class ClientAction + extend T::Sig + include Crystalline::MetadataFields + + # Your recommendation for the content: allow, review, or reject. + field( + :action, + Models::Operations::ActionRequest, + { + 'format_json': { + 'letter_case': ::ModerationApi::Utils.field_name("action"), + required: true, + 'decoder': ::ModerationApi::Utils.enum_from_string(Models::Operations::ActionRequest, false) + } + } + ) + # How your recommendation combines with ours. Defaults to 'escalate', which only applies it when stricter than ours; 'override' replaces ours outright. + field( + :behavior, + Crystalline::Nilable.new(Models::Operations::Behavior), + { + 'format_json': { + 'letter_case': ::ModerationApi::Utils.field_name("behavior"), + 'decoder': ::ModerationApi::Utils.enum_from_string(Models::Operations::Behavior, true) + } + } + ) + # Where your recommendation came from, e.g. "banned-ip". + field( + :source, + Crystalline::Nilable.new(::String), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("source")}} + ) + # A human-readable explanation for your recommendation. + field( + :reason, + Crystalline::Nilable.new(::String), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("reason")}} + ) + + sig { + params( + action: Models::Operations::ActionRequest, + behavior: T.nilable(Models::Operations::Behavior), + source: T.nilable(::String), + reason: T.nilable(::String) + ) + .void + } + def initialize(action:, behavior: nil, source: nil, reason: nil) + @action = action + @behavior = behavior + @source = source + @reason = reason + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @action == other.action + return false unless @behavior == other.behavior + return false unless @source == other.source + return false unless @reason == other.reason + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/clientaction.rbi b/lib/moderation_api/models/operations/clientaction.rbi new file mode 100644 index 00000000..2f5c7825 --- /dev/null +++ b/lib/moderation_api/models/operations/clientaction.rbi @@ -0,0 +1,32 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::ClientAction + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::ClientAction + def action + end + + def action=(str_) + end + + def behavior + end + + def behavior=(str_) + end + + def source + end + + def source=(str_) + end + + def reason + end + + def reason=(str_) + end +end diff --git a/lib/moderation_api/models/operations/code_abuse.rb b/lib/moderation_api/models/operations/code_abuse.rb new file mode 100644 index 00000000..824ac7eb --- /dev/null +++ b/lib/moderation_api/models/operations/code_abuse.rb @@ -0,0 +1,50 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class CodeAbuse + extend T::Sig + include Crystalline::MetadataFields + + field( + :flag, + Crystalline::Boolean.new, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("flag"), required: true}} + ) + + field( + :threshold, + Crystalline::Nilable.new(::Float), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("threshold")}} + ) + + field :id, ::String, {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("id"), required: true}} + + sig { params(flag: T::Boolean, threshold: T.nilable(::Float), id: ::String).void } + def initialize(flag:, threshold: nil, id: "code_abuse") + @flag = flag + @threshold = threshold + unless id == "code_abuse" + raise ArgumentError, "Invalid value for id" + end + + @id = "code_abuse" + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @flag == other.flag + return false unless @threshold == other.threshold + return false unless @id == other.id + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/code_abuse.rbi b/lib/moderation_api/models/operations/code_abuse.rbi new file mode 100644 index 00000000..7faa3462 --- /dev/null +++ b/lib/moderation_api/models/operations/code_abuse.rbi @@ -0,0 +1,26 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::CodeAbuse + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::CodeAbuse + def flag + end + + def flag=(str_) + end + + def threshold + end + + def threshold=(str_) + end + + def id + end + + def id=(str_) + end +end diff --git a/lib/moderation_api/models/operations/comparator.rb b/lib/moderation_api/models/operations/comparator.rb new file mode 100644 index 00000000..9221f9df --- /dev/null +++ b/lib/moderation_api/models/operations/comparator.rb @@ -0,0 +1,18 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + # Comparator - Flag images that contain "at least" or "fewer than" the configured number of faces. Defaults to at_least. + class Comparator < T::Enum + enums do + AT_LEAST = new("at_least") + FEWER_THAN = new("fewer_than") + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/comparator.rbi b/lib/moderation_api/models/operations/comparator.rbi new file mode 100644 index 00000000..42413ad9 --- /dev/null +++ b/lib/moderation_api/models/operations/comparator.rbi @@ -0,0 +1,9 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::Comparator + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::Comparator +end diff --git a/lib/moderation_api/models/operations/compassion_insight.rb b/lib/moderation_api/models/operations/compassion_insight.rb new file mode 100644 index 00000000..73c53bf0 --- /dev/null +++ b/lib/moderation_api/models/operations/compassion_insight.rb @@ -0,0 +1,62 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + # Compassion insight. Identifies with or shows concern, empathy, or support for the feelings/emotions of others. + class CompassionInsight + extend T::Sig + include Crystalline::MetadataFields + + field( + :probability, + ::Float, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("probability"), required: true}} + ) + + field :id, ::String, {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("id"), required: true}} + + field( + :type, + ::String, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("type"), required: true}} + ) + # Whether the content shows compassion. + field( + :value, + Crystalline::Nilable.new(Crystalline::Boolean.new), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("value"), required: true}} + ) + + sig { params(probability: ::Float, id: ::String, type: ::String, value: T.nilable(T::Boolean)).void } + def initialize(probability:, id: "compassion", type: "insight", value: nil) + @probability = probability + unless id == "compassion" + raise ArgumentError, "Invalid value for id" + end + + @id = "compassion" + unless type == "insight" + raise ArgumentError, "Invalid value for type" + end + + @type = "insight" + @value = value + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @probability == other.probability + return false unless @id == other.id + return false unless @type == other.type + return false unless @value == other.value + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/compassion_insight.rbi b/lib/moderation_api/models/operations/compassion_insight.rbi new file mode 100644 index 00000000..75182a0f --- /dev/null +++ b/lib/moderation_api/models/operations/compassion_insight.rbi @@ -0,0 +1,32 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::CompassionInsight + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::CompassionInsight + def probability + end + + def probability=(str_) + end + + def id + end + + def id=(str_) + end + + def type + end + + def type=(str_) + end + + def value + end + + def value=(str_) + end +end diff --git a/lib/moderation_api/models/operations/content_leaf_request.rb b/lib/moderation_api/models/operations/content_leaf_request.rb new file mode 100644 index 00000000..3c873bf6 --- /dev/null +++ b/lib/moderation_api/models/operations/content_leaf_request.rb @@ -0,0 +1,25 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class ContentLeafRequest + extend T::Sig + include Crystalline::MetadataFields + + def initialize + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/content_leaf_request.rbi b/lib/moderation_api/models/operations/content_leaf_request.rbi new file mode 100644 index 00000000..78cb5b4c --- /dev/null +++ b/lib/moderation_api/models/operations/content_leaf_request.rbi @@ -0,0 +1,9 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::ContentLeafRequest + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::ContentLeafRequest +end diff --git a/lib/moderation_api/models/operations/content_leaf_response.rb b/lib/moderation_api/models/operations/content_leaf_response.rb new file mode 100644 index 00000000..bbf61fc7 --- /dev/null +++ b/lib/moderation_api/models/operations/content_leaf_response.rb @@ -0,0 +1,25 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class ContentLeafResponse + extend T::Sig + include Crystalline::MetadataFields + + def initialize + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/content_leaf_response.rbi b/lib/moderation_api/models/operations/content_leaf_response.rbi new file mode 100644 index 00000000..1962cee4 --- /dev/null +++ b/lib/moderation_api/models/operations/content_leaf_response.rbi @@ -0,0 +1,9 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::ContentLeafResponse + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::ContentLeafResponse +end diff --git a/lib/moderation_api/models/operations/content_request.rb b/lib/moderation_api/models/operations/content_request.rb new file mode 100644 index 00000000..6885a74d --- /dev/null +++ b/lib/moderation_api/models/operations/content_request.rb @@ -0,0 +1,25 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + # The content sent for moderation + class ContentRequest + extend T::Sig + include Crystalline::MetadataFields + + def initialize + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/content_request.rbi b/lib/moderation_api/models/operations/content_request.rbi new file mode 100644 index 00000000..18f1dfc7 --- /dev/null +++ b/lib/moderation_api/models/operations/content_request.rbi @@ -0,0 +1,9 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::ContentRequest + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::ContentRequest +end diff --git a/lib/moderation_api/models/operations/content_response.rb b/lib/moderation_api/models/operations/content_response.rb new file mode 100644 index 00000000..62b83617 --- /dev/null +++ b/lib/moderation_api/models/operations/content_response.rb @@ -0,0 +1,103 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + # Potentially modified content. + class ContentResponse + extend T::Sig + include Crystalline::MetadataFields + + # The unique identifier for the content. Either the contentId provided by you or an autogenerated ID. + field :id, ::String, {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("id"), required: true}} + # Whether any values have been masked. + field( + :masked, + Crystalline::Boolean.new, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("masked"), required: true}} + ) + # Whether Unicode spoofing normalization rewrote the content — confusables folded to their Latin lookalikes, invisible characters and combining-mark abuse stripped. + field( + :unicode_cleaned, + Crystalline::Boolean.new, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("unicode_cleaned"), required: true}} + ) + # The modified content, if any. + field( + :modified, + Crystalline::Nilable.new( + Crystalline::Union.new( + ::String, + Crystalline::Hash.new(Symbol, ::Object), + Crystalline::Hash.new( + Symbol, + Crystalline::DiscriminatedUnion.new( + "type", + { + "text" => Models::Operations::TextResponse, + "image" => Models::Operations::ImageResponse, + "video" => Models::Operations::VideoResponse, + "audio" => Models::Operations::AudioResponse + } + ) + ) + ) + ), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("modified"), required: true}} + ) + # The transcribed text from audio content. Only present when audio moderation is used and transcript inclusion is enabled on the channel. + field( + :transcript, + Crystalline::Nilable.new(::String), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("transcript")}} + ) + + sig { + params( + id: ::String, + masked: T::Boolean, + unicode_cleaned: T::Boolean, + modified: T.nilable( + T.any( + ::String, + T::Hash[Symbol, ::Object], + T::Hash[ + Symbol, + T.any( + Models::Operations::TextResponse, + Models::Operations::ImageResponse, + Models::Operations::VideoResponse, + Models::Operations::AudioResponse + ) + ] + ) + ), + transcript: T.nilable(::String) + ) + .void + } + def initialize(id:, masked:, unicode_cleaned:, modified: nil, transcript: nil) + @id = id + @masked = masked + @unicode_cleaned = unicode_cleaned + @modified = modified + @transcript = transcript + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @id == other.id + return false unless @masked == other.masked + return false unless @unicode_cleaned == other.unicode_cleaned + return false unless @modified == other.modified + return false unless @transcript == other.transcript + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/content_response.rbi b/lib/moderation_api/models/operations/content_response.rbi new file mode 100644 index 00000000..1a525a09 --- /dev/null +++ b/lib/moderation_api/models/operations/content_response.rbi @@ -0,0 +1,38 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::ContentResponse + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::ContentResponse + def id + end + + def id=(str_) + end + + def masked + end + + def masked=(str_) + end + + def unicode_cleaned + end + + def unicode_cleaned=(str_) + end + + def modified + end + + def modified=(str_) + end + + def transcript + end + + def transcript=(str_) + end +end diff --git a/lib/moderation_api/models/operations/createaction_position_request.rb b/lib/moderation_api/models/operations/createaction_position_request.rb new file mode 100644 index 00000000..038a1ed6 --- /dev/null +++ b/lib/moderation_api/models/operations/createaction_position_request.rb @@ -0,0 +1,19 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + # CreateActionPositionRequest - Show the action in all queues, selected queues or no queues (to use via API only). + class CreateActionPositionRequest < T::Enum + enums do + ALL_QUEUES = new("ALL_QUEUES") + SOME_QUEUES = new("SOME_QUEUES") + HIDDEN = new("HIDDEN") + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/createaction_position_request.rbi b/lib/moderation_api/models/operations/createaction_position_request.rbi new file mode 100644 index 00000000..986f062e --- /dev/null +++ b/lib/moderation_api/models/operations/createaction_position_request.rbi @@ -0,0 +1,9 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::CreateActionPositionRequest + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::CreateActionPositionRequest +end diff --git a/lib/moderation_api/models/operations/createaction_position_response.rb b/lib/moderation_api/models/operations/createaction_position_response.rb new file mode 100644 index 00000000..ce3d9a01 --- /dev/null +++ b/lib/moderation_api/models/operations/createaction_position_response.rb @@ -0,0 +1,22 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + # CreateActionPositionResponse - Show the action in all queues, selected queues or no queues (to use via API only). + class CreateActionPositionResponse + include ::Crystalline::Enum + enums do + ALL_QUEUES = new("ALL_QUEUES") + SOME_QUEUES = new("SOME_QUEUES") + HIDDEN = new("HIDDEN") + end + + open! + end + end + end +end diff --git a/lib/moderation_api/models/operations/createaction_position_response.rbi b/lib/moderation_api/models/operations/createaction_position_response.rbi new file mode 100644 index 00000000..79f1a6ed --- /dev/null +++ b/lib/moderation_api/models/operations/createaction_position_response.rbi @@ -0,0 +1,9 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::CreateActionPositionResponse + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::CreateActionPositionResponse +end diff --git a/lib/moderation_api/models/operations/createaction_possiblevalue_request.rb b/lib/moderation_api/models/operations/createaction_possiblevalue_request.rb new file mode 100644 index 00000000..95666094 --- /dev/null +++ b/lib/moderation_api/models/operations/createaction_possiblevalue_request.rb @@ -0,0 +1,35 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class CreateActionPossibleValueRequest + extend T::Sig + include Crystalline::MetadataFields + + # The value of the action. + field( + :value, + ::String, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("value"), required: true}} + ) + + sig { params(value: ::String).void } + def initialize(value:) + @value = value + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @value == other.value + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/createaction_possiblevalue_request.rbi b/lib/moderation_api/models/operations/createaction_possiblevalue_request.rbi new file mode 100644 index 00000000..226dcf08 --- /dev/null +++ b/lib/moderation_api/models/operations/createaction_possiblevalue_request.rbi @@ -0,0 +1,14 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::CreateActionPossibleValueRequest + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::CreateActionPossibleValueRequest + def value + end + + def value=(str_) + end +end diff --git a/lib/moderation_api/models/operations/createaction_possiblevalue_response.rb b/lib/moderation_api/models/operations/createaction_possiblevalue_response.rb new file mode 100644 index 00000000..4cdd304c --- /dev/null +++ b/lib/moderation_api/models/operations/createaction_possiblevalue_response.rb @@ -0,0 +1,35 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class CreateActionPossibleValueResponse + extend T::Sig + include Crystalline::MetadataFields + + # The value of the action. + field( + :value, + ::String, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("value"), required: true}} + ) + + sig { params(value: ::String).void } + def initialize(value:) + @value = value + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @value == other.value + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/createaction_possiblevalue_response.rbi b/lib/moderation_api/models/operations/createaction_possiblevalue_response.rbi new file mode 100644 index 00000000..cc75f830 --- /dev/null +++ b/lib/moderation_api/models/operations/createaction_possiblevalue_response.rbi @@ -0,0 +1,14 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::CreateActionPossibleValueResponse + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::CreateActionPossibleValueResponse + def value + end + + def value=(str_) + end +end diff --git a/lib/moderation_api/models/operations/createaction_queuebehaviour_request.rb b/lib/moderation_api/models/operations/createaction_queuebehaviour_request.rb new file mode 100644 index 00000000..fd49643f --- /dev/null +++ b/lib/moderation_api/models/operations/createaction_queuebehaviour_request.rb @@ -0,0 +1,19 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + # CreateActionQueueBehaviourRequest - Whether the action resolves and removes the item, unresolves and re-add it to the queue, or does not change the resolve status. + class CreateActionQueueBehaviourRequest < T::Enum + enums do + REMOVE = new("REMOVE") + ADD = new("ADD") + NO_CHANGE = new("NO_CHANGE") + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/createaction_queuebehaviour_request.rbi b/lib/moderation_api/models/operations/createaction_queuebehaviour_request.rbi new file mode 100644 index 00000000..44e9e784 --- /dev/null +++ b/lib/moderation_api/models/operations/createaction_queuebehaviour_request.rbi @@ -0,0 +1,9 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::CreateActionQueueBehaviourRequest + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::CreateActionQueueBehaviourRequest +end diff --git a/lib/moderation_api/models/operations/createaction_queuebehaviour_response.rb b/lib/moderation_api/models/operations/createaction_queuebehaviour_response.rb new file mode 100644 index 00000000..15a1d4ee --- /dev/null +++ b/lib/moderation_api/models/operations/createaction_queuebehaviour_response.rb @@ -0,0 +1,22 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + # CreateActionQueueBehaviourResponse - Whether the action resolves and removes the item, unresolves and re-add it to the queue, or does not change the resolve status. + class CreateActionQueueBehaviourResponse + include ::Crystalline::Enum + enums do + REMOVE = new("REMOVE") + ADD = new("ADD") + NO_CHANGE = new("NO_CHANGE") + end + + open! + end + end + end +end diff --git a/lib/moderation_api/models/operations/createaction_queuebehaviour_response.rbi b/lib/moderation_api/models/operations/createaction_queuebehaviour_response.rbi new file mode 100644 index 00000000..8e39f1f7 --- /dev/null +++ b/lib/moderation_api/models/operations/createaction_queuebehaviour_response.rbi @@ -0,0 +1,9 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::CreateActionQueueBehaviourResponse + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::CreateActionQueueBehaviourResponse +end diff --git a/lib/moderation_api/models/operations/createaction_request.rb b/lib/moderation_api/models/operations/createaction_request.rb new file mode 100644 index 00000000..d173dcea --- /dev/null +++ b/lib/moderation_api/models/operations/createaction_request.rb @@ -0,0 +1,160 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class CreateActionRequest + extend T::Sig + include Crystalline::MetadataFields + + # The name of the action. + field( + :name, + ::String, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("name"), required: true}} + ) + # The IDs of the queues the action is available in. + field( + :filter_in_queue_ids, + Crystalline::Nilable.new(Crystalline::Array.new(::String)), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("filterInQueueIds")}} + ) + # The possible values of the action. The user will be prompted to select one of these values when executing the action. + field( + :possible_values, + Crystalline::Nilable.new(Crystalline::Array.new(Models::Operations::CreateActionPossibleValueRequest)), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("possibleValues")}} + ) + # User defined key of the action. + field( + :key, + Crystalline::Nilable.new(::String), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("key")}} + ) + # The description of the action. + field( + :description, + Crystalline::Nilable.new(::String), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("description")}} + ) + # The type of the action. + field( + :type, + Crystalline::Nilable.new(Models::Operations::CreateActionTypeRequest), + { + 'format_json': { + 'letter_case': ::ModerationApi::Utils.field_name("type"), + 'decoder': ::ModerationApi::Utils.enum_from_string(Models::Operations::CreateActionTypeRequest, true) + } + } + ) + # Whether the action resolves and removes the item, unresolves and re-add it to the queue, or does not change the resolve status. + field( + :queue_behaviour, + Crystalline::Nilable.new(Models::Operations::CreateActionQueueBehaviourRequest), + { + 'format_json': { + 'letter_case': ::ModerationApi::Utils.field_name("queueBehaviour"), + 'decoder': ::ModerationApi::Utils.enum_from_string( + Models::Operations::CreateActionQueueBehaviourRequest, + true + ) + } + } + ) + # Show the action in all queues, selected queues or no queues (to use via API only). + field( + :position, + Crystalline::Nilable.new(Models::Operations::CreateActionPositionRequest), + { + 'format_json': { + 'letter_case': ::ModerationApi::Utils.field_name("position"), + 'decoder': ::ModerationApi::Utils.enum_from_string(Models::Operations::CreateActionPositionRequest, true) + } + } + ) + # Whether the action requires a value to be executed. + field( + :value_required, + Crystalline::Nilable.new(Crystalline::Boolean.new), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("valueRequired")}} + ) + # Whether the action allows any text to be entered as a value or if it must be one of the possible values. + field( + :free_text, + Crystalline::Nilable.new(Crystalline::Boolean.new), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("freeText")}} + ) + # Whether the action is a built-in action or a custom one. + field( + :built_in, + Crystalline::Nilable.new(Crystalline::Boolean.new), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("builtIn")}} + ) + + sig { + params( + name: ::String, + filter_in_queue_ids: T.nilable(T::Array[::String]), + possible_values: T.nilable(T::Array[Models::Operations::CreateActionPossibleValueRequest]), + key: T.nilable(::String), + description: T.nilable(::String), + type: T.nilable(Models::Operations::CreateActionTypeRequest), + queue_behaviour: T.nilable(Models::Operations::CreateActionQueueBehaviourRequest), + position: T.nilable(Models::Operations::CreateActionPositionRequest), + value_required: T.nilable(T::Boolean), + free_text: T.nilable(T::Boolean), + built_in: T.nilable(T::Boolean) + ) + .void + } + def initialize( + name:, + filter_in_queue_ids: nil, + possible_values: nil, + key: nil, + description: nil, + type: nil, + queue_behaviour: Models::Operations::CreateActionQueueBehaviourRequest::NO_CHANGE, + position: Models::Operations::CreateActionPositionRequest::ALL_QUEUES, + value_required: false, + free_text: false, + built_in: false + ) + @name = name + @filter_in_queue_ids = filter_in_queue_ids + @possible_values = possible_values + @key = key + @description = description + @type = type + @queue_behaviour = queue_behaviour + @position = position + @value_required = value_required + @free_text = free_text + @built_in = built_in + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @name == other.name + return false unless @filter_in_queue_ids == other.filter_in_queue_ids + return false unless @possible_values == other.possible_values + return false unless @key == other.key + return false unless @description == other.description + return false unless @type == other.type + return false unless @queue_behaviour == other.queue_behaviour + return false unless @position == other.position + return false unless @value_required == other.value_required + return false unless @free_text == other.free_text + return false unless @built_in == other.built_in + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/createaction_request.rbi b/lib/moderation_api/models/operations/createaction_request.rbi new file mode 100644 index 00000000..1d947d60 --- /dev/null +++ b/lib/moderation_api/models/operations/createaction_request.rbi @@ -0,0 +1,74 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::CreateActionRequest + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::CreateActionRequest + def name + end + + def name=(str_) + end + + def filter_in_queue_ids + end + + def filter_in_queue_ids=(str_) + end + + def possible_values + end + + def possible_values=(str_) + end + + def key + end + + def key=(str_) + end + + def description + end + + def description=(str_) + end + + def type + end + + def type=(str_) + end + + def queue_behaviour + end + + def queue_behaviour=(str_) + end + + def position + end + + def position=(str_) + end + + def value_required + end + + def value_required=(str_) + end + + def free_text + end + + def free_text=(str_) + end + + def built_in + end + + def built_in=(str_) + end +end diff --git a/lib/moderation_api/models/operations/createaction_response.rb b/lib/moderation_api/models/operations/createaction_response.rb new file mode 100644 index 00000000..1af9df28 --- /dev/null +++ b/lib/moderation_api/models/operations/createaction_response.rb @@ -0,0 +1,51 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class CreateActionResponse + extend T::Sig + include Crystalline::MetadataFields + + # HTTP response content type for this operation + field :content_type, ::String + # HTTP response status code for this operation + field :status_code, ::Integer + # Raw HTTP response; suitable for custom response parsing + field :raw_response, ::Faraday::Response + # Action created successfully + field :object, Crystalline::Nilable.new(Models::Operations::CreateActionResponseBody) + + sig { + params( + content_type: ::String, + status_code: ::Integer, + raw_response: ::Faraday::Response, + object: T.nilable(Models::Operations::CreateActionResponseBody) + ) + .void + } + def initialize(content_type:, status_code:, raw_response:, object: nil) + @content_type = content_type + @status_code = status_code + @raw_response = raw_response + @object = object + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @content_type == other.content_type + return false unless @status_code == other.status_code + return false unless @raw_response == other.raw_response + return false unless @object == other.object + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/createaction_response.rbi b/lib/moderation_api/models/operations/createaction_response.rbi new file mode 100644 index 00000000..b42aacf2 --- /dev/null +++ b/lib/moderation_api/models/operations/createaction_response.rbi @@ -0,0 +1,32 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::CreateActionResponse + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::CreateActionResponse + def content_type + end + + def content_type=(str_) + end + + def status_code + end + + def status_code=(str_) + end + + def raw_response + end + + def raw_response=(str_) + end + + def object + end + + def object=(str_) + end +end diff --git a/lib/moderation_api/models/operations/createaction_responsebody.rb b/lib/moderation_api/models/operations/createaction_responsebody.rb new file mode 100644 index 00000000..101ec7dd --- /dev/null +++ b/lib/moderation_api/models/operations/createaction_responsebody.rb @@ -0,0 +1,182 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + # Action created successfully + class CreateActionResponseBody + extend T::Sig + include Crystalline::MetadataFields + + # The ID of the action. + field :id, ::String, {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("id"), required: true}} + # The date the action was created. + field( + :created_at, + ::String, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("createdAt"), required: true}} + ) + # The name of the action. + field( + :name, + ::String, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("name"), required: true}} + ) + # The IDs of the queues the action is available in. + field( + :filter_in_queue_ids, + Crystalline::Array.new(::String), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("filterInQueueIds"), required: true}} + ) + # The possible values of the action. The user will be prompted to select one of these values when executing the action. + field( + :possible_values, + Crystalline::Array.new(Models::Operations::CreateActionPossibleValueResponse), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("possibleValues"), required: true}} + ) + # User defined key of the action. + field( + :key, + Crystalline::Nilable.new(::String), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("key")}} + ) + # The description of the action. + field( + :description, + Crystalline::Nilable.new(::String), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("description")}} + ) + # The type of the action. + field( + :type, + Crystalline::Nilable.new(Models::Operations::CreateActionTypeResponse), + { + 'format_json': { + 'letter_case': ::ModerationApi::Utils.field_name("type"), + 'decoder': ::ModerationApi::Utils.open_enum_from_string( + Models::Operations::CreateActionTypeResponse, + true + ) + } + } + ) + # Whether the action resolves and removes the item, unresolves and re-add it to the queue, or does not change the resolve status. + field( + :queue_behaviour, + Crystalline::Nilable.new(Models::Operations::CreateActionQueueBehaviourResponse), + { + 'format_json': { + 'letter_case': ::ModerationApi::Utils.field_name("queueBehaviour"), + 'decoder': ::ModerationApi::Utils.open_enum_from_string( + Models::Operations::CreateActionQueueBehaviourResponse, + true + ) + } + } + ) + # Show the action in all queues, selected queues or no queues (to use via API only). + field( + :position, + Crystalline::Nilable.new(Models::Operations::CreateActionPositionResponse), + { + 'format_json': { + 'letter_case': ::ModerationApi::Utils.field_name("position"), + 'decoder': ::ModerationApi::Utils.open_enum_from_string( + Models::Operations::CreateActionPositionResponse, + true + ) + } + } + ) + # Whether the action requires a value to be executed. + field( + :value_required, + Crystalline::Nilable.new(Crystalline::Boolean.new), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("valueRequired")}} + ) + # Whether the action allows any text to be entered as a value or if it must be one of the possible values. + field( + :free_text, + Crystalline::Nilable.new(Crystalline::Boolean.new), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("freeText")}} + ) + # Whether the action is a built-in action or a custom one. + field( + :built_in, + Crystalline::Nilable.new(Crystalline::Boolean.new), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("builtIn")}} + ) + + sig { + params( + id: ::String, + created_at: ::String, + name: ::String, + filter_in_queue_ids: T::Array[::String], + possible_values: T::Array[Models::Operations::CreateActionPossibleValueResponse], + key: T.nilable(::String), + description: T.nilable(::String), + type: T.nilable(Models::Operations::CreateActionTypeResponse), + queue_behaviour: T.nilable(Models::Operations::CreateActionQueueBehaviourResponse), + position: T.nilable(Models::Operations::CreateActionPositionResponse), + value_required: T.nilable(T::Boolean), + free_text: T.nilable(T::Boolean), + built_in: T.nilable(T::Boolean) + ) + .void + } + def initialize( + id:, + created_at:, + name:, + filter_in_queue_ids:, + possible_values:, + key: nil, + description: nil, + type: nil, + queue_behaviour: Models::Operations::CreateActionQueueBehaviourResponse::NO_CHANGE, + position: Models::Operations::CreateActionPositionResponse::ALL_QUEUES, + value_required: false, + free_text: false, + built_in: false + ) + @id = id + @created_at = created_at + @name = name + @filter_in_queue_ids = filter_in_queue_ids + @possible_values = possible_values + @key = key + @description = description + @type = type + @queue_behaviour = queue_behaviour + @position = position + @value_required = value_required + @free_text = free_text + @built_in = built_in + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @id == other.id + return false unless @created_at == other.created_at + return false unless @name == other.name + return false unless @filter_in_queue_ids == other.filter_in_queue_ids + return false unless @possible_values == other.possible_values + return false unless @key == other.key + return false unless @description == other.description + return false unless @type == other.type + return false unless @queue_behaviour == other.queue_behaviour + return false unless @position == other.position + return false unless @value_required == other.value_required + return false unless @free_text == other.free_text + return false unless @built_in == other.built_in + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/createaction_responsebody.rbi b/lib/moderation_api/models/operations/createaction_responsebody.rbi new file mode 100644 index 00000000..2bf7d27d --- /dev/null +++ b/lib/moderation_api/models/operations/createaction_responsebody.rbi @@ -0,0 +1,86 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::CreateActionResponseBody + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::CreateActionResponseBody + def id + end + + def id=(str_) + end + + def created_at + end + + def created_at=(str_) + end + + def name + end + + def name=(str_) + end + + def filter_in_queue_ids + end + + def filter_in_queue_ids=(str_) + end + + def possible_values + end + + def possible_values=(str_) + end + + def key + end + + def key=(str_) + end + + def description + end + + def description=(str_) + end + + def type + end + + def type=(str_) + end + + def queue_behaviour + end + + def queue_behaviour=(str_) + end + + def position + end + + def position=(str_) + end + + def value_required + end + + def value_required=(str_) + end + + def free_text + end + + def free_text=(str_) + end + + def built_in + end + + def built_in=(str_) + end +end diff --git a/lib/moderation_api/models/operations/createaction_type_request.rb b/lib/moderation_api/models/operations/createaction_type_request.rb new file mode 100644 index 00000000..b420c972 --- /dev/null +++ b/lib/moderation_api/models/operations/createaction_type_request.rb @@ -0,0 +1,26 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class CreateActionTypeRequest < T::Enum + enums do + AUTHOR_BLOCK = new("AUTHOR_BLOCK") + AUTHOR_BLOCK_TEMP = new("AUTHOR_BLOCK_TEMP") + AUTHOR_UNBLOCK = new("AUTHOR_UNBLOCK") + AUTHOR_DELETE = new("AUTHOR_DELETE") + AUTHOR_REPORT = new("AUTHOR_REPORT") + AUTHOR_WARN = new("AUTHOR_WARN") + AUTHOR_CUSTOM = new("AUTHOR_CUSTOM") + ITEM_REJECT = new("ITEM_REJECT") + ITEM_ALLOW = new("ITEM_ALLOW") + ITEM_CUSTOM = new("ITEM_CUSTOM") + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/createaction_type_request.rbi b/lib/moderation_api/models/operations/createaction_type_request.rbi new file mode 100644 index 00000000..a465b5d5 --- /dev/null +++ b/lib/moderation_api/models/operations/createaction_type_request.rbi @@ -0,0 +1,9 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::CreateActionTypeRequest + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::CreateActionTypeRequest +end diff --git a/lib/moderation_api/models/operations/createaction_type_response.rb b/lib/moderation_api/models/operations/createaction_type_response.rb new file mode 100644 index 00000000..342ce775 --- /dev/null +++ b/lib/moderation_api/models/operations/createaction_type_response.rb @@ -0,0 +1,29 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class CreateActionTypeResponse + include ::Crystalline::Enum + enums do + AUTHOR_BLOCK = new("AUTHOR_BLOCK") + AUTHOR_BLOCK_TEMP = new("AUTHOR_BLOCK_TEMP") + AUTHOR_UNBLOCK = new("AUTHOR_UNBLOCK") + AUTHOR_DELETE = new("AUTHOR_DELETE") + AUTHOR_REPORT = new("AUTHOR_REPORT") + AUTHOR_WARN = new("AUTHOR_WARN") + AUTHOR_CUSTOM = new("AUTHOR_CUSTOM") + ITEM_REJECT = new("ITEM_REJECT") + ITEM_ALLOW = new("ITEM_ALLOW") + ITEM_CUSTOM = new("ITEM_CUSTOM") + end + + open! + end + end + end +end diff --git a/lib/moderation_api/models/operations/createaction_type_response.rbi b/lib/moderation_api/models/operations/createaction_type_response.rbi new file mode 100644 index 00000000..5f17ab9f --- /dev/null +++ b/lib/moderation_api/models/operations/createaction_type_response.rbi @@ -0,0 +1,9 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::CreateActionTypeResponse + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::CreateActionTypeResponse +end diff --git a/lib/moderation_api/models/operations/createauthor_metadata.rb b/lib/moderation_api/models/operations/createauthor_metadata.rb new file mode 100644 index 00000000..34a620b4 --- /dev/null +++ b/lib/moderation_api/models/operations/createauthor_metadata.rb @@ -0,0 +1,86 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + # Additional metadata provided by your system. We recommend including any relevant information that may assist in the moderation process. + class CreateAuthorMetadata + extend T::Sig + include Crystalline::MetadataFields + + field( + :additional_properties, + Crystalline::Nilable.new(Crystalline::Hash.new(Symbol, ::Object)), + { + 'format_json': { + 'letter_case': ::ModerationApi::Utils.field_name("additional_properties"), + 'additional_properties': true + } + } + ) + # Whether the author's email is verified + field( + :email_verified, + Crystalline::Nilable.new(Crystalline::Boolean.new), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("email_verified")}} + ) + # Whether the author's phone number is verified + field( + :phone_verified, + Crystalline::Nilable.new(Crystalline::Boolean.new), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("phone_verified")}} + ) + # Whether the author's identity is verified + field( + :identity_verified, + Crystalline::Nilable.new(Crystalline::Boolean.new), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("identity_verified")}} + ) + # Whether the author is a paying customer + field( + :is_paying_customer, + Crystalline::Nilable.new(Crystalline::Boolean.new), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("is_paying_customer")}} + ) + + sig { + params( + additional_properties: T.nilable(T::Hash[Symbol, ::Object]), + email_verified: T.nilable(T::Boolean), + phone_verified: T.nilable(T::Boolean), + identity_verified: T.nilable(T::Boolean), + is_paying_customer: T.nilable(T::Boolean) + ) + .void + } + def initialize( + additional_properties: nil, + email_verified: nil, + phone_verified: nil, + identity_verified: nil, + is_paying_customer: nil + ) + @additional_properties = additional_properties + @email_verified = email_verified + @phone_verified = phone_verified + @identity_verified = identity_verified + @is_paying_customer = is_paying_customer + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @additional_properties == other.additional_properties + return false unless @email_verified == other.email_verified + return false unless @phone_verified == other.phone_verified + return false unless @identity_verified == other.identity_verified + return false unless @is_paying_customer == other.is_paying_customer + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/createauthor_metadata.rbi b/lib/moderation_api/models/operations/createauthor_metadata.rbi new file mode 100644 index 00000000..cd35cace --- /dev/null +++ b/lib/moderation_api/models/operations/createauthor_metadata.rbi @@ -0,0 +1,38 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::CreateAuthorMetadata + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::CreateAuthorMetadata + def additional_properties + end + + def additional_properties=(str_) + end + + def email_verified + end + + def email_verified=(str_) + end + + def phone_verified + end + + def phone_verified=(str_) + end + + def identity_verified + end + + def identity_verified=(str_) + end + + def is_paying_customer + end + + def is_paying_customer=(str_) + end +end diff --git a/lib/moderation_api/models/operations/createauthor_request.rb b/lib/moderation_api/models/operations/createauthor_request.rb new file mode 100644 index 00000000..88d701e0 --- /dev/null +++ b/lib/moderation_api/models/operations/createauthor_request.rb @@ -0,0 +1,132 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class CreateAuthorRequest + extend T::Sig + include Crystalline::MetadataFields + + # External ID of the user, typically the ID of the author in your database. + field( + :external_id, + ::String, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("external_id"), required: true}} + ) + # Additional metadata provided by your system. We recommend including any relevant information that may assist in the moderation process. + field( + :metadata, + Crystalline::Nilable.new(Models::Operations::CreateAuthorMetadata), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("metadata")}} + ) + # Timestamp when author first appeared + field( + :first_seen, + Crystalline::Nilable.new(::Float), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("first_seen")}} + ) + # Timestamp of last activity + field( + :last_seen, + Crystalline::Nilable.new(::Float), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("last_seen")}} + ) + # URL of the author's profile picture + field( + :profile_picture, + Crystalline::Nilable.new(::String), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("profile_picture")}} + ) + # URL of the author's external profile + field( + :external_link, + Crystalline::Nilable.new(::String), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("external_link")}} + ) + # Author name or identifier + field( + :name, + Crystalline::Nilable.new(::String), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("name")}} + ) + # Author email address + field( + :email, + Crystalline::Nilable.new(::String), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("email")}} + ) + # The author's company or organization + field( + :company, + Crystalline::Nilable.new(::String), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("company")}} + ) + + field( + :manual_trust_level, + Crystalline::Nilable.new(::Float), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("manual_trust_level")}} + ) + + sig { + params( + external_id: ::String, + metadata: T.nilable(Models::Operations::CreateAuthorMetadata), + first_seen: T.nilable(::Float), + last_seen: T.nilable(::Float), + profile_picture: T.nilable(::String), + external_link: T.nilable(::String), + name: T.nilable(::String), + email: T.nilable(::String), + company: T.nilable(::String), + manual_trust_level: T.nilable(::Float) + ) + .void + } + def initialize( + external_id:, + metadata: nil, + first_seen: nil, + last_seen: nil, + profile_picture: nil, + external_link: nil, + name: nil, + email: nil, + company: nil, + manual_trust_level: nil + ) + @external_id = external_id + @metadata = metadata + @first_seen = first_seen + @last_seen = last_seen + @profile_picture = profile_picture + @external_link = external_link + @name = name + @email = email + @company = company + @manual_trust_level = manual_trust_level + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @external_id == other.external_id + return false unless @metadata == other.metadata + return false unless @first_seen == other.first_seen + return false unless @last_seen == other.last_seen + return false unless @profile_picture == other.profile_picture + return false unless @external_link == other.external_link + return false unless @name == other.name + return false unless @email == other.email + return false unless @company == other.company + return false unless @manual_trust_level == other.manual_trust_level + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/createauthor_request.rbi b/lib/moderation_api/models/operations/createauthor_request.rbi new file mode 100644 index 00000000..79c82c1f --- /dev/null +++ b/lib/moderation_api/models/operations/createauthor_request.rbi @@ -0,0 +1,68 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::CreateAuthorRequest + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::CreateAuthorRequest + def external_id + end + + def external_id=(str_) + end + + def metadata + end + + def metadata=(str_) + end + + def first_seen + end + + def first_seen=(str_) + end + + def last_seen + end + + def last_seen=(str_) + end + + def profile_picture + end + + def profile_picture=(str_) + end + + def external_link + end + + def external_link=(str_) + end + + def name + end + + def name=(str_) + end + + def email + end + + def email=(str_) + end + + def company + end + + def company=(str_) + end + + def manual_trust_level + end + + def manual_trust_level=(str_) + end +end diff --git a/lib/moderation_api/models/operations/createauthor_response.rb b/lib/moderation_api/models/operations/createauthor_response.rb new file mode 100644 index 00000000..6c0f34b7 --- /dev/null +++ b/lib/moderation_api/models/operations/createauthor_response.rb @@ -0,0 +1,51 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class CreateAuthorResponse + extend T::Sig + include Crystalline::MetadataFields + + # HTTP response content type for this operation + field :content_type, ::String + # HTTP response status code for this operation + field :status_code, ::Integer + # Raw HTTP response; suitable for custom response parsing + field :raw_response, ::Faraday::Response + # Successful response + field :public_author, Crystalline::Nilable.new(Models::Components::PublicAuthor) + + sig { + params( + content_type: ::String, + status_code: ::Integer, + raw_response: ::Faraday::Response, + public_author: T.nilable(Models::Components::PublicAuthor) + ) + .void + } + def initialize(content_type:, status_code:, raw_response:, public_author: nil) + @content_type = content_type + @status_code = status_code + @raw_response = raw_response + @public_author = public_author + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @content_type == other.content_type + return false unless @status_code == other.status_code + return false unless @raw_response == other.raw_response + return false unless @public_author == other.public_author + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/createauthor_response.rbi b/lib/moderation_api/models/operations/createauthor_response.rbi new file mode 100644 index 00000000..e577f652 --- /dev/null +++ b/lib/moderation_api/models/operations/createauthor_response.rbi @@ -0,0 +1,32 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::CreateAuthorResponse + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::CreateAuthorResponse + def content_type + end + + def content_type=(str_) + end + + def status_code + end + + def status_code=(str_) + end + + def raw_response + end + + def raw_response=(str_) + end + + def public_author + end + + def public_author=(str_) + end +end diff --git a/lib/moderation_api/models/operations/createchannel_contenttype.rb b/lib/moderation_api/models/operations/createchannel_contenttype.rb new file mode 100644 index 00000000..3406e5b4 --- /dev/null +++ b/lib/moderation_api/models/operations/createchannel_contenttype.rb @@ -0,0 +1,25 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + # CreateChannelContentType - The kind of content the channel moderates. + class CreateChannelContentType < T::Enum + enums do + PROFILE = new("profile") + MESSAGE = new("message") + POST = new("post") + COMMENT = new("comment") + EVENT = new("event") + PRODUCT = new("product") + REVIEW = new("review") + VOICE = new("voice") + OTHER = new("other") + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/createchannel_contenttype.rbi b/lib/moderation_api/models/operations/createchannel_contenttype.rbi new file mode 100644 index 00000000..06ab67ba --- /dev/null +++ b/lib/moderation_api/models/operations/createchannel_contenttype.rbi @@ -0,0 +1,9 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::CreateChannelContentType + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::CreateChannelContentType +end diff --git a/lib/moderation_api/models/operations/createchannel_request.rb b/lib/moderation_api/models/operations/createchannel_request.rb new file mode 100644 index 00000000..7dc5d1b6 --- /dev/null +++ b/lib/moderation_api/models/operations/createchannel_request.rb @@ -0,0 +1,35 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class CreateChannelRequest + extend T::Sig + include Crystalline::MetadataFields + + # The ID of the project to add the channel to. + field :project_id, ::String, {'path_param': {'field_name': "projectId", 'style': "simple", 'explode': false}} + + field :body, Models::Operations::CreateChannelRequestBody, {'request': {'media_type': "application/json"}} + + sig { params(project_id: ::String, body: Models::Operations::CreateChannelRequestBody).void } + def initialize(project_id:, body:) + @project_id = project_id + @body = body + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @project_id == other.project_id + return false unless @body == other.body + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/createchannel_request.rbi b/lib/moderation_api/models/operations/createchannel_request.rbi new file mode 100644 index 00000000..b1f15239 --- /dev/null +++ b/lib/moderation_api/models/operations/createchannel_request.rbi @@ -0,0 +1,20 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::CreateChannelRequest + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::CreateChannelRequest + def project_id + end + + def project_id=(str_) + end + + def body + end + + def body=(str_) + end +end diff --git a/lib/moderation_api/models/operations/createchannel_requestbody.rb b/lib/moderation_api/models/operations/createchannel_requestbody.rb new file mode 100644 index 00000000..ff728560 --- /dev/null +++ b/lib/moderation_api/models/operations/createchannel_requestbody.rb @@ -0,0 +1,72 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class CreateChannelRequestBody + extend T::Sig + include Crystalline::MetadataFields + + # The channel's name. + field( + :name, + ::String, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("name"), required: true}} + ) + # The key you pass as `channel` when you moderate content. Defaults to the name in lowercase with dashes. Must be unique in the project. + field( + :key, + Crystalline::Nilable.new(::String), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("key")}} + ) + # The channel's description. + field( + :description, + Crystalline::Nilable.new(::String), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("description")}} + ) + # The kind of content the channel moderates. + field( + :content_type, + Crystalline::Nilable.new(Models::Operations::CreateChannelContentType), + { + 'format_json': { + 'letter_case': ::ModerationApi::Utils.field_name("contentType"), + 'decoder': ::ModerationApi::Utils.enum_from_string(Models::Operations::CreateChannelContentType, true) + } + } + ) + + sig { + params( + name: ::String, + key: T.nilable(::String), + description: T.nilable(::String), + content_type: T.nilable(Models::Operations::CreateChannelContentType) + ) + .void + } + def initialize(name:, key: nil, description: nil, content_type: nil) + @name = name + @key = key + @description = description + @content_type = content_type + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @name == other.name + return false unless @key == other.key + return false unless @description == other.description + return false unless @content_type == other.content_type + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/createchannel_requestbody.rbi b/lib/moderation_api/models/operations/createchannel_requestbody.rbi new file mode 100644 index 00000000..3c0c5a9b --- /dev/null +++ b/lib/moderation_api/models/operations/createchannel_requestbody.rbi @@ -0,0 +1,32 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::CreateChannelRequestBody + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::CreateChannelRequestBody + def name + end + + def name=(str_) + end + + def key + end + + def key=(str_) + end + + def description + end + + def description=(str_) + end + + def content_type + end + + def content_type=(str_) + end +end diff --git a/lib/moderation_api/models/operations/createchannel_response.rb b/lib/moderation_api/models/operations/createchannel_response.rb new file mode 100644 index 00000000..592edc6b --- /dev/null +++ b/lib/moderation_api/models/operations/createchannel_response.rb @@ -0,0 +1,51 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class CreateChannelResponse + extend T::Sig + include Crystalline::MetadataFields + + # HTTP response content type for this operation + field :content_type, ::String + # HTTP response status code for this operation + field :status_code, ::Integer + # Raw HTTP response; suitable for custom response parsing + field :raw_response, ::Faraday::Response + # Channel created successfully + field :channel, Crystalline::Nilable.new(Models::Components::Channel) + + sig { + params( + content_type: ::String, + status_code: ::Integer, + raw_response: ::Faraday::Response, + channel: T.nilable(Models::Components::Channel) + ) + .void + } + def initialize(content_type:, status_code:, raw_response:, channel: nil) + @content_type = content_type + @status_code = status_code + @raw_response = raw_response + @channel = channel + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @content_type == other.content_type + return false unless @status_code == other.status_code + return false unless @raw_response == other.raw_response + return false unless @channel == other.channel + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/createchannel_response.rbi b/lib/moderation_api/models/operations/createchannel_response.rbi new file mode 100644 index 00000000..75040e1e --- /dev/null +++ b/lib/moderation_api/models/operations/createchannel_response.rbi @@ -0,0 +1,32 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::CreateChannelResponse + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::CreateChannelResponse + def content_type + end + + def content_type=(str_) + end + + def status_code + end + + def status_code=(str_) + end + + def raw_response + end + + def raw_response=(str_) + end + + def channel + end + + def channel=(str_) + end +end diff --git a/lib/moderation_api/models/operations/createproject_request.rb b/lib/moderation_api/models/operations/createproject_request.rb new file mode 100644 index 00000000..1d6d685b --- /dev/null +++ b/lib/moderation_api/models/operations/createproject_request.rb @@ -0,0 +1,76 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class CreateProjectRequest + extend T::Sig + include Crystalline::MetadataFields + + # The project's name. + field( + :name, + ::String, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("name"), required: true}} + ) + # The website or app the project moderates content for. Used to write the context when none is given. + field( + :domain, + Crystalline::Nilable.new(::String), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("domain")}} + ) + # What the platform is and who uses it. + field( + :context, + Crystalline::Nilable.new(::String), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("context")}} + ) + # What you moderate, the problems you see and your guidelines. + field( + :brief, + Crystalline::Nilable.new(::String), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("brief")}} + ) + # Whether children use the platform. + field( + :used_by_minors, + Crystalline::Nilable.new(Crystalline::Boolean.new), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("usedByMinors")}} + ) + + sig { + params( + name: ::String, + domain: T.nilable(::String), + context: T.nilable(::String), + brief: T.nilable(::String), + used_by_minors: T.nilable(T::Boolean) + ) + .void + } + def initialize(name:, domain: nil, context: nil, brief: nil, used_by_minors: false) + @name = name + @domain = domain + @context = context + @brief = brief + @used_by_minors = used_by_minors + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @name == other.name + return false unless @domain == other.domain + return false unless @context == other.context + return false unless @brief == other.brief + return false unless @used_by_minors == other.used_by_minors + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/createproject_request.rbi b/lib/moderation_api/models/operations/createproject_request.rbi new file mode 100644 index 00000000..6e206203 --- /dev/null +++ b/lib/moderation_api/models/operations/createproject_request.rbi @@ -0,0 +1,38 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::CreateProjectRequest + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::CreateProjectRequest + def name + end + + def name=(str_) + end + + def domain + end + + def domain=(str_) + end + + def context + end + + def context=(str_) + end + + def brief + end + + def brief=(str_) + end + + def used_by_minors + end + + def used_by_minors=(str_) + end +end diff --git a/lib/moderation_api/models/operations/createproject_response.rb b/lib/moderation_api/models/operations/createproject_response.rb new file mode 100644 index 00000000..19961bd7 --- /dev/null +++ b/lib/moderation_api/models/operations/createproject_response.rb @@ -0,0 +1,51 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class CreateProjectResponse + extend T::Sig + include Crystalline::MetadataFields + + # HTTP response content type for this operation + field :content_type, ::String + # HTTP response status code for this operation + field :status_code, ::Integer + # Raw HTTP response; suitable for custom response parsing + field :raw_response, ::Faraday::Response + # Project created successfully + field :project_with_key, Crystalline::Nilable.new(Models::Components::ProjectWithKey) + + sig { + params( + content_type: ::String, + status_code: ::Integer, + raw_response: ::Faraday::Response, + project_with_key: T.nilable(Models::Components::ProjectWithKey) + ) + .void + } + def initialize(content_type:, status_code:, raw_response:, project_with_key: nil) + @content_type = content_type + @status_code = status_code + @raw_response = raw_response + @project_with_key = project_with_key + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @content_type == other.content_type + return false unless @status_code == other.status_code + return false unless @raw_response == other.raw_response + return false unless @project_with_key == other.project_with_key + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/createproject_response.rbi b/lib/moderation_api/models/operations/createproject_response.rbi new file mode 100644 index 00000000..00698e13 --- /dev/null +++ b/lib/moderation_api/models/operations/createproject_response.rbi @@ -0,0 +1,32 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::CreateProjectResponse + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::CreateProjectResponse + def content_type + end + + def content_type=(str_) + end + + def status_code + end + + def status_code=(str_) + end + + def raw_response + end + + def raw_response=(str_) + end + + def project_with_key + end + + def project_with_key=(str_) + end +end diff --git a/lib/moderation_api/models/operations/createwebhook_eventtype_request.rb b/lib/moderation_api/models/operations/createwebhook_eventtype_request.rb new file mode 100644 index 00000000..6fa83bed --- /dev/null +++ b/lib/moderation_api/models/operations/createwebhook_eventtype_request.rb @@ -0,0 +1,27 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class CreateWebhookEventTypeRequest < T::Enum + enums do + QUEUE_ITEM_NEW = new("QUEUE_ITEM_NEW") + QUEUE_ITEM_COMPLETED = new("QUEUE_ITEM_COMPLETED") + QUEUE_ITEM_ACTION = new("QUEUE_ITEM_ACTION") + QUEUE_ITEM_REJECTED = new("QUEUE_ITEM_REJECTED") + QUEUE_ITEM_ALLOWED = new("QUEUE_ITEM_ALLOWED") + AUTHOR_BLOCKED = new("AUTHOR_BLOCKED") + AUTHOR_UNBLOCKED = new("AUTHOR_UNBLOCKED") + AUTHOR_SUSPENDED = new("AUTHOR_SUSPENDED") + AUTHOR_UPDATED = new("AUTHOR_UPDATED") + AUTHOR_TRUST_LEVEL_CHANGED = new("AUTHOR_TRUST_LEVEL_CHANGED") + AUTHOR_ACTION = new("AUTHOR_ACTION") + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/createwebhook_eventtype_request.rbi b/lib/moderation_api/models/operations/createwebhook_eventtype_request.rbi new file mode 100644 index 00000000..b6491900 --- /dev/null +++ b/lib/moderation_api/models/operations/createwebhook_eventtype_request.rbi @@ -0,0 +1,9 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::CreateWebhookEventTypeRequest + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::CreateWebhookEventTypeRequest +end diff --git a/lib/moderation_api/models/operations/createwebhook_eventtype_response.rb b/lib/moderation_api/models/operations/createwebhook_eventtype_response.rb new file mode 100644 index 00000000..2af04e6d --- /dev/null +++ b/lib/moderation_api/models/operations/createwebhook_eventtype_response.rb @@ -0,0 +1,30 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class CreateWebhookEventTypeResponse + include ::Crystalline::Enum + enums do + QUEUE_ITEM_NEW = new("QUEUE_ITEM_NEW") + QUEUE_ITEM_COMPLETED = new("QUEUE_ITEM_COMPLETED") + QUEUE_ITEM_ACTION = new("QUEUE_ITEM_ACTION") + QUEUE_ITEM_REJECTED = new("QUEUE_ITEM_REJECTED") + QUEUE_ITEM_ALLOWED = new("QUEUE_ITEM_ALLOWED") + AUTHOR_BLOCKED = new("AUTHOR_BLOCKED") + AUTHOR_UNBLOCKED = new("AUTHOR_UNBLOCKED") + AUTHOR_SUSPENDED = new("AUTHOR_SUSPENDED") + AUTHOR_UPDATED = new("AUTHOR_UPDATED") + AUTHOR_TRUST_LEVEL_CHANGED = new("AUTHOR_TRUST_LEVEL_CHANGED") + AUTHOR_ACTION = new("AUTHOR_ACTION") + end + + open! + end + end + end +end diff --git a/lib/moderation_api/models/operations/createwebhook_eventtype_response.rbi b/lib/moderation_api/models/operations/createwebhook_eventtype_response.rbi new file mode 100644 index 00000000..0f5fdf07 --- /dev/null +++ b/lib/moderation_api/models/operations/createwebhook_eventtype_response.rbi @@ -0,0 +1,9 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::CreateWebhookEventTypeResponse + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::CreateWebhookEventTypeResponse +end diff --git a/lib/moderation_api/models/operations/createwebhook_payloadversion.rb b/lib/moderation_api/models/operations/createwebhook_payloadversion.rb new file mode 100644 index 00000000..f0ec6848 --- /dev/null +++ b/lib/moderation_api/models/operations/createwebhook_payloadversion.rb @@ -0,0 +1,21 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + # CreateWebhookPayloadVersion - Payload envelope version. V2 is the Stripe-style envelope; V1 is the legacy flat shape and is read-only via this API. + class CreateWebhookPayloadVersion + include ::Crystalline::Enum + enums do + V1 = new("V1") + V2 = new("V2") + end + + open! + end + end + end +end diff --git a/lib/moderation_api/models/operations/createwebhook_payloadversion.rbi b/lib/moderation_api/models/operations/createwebhook_payloadversion.rbi new file mode 100644 index 00000000..646b9680 --- /dev/null +++ b/lib/moderation_api/models/operations/createwebhook_payloadversion.rbi @@ -0,0 +1,9 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::CreateWebhookPayloadVersion + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::CreateWebhookPayloadVersion +end diff --git a/lib/moderation_api/models/operations/createwebhook_request.rb b/lib/moderation_api/models/operations/createwebhook_request.rb new file mode 100644 index 00000000..c0b371f5 --- /dev/null +++ b/lib/moderation_api/models/operations/createwebhook_request.rb @@ -0,0 +1,63 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class CreateWebhookRequest + extend T::Sig + include Crystalline::MetadataFields + + # The webhook's name, used to identify it in the dashboard + field( + :name, + ::String, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("name"), required: true}} + ) + # The webhook's URL. We'll call this URL when an event occurs. + field :url, ::String, {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("url"), required: true}} + # Event types this webhook subscribes to. One webhook URL receives all events you list here. + field( + :event_types, + Crystalline::Array.new(Models::Operations::CreateWebhookEventTypeRequest), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("eventTypes"), required: true}} + ) + # The webhook's description + field( + :description, + Crystalline::Nilable.new(::String), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("description")}} + ) + + sig { + params( + name: ::String, + url: ::String, + event_types: T::Array[Models::Operations::CreateWebhookEventTypeRequest], + description: T.nilable(::String) + ) + .void + } + def initialize(name:, url:, event_types:, description: nil) + @name = name + @url = url + @event_types = event_types + @description = description + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @name == other.name + return false unless @url == other.url + return false unless @event_types == other.event_types + return false unless @description == other.description + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/createwebhook_request.rbi b/lib/moderation_api/models/operations/createwebhook_request.rbi new file mode 100644 index 00000000..a8c135ba --- /dev/null +++ b/lib/moderation_api/models/operations/createwebhook_request.rbi @@ -0,0 +1,32 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::CreateWebhookRequest + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::CreateWebhookRequest + def name + end + + def name=(str_) + end + + def url + end + + def url=(str_) + end + + def event_types + end + + def event_types=(str_) + end + + def description + end + + def description=(str_) + end +end diff --git a/lib/moderation_api/models/operations/createwebhook_response.rb b/lib/moderation_api/models/operations/createwebhook_response.rb new file mode 100644 index 00000000..d5fdf618 --- /dev/null +++ b/lib/moderation_api/models/operations/createwebhook_response.rb @@ -0,0 +1,51 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class CreateWebhookResponse + extend T::Sig + include Crystalline::MetadataFields + + # HTTP response content type for this operation + field :content_type, ::String + # HTTP response status code for this operation + field :status_code, ::Integer + # Raw HTTP response; suitable for custom response parsing + field :raw_response, ::Faraday::Response + # Webhook created successfully + field :object, Crystalline::Nilable.new(Models::Operations::CreateWebhookResponseBody) + + sig { + params( + content_type: ::String, + status_code: ::Integer, + raw_response: ::Faraday::Response, + object: T.nilable(Models::Operations::CreateWebhookResponseBody) + ) + .void + } + def initialize(content_type:, status_code:, raw_response:, object: nil) + @content_type = content_type + @status_code = status_code + @raw_response = raw_response + @object = object + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @content_type == other.content_type + return false unless @status_code == other.status_code + return false unless @raw_response == other.raw_response + return false unless @object == other.object + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/createwebhook_response.rbi b/lib/moderation_api/models/operations/createwebhook_response.rbi new file mode 100644 index 00000000..a54022c6 --- /dev/null +++ b/lib/moderation_api/models/operations/createwebhook_response.rbi @@ -0,0 +1,32 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::CreateWebhookResponse + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::CreateWebhookResponse + def content_type + end + + def content_type=(str_) + end + + def status_code + end + + def status_code=(str_) + end + + def raw_response + end + + def raw_response=(str_) + end + + def object + end + + def object=(str_) + end +end diff --git a/lib/moderation_api/models/operations/createwebhook_responsebody.rb b/lib/moderation_api/models/operations/createwebhook_responsebody.rb new file mode 100644 index 00000000..a1113b8f --- /dev/null +++ b/lib/moderation_api/models/operations/createwebhook_responsebody.rb @@ -0,0 +1,95 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + # Webhook created successfully + class CreateWebhookResponseBody + extend T::Sig + include Crystalline::MetadataFields + + # The ID of the webhook. + field :id, ::String, {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("id"), required: true}} + # The webhook's name. + field( + :name, + ::String, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("name"), required: true}} + ) + # The URL we call when a subscribed event occurs. + field :url, ::String, {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("url"), required: true}} + # Event types this webhook subscribes to. Empty for legacy v1 webhooks, which subscribe via their single deprecated `type` instead. + field( + :event_types, + Crystalline::Array.new(Models::Operations::CreateWebhookEventTypeResponse), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("eventTypes"), required: true}} + ) + # Payload envelope version. V2 is the Stripe-style envelope; V1 is the legacy flat shape and is read-only via this API. + field( + :payload_version, + Models::Operations::CreateWebhookPayloadVersion, + { + 'format_json': { + 'letter_case': ::ModerationApi::Utils.field_name("payloadVersion"), + required: true, + 'decoder': ::ModerationApi::Utils.open_enum_from_string( + Models::Operations::CreateWebhookPayloadVersion, + false + ) + } + } + ) + # The date the webhook was created. + field( + :created_at, + ::String, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("createdAt"), required: true}} + ) + # The webhook's description. + field( + :description, + Crystalline::Nilable.new(::String), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("description")}} + ) + + sig { + params( + id: ::String, + name: ::String, + url: ::String, + event_types: T::Array[Models::Operations::CreateWebhookEventTypeResponse], + payload_version: Models::Operations::CreateWebhookPayloadVersion, + created_at: ::String, + description: T.nilable(::String) + ) + .void + } + def initialize(id:, name:, url:, event_types:, payload_version:, created_at:, description: nil) + @id = id + @name = name + @url = url + @event_types = event_types + @payload_version = payload_version + @created_at = created_at + @description = description + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @id == other.id + return false unless @name == other.name + return false unless @url == other.url + return false unless @event_types == other.event_types + return false unless @payload_version == other.payload_version + return false unless @created_at == other.created_at + return false unless @description == other.description + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/createwebhook_responsebody.rbi b/lib/moderation_api/models/operations/createwebhook_responsebody.rbi new file mode 100644 index 00000000..77b3a620 --- /dev/null +++ b/lib/moderation_api/models/operations/createwebhook_responsebody.rbi @@ -0,0 +1,50 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::CreateWebhookResponseBody + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::CreateWebhookResponseBody + def id + end + + def id=(str_) + end + + def name + end + + def name=(str_) + end + + def url + end + + def url=(str_) + end + + def event_types + end + + def event_types=(str_) + end + + def payload_version + end + + def payload_version=(str_) + end + + def created_at + end + + def created_at=(str_) + end + + def description + end + + def description=(str_) + end +end diff --git a/lib/moderation_api/models/operations/crypto.rb b/lib/moderation_api/models/operations/crypto.rb new file mode 100644 index 00000000..a11f1bbd --- /dev/null +++ b/lib/moderation_api/models/operations/crypto.rb @@ -0,0 +1,50 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class Crypto + extend T::Sig + include Crystalline::MetadataFields + + field( + :flag, + Crystalline::Boolean.new, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("flag"), required: true}} + ) + + field( + :threshold, + Crystalline::Nilable.new(::Float), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("threshold")}} + ) + + field :id, ::String, {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("id"), required: true}} + + sig { params(flag: T::Boolean, threshold: T.nilable(::Float), id: ::String).void } + def initialize(flag:, threshold: nil, id: "crypto") + @flag = flag + @threshold = threshold + unless id == "crypto" + raise ArgumentError, "Invalid value for id" + end + + @id = "crypto" + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @flag == other.flag + return false unless @threshold == other.threshold + return false unless @id == other.id + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/crypto.rbi b/lib/moderation_api/models/operations/crypto.rbi new file mode 100644 index 00000000..e1b5c3e9 --- /dev/null +++ b/lib/moderation_api/models/operations/crypto.rbi @@ -0,0 +1,26 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::Crypto + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::Crypto + def flag + end + + def flag=(str_) + end + + def threshold + end + + def threshold=(str_) + end + + def id + end + + def id=(str_) + end +end diff --git a/lib/moderation_api/models/operations/curiosity_insight.rb b/lib/moderation_api/models/operations/curiosity_insight.rb new file mode 100644 index 00000000..f7e8a918 --- /dev/null +++ b/lib/moderation_api/models/operations/curiosity_insight.rb @@ -0,0 +1,62 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + # Curiosity insight. Attempts to clarify or ask follow-up questions to better understand another person or idea. + class CuriosityInsight + extend T::Sig + include Crystalline::MetadataFields + + field( + :probability, + ::Float, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("probability"), required: true}} + ) + + field :id, ::String, {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("id"), required: true}} + + field( + :type, + ::String, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("type"), required: true}} + ) + # Whether the content shows curiosity. + field( + :value, + Crystalline::Nilable.new(Crystalline::Boolean.new), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("value"), required: true}} + ) + + sig { params(probability: ::Float, id: ::String, type: ::String, value: T.nilable(T::Boolean)).void } + def initialize(probability:, id: "curiosity", type: "insight", value: nil) + @probability = probability + unless id == "curiosity" + raise ArgumentError, "Invalid value for id" + end + + @id = "curiosity" + unless type == "insight" + raise ArgumentError, "Invalid value for type" + end + + @type = "insight" + @value = value + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @probability == other.probability + return false unless @id == other.id + return false unless @type == other.type + return false unless @value == other.value + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/curiosity_insight.rbi b/lib/moderation_api/models/operations/curiosity_insight.rbi new file mode 100644 index 00000000..e6aae622 --- /dev/null +++ b/lib/moderation_api/models/operations/curiosity_insight.rbi @@ -0,0 +1,32 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::CuriosityInsight + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::CuriosityInsight + def probability + end + + def probability=(str_) + end + + def id + end + + def id=(str_) + end + + def type + end + + def type=(str_) + end + + def value + end + + def value=(str_) + end +end diff --git a/lib/moderation_api/models/operations/current_project.rb b/lib/moderation_api/models/operations/current_project.rb new file mode 100644 index 00000000..4e06f079 --- /dev/null +++ b/lib/moderation_api/models/operations/current_project.rb @@ -0,0 +1,39 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class CurrentProject + extend T::Sig + include Crystalline::MetadataFields + + # ID of the current project + field :id, ::String, {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("id"), required: true}} + # Name of the current project + field( + :name, + ::String, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("name"), required: true}} + ) + + sig { params(id: ::String, name: ::String).void } + def initialize(id:, name:) + @id = id + @name = name + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @id == other.id + return false unless @name == other.name + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/current_project.rbi b/lib/moderation_api/models/operations/current_project.rbi new file mode 100644 index 00000000..d2ac61bf --- /dev/null +++ b/lib/moderation_api/models/operations/current_project.rbi @@ -0,0 +1,20 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::CurrentProject + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::CurrentProject + def id + end + + def id=(str_) + end + + def name + end + + def name=(str_) + end +end diff --git a/lib/moderation_api/models/operations/dailyreviewcount.rb b/lib/moderation_api/models/operations/dailyreviewcount.rb new file mode 100644 index 00000000..b73b4d9a --- /dev/null +++ b/lib/moderation_api/models/operations/dailyreviewcount.rb @@ -0,0 +1,43 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class DailyReviewCount + extend T::Sig + include Crystalline::MetadataFields + + # Date in YYYY-MM-DD format + field( + :date, + ::String, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("date"), required: true}} + ) + # Number of reviews on this date + field( + :count, + ::Float, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("count"), required: true}} + ) + + sig { params(date: ::String, count: ::Float).void } + def initialize(date:, count:) + @date = date + @count = count + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @date == other.date + return false unless @count == other.count + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/dailyreviewcount.rbi b/lib/moderation_api/models/operations/dailyreviewcount.rbi new file mode 100644 index 00000000..cb1a9eeb --- /dev/null +++ b/lib/moderation_api/models/operations/dailyreviewcount.rbi @@ -0,0 +1,20 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::DailyReviewCount + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::DailyReviewCount + def date + end + + def date=(str_) + end + + def count + end + + def count=(str_) + end +end diff --git a/lib/moderation_api/models/operations/data_audio.rb b/lib/moderation_api/models/operations/data_audio.rb new file mode 100644 index 00000000..ae2a5c83 --- /dev/null +++ b/lib/moderation_api/models/operations/data_audio.rb @@ -0,0 +1,43 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + # Audio + class DataAudio + extend T::Sig + include Crystalline::MetadataFields + + # The URL of the audio content + field :url, ::String, {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("url"), required: true}} + + field( + :type, + ::String, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("type"), required: true}} + ) + + sig { params(url: ::String, type: ::String).void } + def initialize(url:, type: "audio") + @url = url + unless type == "audio" + raise ArgumentError, "Invalid value for type" + end + + @type = "audio" + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @url == other.url + return false unless @type == other.type + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/data_audio.rbi b/lib/moderation_api/models/operations/data_audio.rbi new file mode 100644 index 00000000..173a4903 --- /dev/null +++ b/lib/moderation_api/models/operations/data_audio.rbi @@ -0,0 +1,20 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::DataAudio + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::DataAudio + def url + end + + def url=(str_) + end + + def type + end + + def type=(str_) + end +end diff --git a/lib/moderation_api/models/operations/data_image.rb b/lib/moderation_api/models/operations/data_image.rb new file mode 100644 index 00000000..21c9bad6 --- /dev/null +++ b/lib/moderation_api/models/operations/data_image.rb @@ -0,0 +1,54 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + # Image + class DataImage + extend T::Sig + include Crystalline::MetadataFields + + field( + :type, + ::String, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("type"), required: true}} + ) + # A public URL of the image content. Either url or data must be provided. + field( + :url, + Crystalline::Nilable.new(::String), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("url")}} + ) + # Base64-encoded image data. Either url or data must be provided. Note: base64 images are not stored and will not appear in the review queue. + field( + :data, + Crystalline::Nilable.new(::String), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("data")}} + ) + + sig { params(type: ::String, url: T.nilable(::String), data: T.nilable(::String)).void } + def initialize(type: "image", url: nil, data: nil) + unless type == "image" + raise ArgumentError, "Invalid value for type" + end + + @type = "image" + @url = url + @data = data + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @type == other.type + return false unless @url == other.url + return false unless @data == other.data + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/data_image.rbi b/lib/moderation_api/models/operations/data_image.rbi new file mode 100644 index 00000000..7b4ce1b8 --- /dev/null +++ b/lib/moderation_api/models/operations/data_image.rbi @@ -0,0 +1,26 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::DataImage + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::DataImage + def type + end + + def type=(str_) + end + + def url + end + + def url=(str_) + end + + def data + end + + def data=(str_) + end +end diff --git a/lib/moderation_api/models/operations/data_text.rb b/lib/moderation_api/models/operations/data_text.rb new file mode 100644 index 00000000..40000a4d --- /dev/null +++ b/lib/moderation_api/models/operations/data_text.rb @@ -0,0 +1,47 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + # Text + class DataText + extend T::Sig + include Crystalline::MetadataFields + + # The content text + field( + :text, + ::String, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("text"), required: true}} + ) + + field( + :type, + ::String, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("type"), required: true}} + ) + + sig { params(text: ::String, type: ::String).void } + def initialize(text:, type: "text") + @text = text + unless type == "text" + raise ArgumentError, "Invalid value for type" + end + + @type = "text" + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @text == other.text + return false unless @type == other.type + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/data_text.rbi b/lib/moderation_api/models/operations/data_text.rbi new file mode 100644 index 00000000..28423717 --- /dev/null +++ b/lib/moderation_api/models/operations/data_text.rbi @@ -0,0 +1,20 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::DataText + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::DataText + def text + end + + def text=(str_) + end + + def type + end + + def type=(str_) + end +end diff --git a/lib/moderation_api/models/operations/data_video.rb b/lib/moderation_api/models/operations/data_video.rb new file mode 100644 index 00000000..32c1f90c --- /dev/null +++ b/lib/moderation_api/models/operations/data_video.rb @@ -0,0 +1,43 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + # Video + class DataVideo + extend T::Sig + include Crystalline::MetadataFields + + # A public URL of the video content + field :url, ::String, {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("url"), required: true}} + + field( + :type, + ::String, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("type"), required: true}} + ) + + sig { params(url: ::String, type: ::String).void } + def initialize(url:, type: "video") + @url = url + unless type == "video" + raise ArgumentError, "Invalid value for type" + end + + @type = "video" + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @url == other.url + return false unless @type == other.type + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/data_video.rbi b/lib/moderation_api/models/operations/data_video.rbi new file mode 100644 index 00000000..82c75ca9 --- /dev/null +++ b/lib/moderation_api/models/operations/data_video.rbi @@ -0,0 +1,20 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::DataVideo + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::DataVideo + def url + end + + def url=(str_) + end + + def type + end + + def type=(str_) + end +end diff --git a/lib/moderation_api/models/operations/deleteaction_request.rb b/lib/moderation_api/models/operations/deleteaction_request.rb new file mode 100644 index 00000000..80280b8b --- /dev/null +++ b/lib/moderation_api/models/operations/deleteaction_request.rb @@ -0,0 +1,31 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class DeleteActionRequest + extend T::Sig + include Crystalline::MetadataFields + + # The ID of the action to delete. + field :id, ::String, {'path_param': {'field_name': "id", 'style': "simple", 'explode': false}} + + sig { params(id: ::String).void } + def initialize(id:) + @id = id + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @id == other.id + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/deleteaction_request.rbi b/lib/moderation_api/models/operations/deleteaction_request.rbi new file mode 100644 index 00000000..e3e26ae7 --- /dev/null +++ b/lib/moderation_api/models/operations/deleteaction_request.rbi @@ -0,0 +1,14 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::DeleteActionRequest + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::DeleteActionRequest + def id + end + + def id=(str_) + end +end diff --git a/lib/moderation_api/models/operations/deleteaction_response.rb b/lib/moderation_api/models/operations/deleteaction_response.rb new file mode 100644 index 00000000..b57de42d --- /dev/null +++ b/lib/moderation_api/models/operations/deleteaction_response.rb @@ -0,0 +1,51 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class DeleteActionResponse + extend T::Sig + include Crystalline::MetadataFields + + # HTTP response content type for this operation + field :content_type, ::String + # HTTP response status code for this operation + field :status_code, ::Integer + # Raw HTTP response; suitable for custom response parsing + field :raw_response, ::Faraday::Response + # Action deleted successfully + field :object, Crystalline::Nilable.new(Models::Operations::DeleteActionResponseBody) + + sig { + params( + content_type: ::String, + status_code: ::Integer, + raw_response: ::Faraday::Response, + object: T.nilable(Models::Operations::DeleteActionResponseBody) + ) + .void + } + def initialize(content_type:, status_code:, raw_response:, object: nil) + @content_type = content_type + @status_code = status_code + @raw_response = raw_response + @object = object + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @content_type == other.content_type + return false unless @status_code == other.status_code + return false unless @raw_response == other.raw_response + return false unless @object == other.object + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/deleteaction_response.rbi b/lib/moderation_api/models/operations/deleteaction_response.rbi new file mode 100644 index 00000000..57b60bd8 --- /dev/null +++ b/lib/moderation_api/models/operations/deleteaction_response.rbi @@ -0,0 +1,32 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::DeleteActionResponse + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::DeleteActionResponse + def content_type + end + + def content_type=(str_) + end + + def status_code + end + + def status_code=(str_) + end + + def raw_response + end + + def raw_response=(str_) + end + + def object + end + + def object=(str_) + end +end diff --git a/lib/moderation_api/models/operations/deleteaction_responsebody.rb b/lib/moderation_api/models/operations/deleteaction_responsebody.rb new file mode 100644 index 00000000..2ed5aca8 --- /dev/null +++ b/lib/moderation_api/models/operations/deleteaction_responsebody.rb @@ -0,0 +1,39 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + # Action deleted successfully + class DeleteActionResponseBody + extend T::Sig + include Crystalline::MetadataFields + + # Whether the action was deleted. + field( + :deleted, + Crystalline::Boolean.new, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("deleted"), required: true}} + ) + # The ID of the action. + field :id, ::String, {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("id"), required: true}} + + sig { params(deleted: T::Boolean, id: ::String).void } + def initialize(deleted:, id:) + @deleted = deleted + @id = id + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @deleted == other.deleted + return false unless @id == other.id + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/deleteaction_responsebody.rbi b/lib/moderation_api/models/operations/deleteaction_responsebody.rbi new file mode 100644 index 00000000..64d2821e --- /dev/null +++ b/lib/moderation_api/models/operations/deleteaction_responsebody.rbi @@ -0,0 +1,20 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::DeleteActionResponseBody + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::DeleteActionResponseBody + def deleted + end + + def deleted=(str_) + end + + def id + end + + def id=(str_) + end +end diff --git a/lib/moderation_api/models/operations/deleteauthor_request.rb b/lib/moderation_api/models/operations/deleteauthor_request.rb new file mode 100644 index 00000000..367a8f4f --- /dev/null +++ b/lib/moderation_api/models/operations/deleteauthor_request.rb @@ -0,0 +1,31 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class DeleteAuthorRequest + extend T::Sig + include Crystalline::MetadataFields + + # Either external ID or the ID assigned by moderation API. + field :id, ::String, {'path_param': {'field_name': "id", 'style': "simple", 'explode': false}} + + sig { params(id: ::String).void } + def initialize(id:) + @id = id + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @id == other.id + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/deleteauthor_request.rbi b/lib/moderation_api/models/operations/deleteauthor_request.rbi new file mode 100644 index 00000000..6649262f --- /dev/null +++ b/lib/moderation_api/models/operations/deleteauthor_request.rbi @@ -0,0 +1,14 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::DeleteAuthorRequest + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::DeleteAuthorRequest + def id + end + + def id=(str_) + end +end diff --git a/lib/moderation_api/models/operations/deleteauthor_response.rb b/lib/moderation_api/models/operations/deleteauthor_response.rb new file mode 100644 index 00000000..8fe0f1e7 --- /dev/null +++ b/lib/moderation_api/models/operations/deleteauthor_response.rb @@ -0,0 +1,51 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class DeleteAuthorResponse + extend T::Sig + include Crystalline::MetadataFields + + # HTTP response content type for this operation + field :content_type, ::String + # HTTP response status code for this operation + field :status_code, ::Integer + # Raw HTTP response; suitable for custom response parsing + field :raw_response, ::Faraday::Response + # Successful response + field :object, Crystalline::Nilable.new(Models::Operations::DeleteAuthorResponseBody) + + sig { + params( + content_type: ::String, + status_code: ::Integer, + raw_response: ::Faraday::Response, + object: T.nilable(Models::Operations::DeleteAuthorResponseBody) + ) + .void + } + def initialize(content_type:, status_code:, raw_response:, object: nil) + @content_type = content_type + @status_code = status_code + @raw_response = raw_response + @object = object + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @content_type == other.content_type + return false unless @status_code == other.status_code + return false unless @raw_response == other.raw_response + return false unless @object == other.object + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/deleteauthor_response.rbi b/lib/moderation_api/models/operations/deleteauthor_response.rbi new file mode 100644 index 00000000..ba4bbcc5 --- /dev/null +++ b/lib/moderation_api/models/operations/deleteauthor_response.rbi @@ -0,0 +1,32 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::DeleteAuthorResponse + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::DeleteAuthorResponse + def content_type + end + + def content_type=(str_) + end + + def status_code + end + + def status_code=(str_) + end + + def raw_response + end + + def raw_response=(str_) + end + + def object + end + + def object=(str_) + end +end diff --git a/lib/moderation_api/models/operations/deleteauthor_responsebody.rb b/lib/moderation_api/models/operations/deleteauthor_responsebody.rb new file mode 100644 index 00000000..cb8d900b --- /dev/null +++ b/lib/moderation_api/models/operations/deleteauthor_responsebody.rb @@ -0,0 +1,34 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + # Successful response + class DeleteAuthorResponseBody + extend T::Sig + include Crystalline::MetadataFields + + field( + :success, + Crystalline::Boolean.new, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("success"), required: true}} + ) + + sig { params(success: T::Boolean).void } + def initialize(success:) + @success = success + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @success == other.success + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/deleteauthor_responsebody.rbi b/lib/moderation_api/models/operations/deleteauthor_responsebody.rbi new file mode 100644 index 00000000..0034131d --- /dev/null +++ b/lib/moderation_api/models/operations/deleteauthor_responsebody.rbi @@ -0,0 +1,14 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::DeleteAuthorResponseBody + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::DeleteAuthorResponseBody + def success + end + + def success=(str_) + end +end diff --git a/lib/moderation_api/models/operations/deletechannel_request.rb b/lib/moderation_api/models/operations/deletechannel_request.rb new file mode 100644 index 00000000..f788580e --- /dev/null +++ b/lib/moderation_api/models/operations/deletechannel_request.rb @@ -0,0 +1,31 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class DeleteChannelRequest + extend T::Sig + include Crystalline::MetadataFields + + # The ID of the channel. + field :id, ::String, {'path_param': {'field_name': "id", 'style': "simple", 'explode': false}} + + sig { params(id: ::String).void } + def initialize(id:) + @id = id + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @id == other.id + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/deletechannel_request.rbi b/lib/moderation_api/models/operations/deletechannel_request.rbi new file mode 100644 index 00000000..bc924e81 --- /dev/null +++ b/lib/moderation_api/models/operations/deletechannel_request.rbi @@ -0,0 +1,14 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::DeleteChannelRequest + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::DeleteChannelRequest + def id + end + + def id=(str_) + end +end diff --git a/lib/moderation_api/models/operations/deletechannel_response.rb b/lib/moderation_api/models/operations/deletechannel_response.rb new file mode 100644 index 00000000..32d12587 --- /dev/null +++ b/lib/moderation_api/models/operations/deletechannel_response.rb @@ -0,0 +1,51 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class DeleteChannelResponse + extend T::Sig + include Crystalline::MetadataFields + + # HTTP response content type for this operation + field :content_type, ::String + # HTTP response status code for this operation + field :status_code, ::Integer + # Raw HTTP response; suitable for custom response parsing + field :raw_response, ::Faraday::Response + # Channel deleted successfully + field :object, Crystalline::Nilable.new(Models::Operations::DeleteChannelResponseBody) + + sig { + params( + content_type: ::String, + status_code: ::Integer, + raw_response: ::Faraday::Response, + object: T.nilable(Models::Operations::DeleteChannelResponseBody) + ) + .void + } + def initialize(content_type:, status_code:, raw_response:, object: nil) + @content_type = content_type + @status_code = status_code + @raw_response = raw_response + @object = object + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @content_type == other.content_type + return false unless @status_code == other.status_code + return false unless @raw_response == other.raw_response + return false unless @object == other.object + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/deletechannel_response.rbi b/lib/moderation_api/models/operations/deletechannel_response.rbi new file mode 100644 index 00000000..a39b775c --- /dev/null +++ b/lib/moderation_api/models/operations/deletechannel_response.rbi @@ -0,0 +1,32 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::DeleteChannelResponse + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::DeleteChannelResponse + def content_type + end + + def content_type=(str_) + end + + def status_code + end + + def status_code=(str_) + end + + def raw_response + end + + def raw_response=(str_) + end + + def object + end + + def object=(str_) + end +end diff --git a/lib/moderation_api/models/operations/deletechannel_responsebody.rb b/lib/moderation_api/models/operations/deletechannel_responsebody.rb new file mode 100644 index 00000000..54209864 --- /dev/null +++ b/lib/moderation_api/models/operations/deletechannel_responsebody.rb @@ -0,0 +1,39 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + # Channel deleted successfully + class DeleteChannelResponseBody + extend T::Sig + include Crystalline::MetadataFields + + # Whether the channel was deleted. + field( + :deleted, + Crystalline::Boolean.new, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("deleted"), required: true}} + ) + # The ID of the channel. + field :id, ::String, {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("id"), required: true}} + + sig { params(deleted: T::Boolean, id: ::String).void } + def initialize(deleted:, id:) + @deleted = deleted + @id = id + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @deleted == other.deleted + return false unless @id == other.id + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/deletechannel_responsebody.rbi b/lib/moderation_api/models/operations/deletechannel_responsebody.rbi new file mode 100644 index 00000000..4c2ab07d --- /dev/null +++ b/lib/moderation_api/models/operations/deletechannel_responsebody.rbi @@ -0,0 +1,20 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::DeleteChannelResponseBody + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::DeleteChannelResponseBody + def deleted + end + + def deleted=(str_) + end + + def id + end + + def id=(str_) + end +end diff --git a/lib/moderation_api/models/operations/deleteproject_request.rb b/lib/moderation_api/models/operations/deleteproject_request.rb new file mode 100644 index 00000000..b41a23f6 --- /dev/null +++ b/lib/moderation_api/models/operations/deleteproject_request.rb @@ -0,0 +1,31 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class DeleteProjectRequest + extend T::Sig + include Crystalline::MetadataFields + + # The ID of the project. + field :id, ::String, {'path_param': {'field_name': "id", 'style': "simple", 'explode': false}} + + sig { params(id: ::String).void } + def initialize(id:) + @id = id + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @id == other.id + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/deleteproject_request.rbi b/lib/moderation_api/models/operations/deleteproject_request.rbi new file mode 100644 index 00000000..1254a5f2 --- /dev/null +++ b/lib/moderation_api/models/operations/deleteproject_request.rbi @@ -0,0 +1,14 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::DeleteProjectRequest + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::DeleteProjectRequest + def id + end + + def id=(str_) + end +end diff --git a/lib/moderation_api/models/operations/deleteproject_response.rb b/lib/moderation_api/models/operations/deleteproject_response.rb new file mode 100644 index 00000000..7ce1c00a --- /dev/null +++ b/lib/moderation_api/models/operations/deleteproject_response.rb @@ -0,0 +1,51 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class DeleteProjectResponse + extend T::Sig + include Crystalline::MetadataFields + + # HTTP response content type for this operation + field :content_type, ::String + # HTTP response status code for this operation + field :status_code, ::Integer + # Raw HTTP response; suitable for custom response parsing + field :raw_response, ::Faraday::Response + # Project deleted successfully + field :object, Crystalline::Nilable.new(Models::Operations::DeleteProjectResponseBody) + + sig { + params( + content_type: ::String, + status_code: ::Integer, + raw_response: ::Faraday::Response, + object: T.nilable(Models::Operations::DeleteProjectResponseBody) + ) + .void + } + def initialize(content_type:, status_code:, raw_response:, object: nil) + @content_type = content_type + @status_code = status_code + @raw_response = raw_response + @object = object + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @content_type == other.content_type + return false unless @status_code == other.status_code + return false unless @raw_response == other.raw_response + return false unless @object == other.object + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/deleteproject_response.rbi b/lib/moderation_api/models/operations/deleteproject_response.rbi new file mode 100644 index 00000000..f26bd208 --- /dev/null +++ b/lib/moderation_api/models/operations/deleteproject_response.rbi @@ -0,0 +1,32 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::DeleteProjectResponse + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::DeleteProjectResponse + def content_type + end + + def content_type=(str_) + end + + def status_code + end + + def status_code=(str_) + end + + def raw_response + end + + def raw_response=(str_) + end + + def object + end + + def object=(str_) + end +end diff --git a/lib/moderation_api/models/operations/deleteproject_responsebody.rb b/lib/moderation_api/models/operations/deleteproject_responsebody.rb new file mode 100644 index 00000000..a6fe3b09 --- /dev/null +++ b/lib/moderation_api/models/operations/deleteproject_responsebody.rb @@ -0,0 +1,39 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + # Project deleted successfully + class DeleteProjectResponseBody + extend T::Sig + include Crystalline::MetadataFields + + # Whether the project was deleted. + field( + :deleted, + Crystalline::Boolean.new, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("deleted"), required: true}} + ) + # The ID of the project. + field :id, ::String, {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("id"), required: true}} + + sig { params(deleted: T::Boolean, id: ::String).void } + def initialize(deleted:, id:) + @deleted = deleted + @id = id + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @deleted == other.deleted + return false unless @id == other.id + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/deleteproject_responsebody.rbi b/lib/moderation_api/models/operations/deleteproject_responsebody.rbi new file mode 100644 index 00000000..18c2a940 --- /dev/null +++ b/lib/moderation_api/models/operations/deleteproject_responsebody.rbi @@ -0,0 +1,20 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::DeleteProjectResponseBody + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::DeleteProjectResponseBody + def deleted + end + + def deleted=(str_) + end + + def id + end + + def id=(str_) + end +end diff --git a/lib/moderation_api/models/operations/deletewebhook_request.rb b/lib/moderation_api/models/operations/deletewebhook_request.rb new file mode 100644 index 00000000..4e777d4d --- /dev/null +++ b/lib/moderation_api/models/operations/deletewebhook_request.rb @@ -0,0 +1,31 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class DeleteWebhookRequest + extend T::Sig + include Crystalline::MetadataFields + + # The ID of the webhook to delete. + field :id, ::String, {'path_param': {'field_name': "id", 'style': "simple", 'explode': false}} + + sig { params(id: ::String).void } + def initialize(id:) + @id = id + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @id == other.id + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/deletewebhook_request.rbi b/lib/moderation_api/models/operations/deletewebhook_request.rbi new file mode 100644 index 00000000..378fd7d6 --- /dev/null +++ b/lib/moderation_api/models/operations/deletewebhook_request.rbi @@ -0,0 +1,14 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::DeleteWebhookRequest + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::DeleteWebhookRequest + def id + end + + def id=(str_) + end +end diff --git a/lib/moderation_api/models/operations/deletewebhook_response.rb b/lib/moderation_api/models/operations/deletewebhook_response.rb new file mode 100644 index 00000000..aea89ecf --- /dev/null +++ b/lib/moderation_api/models/operations/deletewebhook_response.rb @@ -0,0 +1,51 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class DeleteWebhookResponse + extend T::Sig + include Crystalline::MetadataFields + + # HTTP response content type for this operation + field :content_type, ::String + # HTTP response status code for this operation + field :status_code, ::Integer + # Raw HTTP response; suitable for custom response parsing + field :raw_response, ::Faraday::Response + # Webhook deleted successfully + field :object, Crystalline::Nilable.new(Models::Operations::DeleteWebhookResponseBody) + + sig { + params( + content_type: ::String, + status_code: ::Integer, + raw_response: ::Faraday::Response, + object: T.nilable(Models::Operations::DeleteWebhookResponseBody) + ) + .void + } + def initialize(content_type:, status_code:, raw_response:, object: nil) + @content_type = content_type + @status_code = status_code + @raw_response = raw_response + @object = object + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @content_type == other.content_type + return false unless @status_code == other.status_code + return false unless @raw_response == other.raw_response + return false unless @object == other.object + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/deletewebhook_response.rbi b/lib/moderation_api/models/operations/deletewebhook_response.rbi new file mode 100644 index 00000000..f27741dd --- /dev/null +++ b/lib/moderation_api/models/operations/deletewebhook_response.rbi @@ -0,0 +1,32 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::DeleteWebhookResponse + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::DeleteWebhookResponse + def content_type + end + + def content_type=(str_) + end + + def status_code + end + + def status_code=(str_) + end + + def raw_response + end + + def raw_response=(str_) + end + + def object + end + + def object=(str_) + end +end diff --git a/lib/moderation_api/models/operations/deletewebhook_responsebody.rb b/lib/moderation_api/models/operations/deletewebhook_responsebody.rb new file mode 100644 index 00000000..bfc09a01 --- /dev/null +++ b/lib/moderation_api/models/operations/deletewebhook_responsebody.rb @@ -0,0 +1,39 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + # Webhook deleted successfully + class DeleteWebhookResponseBody + extend T::Sig + include Crystalline::MetadataFields + + # Whether the webhook was deleted. + field( + :deleted, + Crystalline::Boolean.new, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("deleted"), required: true}} + ) + # The ID of the webhook. + field :id, ::String, {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("id"), required: true}} + + sig { params(deleted: T::Boolean, id: ::String).void } + def initialize(deleted:, id:) + @deleted = deleted + @id = id + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @deleted == other.deleted + return false unless @id == other.id + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/deletewebhook_responsebody.rbi b/lib/moderation_api/models/operations/deletewebhook_responsebody.rbi new file mode 100644 index 00000000..87f9c7c4 --- /dev/null +++ b/lib/moderation_api/models/operations/deletewebhook_responsebody.rbi @@ -0,0 +1,20 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::DeleteWebhookResponseBody + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::DeleteWebhookResponseBody + def deleted + end + + def deleted=(str_) + end + + def id + end + + def id=(str_) + end +end diff --git a/lib/moderation_api/models/operations/drugs.rb b/lib/moderation_api/models/operations/drugs.rb new file mode 100644 index 00000000..e3664cc3 --- /dev/null +++ b/lib/moderation_api/models/operations/drugs.rb @@ -0,0 +1,50 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class Drugs + extend T::Sig + include Crystalline::MetadataFields + + field( + :flag, + Crystalline::Boolean.new, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("flag"), required: true}} + ) + + field( + :threshold, + Crystalline::Nilable.new(::Float), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("threshold")}} + ) + + field :id, ::String, {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("id"), required: true}} + + sig { params(flag: T::Boolean, threshold: T.nilable(::Float), id: ::String).void } + def initialize(flag:, threshold: nil, id: "drugs") + @flag = flag + @threshold = threshold + unless id == "drugs" + raise ArgumentError, "Invalid value for id" + end + + @id = "drugs" + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @flag == other.flag + return false unless @threshold == other.threshold + return false unless @id == other.id + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/drugs.rbi b/lib/moderation_api/models/operations/drugs.rbi new file mode 100644 index 00000000..467659e9 --- /dev/null +++ b/lib/moderation_api/models/operations/drugs.rbi @@ -0,0 +1,26 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::Drugs + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::Drugs + def flag + end + + def flag=(str_) + end + + def threshold + end + + def threshold=(str_) + end + + def id + end + + def id=(str_) + end +end diff --git a/lib/moderation_api/models/operations/duplicatechannel_request.rb b/lib/moderation_api/models/operations/duplicatechannel_request.rb new file mode 100644 index 00000000..7c1594ce --- /dev/null +++ b/lib/moderation_api/models/operations/duplicatechannel_request.rb @@ -0,0 +1,35 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class DuplicateChannelRequest + extend T::Sig + include Crystalline::MetadataFields + + # The ID of the channel to copy. + field :id, ::String, {'path_param': {'field_name': "id", 'style': "simple", 'explode': false}} + + field :body, Models::Operations::DuplicateChannelRequestBody, {'request': {'media_type': "application/json"}} + + sig { params(id: ::String, body: Models::Operations::DuplicateChannelRequestBody).void } + def initialize(id:, body:) + @id = id + @body = body + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @id == other.id + return false unless @body == other.body + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/duplicatechannel_request.rbi b/lib/moderation_api/models/operations/duplicatechannel_request.rbi new file mode 100644 index 00000000..b15cd8b5 --- /dev/null +++ b/lib/moderation_api/models/operations/duplicatechannel_request.rbi @@ -0,0 +1,20 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::DuplicateChannelRequest + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::DuplicateChannelRequest + def id + end + + def id=(str_) + end + + def body + end + + def body=(str_) + end +end diff --git a/lib/moderation_api/models/operations/duplicatechannel_requestbody.rb b/lib/moderation_api/models/operations/duplicatechannel_requestbody.rb new file mode 100644 index 00000000..9d8b5429 --- /dev/null +++ b/lib/moderation_api/models/operations/duplicatechannel_requestbody.rb @@ -0,0 +1,43 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class DuplicateChannelRequestBody + extend T::Sig + include Crystalline::MetadataFields + + # Name of the copy. Defaults to the original name with "(copy)". + field( + :name, + Crystalline::Nilable.new(::String), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("name")}} + ) + # Key of the copy. Defaults to the original key with a timestamp. Must be unique in the project. + field( + :key, + Crystalline::Nilable.new(::String), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("key")}} + ) + + sig { params(name: T.nilable(::String), key: T.nilable(::String)).void } + def initialize(name: nil, key: nil) + @name = name + @key = key + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @name == other.name + return false unless @key == other.key + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/duplicatechannel_requestbody.rbi b/lib/moderation_api/models/operations/duplicatechannel_requestbody.rbi new file mode 100644 index 00000000..f3f0b2a9 --- /dev/null +++ b/lib/moderation_api/models/operations/duplicatechannel_requestbody.rbi @@ -0,0 +1,20 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::DuplicateChannelRequestBody + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::DuplicateChannelRequestBody + def name + end + + def name=(str_) + end + + def key + end + + def key=(str_) + end +end diff --git a/lib/moderation_api/models/operations/duplicatechannel_response.rb b/lib/moderation_api/models/operations/duplicatechannel_response.rb new file mode 100644 index 00000000..c07c9a07 --- /dev/null +++ b/lib/moderation_api/models/operations/duplicatechannel_response.rb @@ -0,0 +1,51 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class DuplicateChannelResponse + extend T::Sig + include Crystalline::MetadataFields + + # HTTP response content type for this operation + field :content_type, ::String + # HTTP response status code for this operation + field :status_code, ::Integer + # Raw HTTP response; suitable for custom response parsing + field :raw_response, ::Faraday::Response + # Channel duplicated successfully + field :channel, Crystalline::Nilable.new(Models::Components::Channel) + + sig { + params( + content_type: ::String, + status_code: ::Integer, + raw_response: ::Faraday::Response, + channel: T.nilable(Models::Components::Channel) + ) + .void + } + def initialize(content_type:, status_code:, raw_response:, channel: nil) + @content_type = content_type + @status_code = status_code + @raw_response = raw_response + @channel = channel + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @content_type == other.content_type + return false unless @status_code == other.status_code + return false unless @raw_response == other.raw_response + return false unless @channel == other.channel + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/duplicatechannel_response.rbi b/lib/moderation_api/models/operations/duplicatechannel_response.rbi new file mode 100644 index 00000000..3aa944a3 --- /dev/null +++ b/lib/moderation_api/models/operations/duplicatechannel_response.rbi @@ -0,0 +1,32 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::DuplicateChannelResponse + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::DuplicateChannelResponse + def content_type + end + + def content_type=(str_) + end + + def status_code + end + + def status_code=(str_) + end + + def raw_response + end + + def raw_response=(str_) + end + + def channel + end + + def channel=(str_) + end +end diff --git a/lib/moderation_api/models/operations/duplicateproject_request.rb b/lib/moderation_api/models/operations/duplicateproject_request.rb new file mode 100644 index 00000000..12c07c96 --- /dev/null +++ b/lib/moderation_api/models/operations/duplicateproject_request.rb @@ -0,0 +1,35 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class DuplicateProjectRequest + extend T::Sig + include Crystalline::MetadataFields + + # The ID of the project to copy. + field :id, ::String, {'path_param': {'field_name': "id", 'style': "simple", 'explode': false}} + + field :body, Models::Operations::DuplicateProjectRequestBody, {'request': {'media_type': "application/json"}} + + sig { params(id: ::String, body: Models::Operations::DuplicateProjectRequestBody).void } + def initialize(id:, body:) + @id = id + @body = body + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @id == other.id + return false unless @body == other.body + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/duplicateproject_request.rbi b/lib/moderation_api/models/operations/duplicateproject_request.rbi new file mode 100644 index 00000000..831b78a8 --- /dev/null +++ b/lib/moderation_api/models/operations/duplicateproject_request.rbi @@ -0,0 +1,20 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::DuplicateProjectRequest + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::DuplicateProjectRequest + def id + end + + def id=(str_) + end + + def body + end + + def body=(str_) + end +end diff --git a/lib/moderation_api/models/operations/duplicateproject_requestbody.rb b/lib/moderation_api/models/operations/duplicateproject_requestbody.rb new file mode 100644 index 00000000..e668ea5f --- /dev/null +++ b/lib/moderation_api/models/operations/duplicateproject_requestbody.rb @@ -0,0 +1,35 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class DuplicateProjectRequestBody + extend T::Sig + include Crystalline::MetadataFields + + # Name of the copy. Defaults to the original name with "(copy)". + field( + :name, + Crystalline::Nilable.new(::String), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("name")}} + ) + + sig { params(name: T.nilable(::String)).void } + def initialize(name: nil) + @name = name + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @name == other.name + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/duplicateproject_requestbody.rbi b/lib/moderation_api/models/operations/duplicateproject_requestbody.rbi new file mode 100644 index 00000000..645d2a25 --- /dev/null +++ b/lib/moderation_api/models/operations/duplicateproject_requestbody.rbi @@ -0,0 +1,14 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::DuplicateProjectRequestBody + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::DuplicateProjectRequestBody + def name + end + + def name=(str_) + end +end diff --git a/lib/moderation_api/models/operations/duplicateproject_response.rb b/lib/moderation_api/models/operations/duplicateproject_response.rb new file mode 100644 index 00000000..af3920e4 --- /dev/null +++ b/lib/moderation_api/models/operations/duplicateproject_response.rb @@ -0,0 +1,51 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class DuplicateProjectResponse + extend T::Sig + include Crystalline::MetadataFields + + # HTTP response content type for this operation + field :content_type, ::String + # HTTP response status code for this operation + field :status_code, ::Integer + # Raw HTTP response; suitable for custom response parsing + field :raw_response, ::Faraday::Response + # Project duplicated successfully + field :project_with_key, Crystalline::Nilable.new(Models::Components::ProjectWithKey) + + sig { + params( + content_type: ::String, + status_code: ::Integer, + raw_response: ::Faraday::Response, + project_with_key: T.nilable(Models::Components::ProjectWithKey) + ) + .void + } + def initialize(content_type:, status_code:, raw_response:, project_with_key: nil) + @content_type = content_type + @status_code = status_code + @raw_response = raw_response + @project_with_key = project_with_key + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @content_type == other.content_type + return false unless @status_code == other.status_code + return false unless @raw_response == other.raw_response + return false unless @project_with_key == other.project_with_key + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/duplicateproject_response.rbi b/lib/moderation_api/models/operations/duplicateproject_response.rbi new file mode 100644 index 00000000..e246606d --- /dev/null +++ b/lib/moderation_api/models/operations/duplicateproject_response.rbi @@ -0,0 +1,32 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::DuplicateProjectResponse + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::DuplicateProjectResponse + def content_type + end + + def content_type=(str_) + end + + def status_code + end + + def status_code=(str_) + end + + def raw_response + end + + def raw_response=(str_) + end + + def project_with_key + end + + def project_with_key=(str_) + end +end diff --git a/lib/moderation_api/models/operations/entities_1.rb b/lib/moderation_api/models/operations/entities_1.rb new file mode 100644 index 00000000..98e3bd5a --- /dev/null +++ b/lib/moderation_api/models/operations/entities_1.rb @@ -0,0 +1,80 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class Entities1 + extend T::Sig + include Crystalline::MetadataFields + + field( + :enable, + Crystalline::Nilable.new(Crystalline::Boolean.new), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("enable")}} + ) + + field( + :flag, + Crystalline::Nilable.new(Crystalline::Boolean.new), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("flag")}} + ) + + field( + :should_mask, + Crystalline::Nilable.new(Crystalline::Boolean.new), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("shouldMask")}} + ) + + field( + :mask, + Crystalline::Nilable.new(::String), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("mask")}} + ) + + field( + :additional_properties, + Crystalline::Nilable.new(Crystalline::Hash.new(Symbol, ::Object)), + { + 'format_json': { + 'letter_case': ::ModerationApi::Utils.field_name("additional_properties"), + 'additional_properties': true + } + } + ) + + sig { + params( + enable: T.nilable(T::Boolean), + flag: T.nilable(T::Boolean), + should_mask: T.nilable(T::Boolean), + mask: T.nilable(::String), + additional_properties: T.nilable(T::Hash[Symbol, ::Object]) + ) + .void + } + def initialize(enable: nil, flag: nil, should_mask: nil, mask: nil, additional_properties: nil) + @enable = enable + @flag = flag + @should_mask = should_mask + @mask = mask + @additional_properties = additional_properties + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @enable == other.enable + return false unless @flag == other.flag + return false unless @should_mask == other.should_mask + return false unless @mask == other.mask + return false unless @additional_properties == other.additional_properties + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/entities_1.rbi b/lib/moderation_api/models/operations/entities_1.rbi new file mode 100644 index 00000000..c03d2091 --- /dev/null +++ b/lib/moderation_api/models/operations/entities_1.rbi @@ -0,0 +1,38 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::Entities1 + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::Entities1 + def enable + end + + def enable=(str_) + end + + def flag + end + + def flag=(str_) + end + + def should_mask + end + + def should_mask=(str_) + end + + def mask + end + + def mask=(str_) + end + + def additional_properties + end + + def additional_properties=(str_) + end +end diff --git a/lib/moderation_api/models/operations/entities_2.rb b/lib/moderation_api/models/operations/entities_2.rb new file mode 100644 index 00000000..78e26920 --- /dev/null +++ b/lib/moderation_api/models/operations/entities_2.rb @@ -0,0 +1,80 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class Entities2 + extend T::Sig + include Crystalline::MetadataFields + + field( + :enable, + Crystalline::Nilable.new(Crystalline::Boolean.new), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("enable")}} + ) + + field( + :flag, + Crystalline::Nilable.new(Crystalline::Boolean.new), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("flag")}} + ) + + field( + :should_mask, + Crystalline::Nilable.new(Crystalline::Boolean.new), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("shouldMask")}} + ) + + field( + :mask, + Crystalline::Nilable.new(::String), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("mask")}} + ) + + field( + :additional_properties, + Crystalline::Nilable.new(Crystalline::Hash.new(Symbol, ::Object)), + { + 'format_json': { + 'letter_case': ::ModerationApi::Utils.field_name("additional_properties"), + 'additional_properties': true + } + } + ) + + sig { + params( + enable: T.nilable(T::Boolean), + flag: T.nilable(T::Boolean), + should_mask: T.nilable(T::Boolean), + mask: T.nilable(::String), + additional_properties: T.nilable(T::Hash[Symbol, ::Object]) + ) + .void + } + def initialize(enable: nil, flag: nil, should_mask: nil, mask: nil, additional_properties: nil) + @enable = enable + @flag = flag + @should_mask = should_mask + @mask = mask + @additional_properties = additional_properties + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @enable == other.enable + return false unless @flag == other.flag + return false unless @should_mask == other.should_mask + return false unless @mask == other.mask + return false unless @additional_properties == other.additional_properties + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/entities_2.rbi b/lib/moderation_api/models/operations/entities_2.rbi new file mode 100644 index 00000000..21f538c7 --- /dev/null +++ b/lib/moderation_api/models/operations/entities_2.rbi @@ -0,0 +1,38 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::Entities2 + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::Entities2 + def enable + end + + def enable=(str_) + end + + def flag + end + + def flag=(str_) + end + + def should_mask + end + + def should_mask=(str_) + end + + def mask + end + + def mask=(str_) + end + + def additional_properties + end + + def additional_properties=(str_) + end +end diff --git a/lib/moderation_api/models/operations/entity_matcher_output.rb b/lib/moderation_api/models/operations/entity_matcher_output.rb new file mode 100644 index 00000000..67bbcc50 --- /dev/null +++ b/lib/moderation_api/models/operations/entity_matcher_output.rb @@ -0,0 +1,84 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + # Entity matcher policy. + class EntityMatcherOutput + extend T::Sig + include Crystalline::MetadataFields + + field :id, ::String, {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("id"), required: true}} + + field( + :probability, + ::Float, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("probability"), required: true}} + ) + + field( + :flagged, + Crystalline::Boolean.new, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("flagged"), required: true}} + ) + + field( + :matches, + Crystalline::Array.new(Models::Operations::Match), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("matches"), required: true}} + ) + + field( + :type, + ::String, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("type"), required: true}} + ) + + field( + :flagged_fields, + Crystalline::Nilable.new(Crystalline::Array.new(::String)), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("flagged_fields")}} + ) + + sig { + params( + id: ::String, + probability: ::Float, + flagged: T::Boolean, + matches: T::Array[Models::Operations::Match], + type: ::String, + flagged_fields: T.nilable(T::Array[::String]) + ) + .void + } + def initialize(id:, probability:, flagged:, matches:, type: "entity_matcher", flagged_fields: nil) + @id = id + @probability = probability + @flagged = flagged + @matches = matches + unless type == "entity_matcher" + raise ArgumentError, "Invalid value for type" + end + + @type = "entity_matcher" + @flagged_fields = flagged_fields + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @id == other.id + return false unless @probability == other.probability + return false unless @flagged == other.flagged + return false unless @matches == other.matches + return false unless @type == other.type + return false unless @flagged_fields == other.flagged_fields + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/entity_matcher_output.rbi b/lib/moderation_api/models/operations/entity_matcher_output.rbi new file mode 100644 index 00000000..3593e44b --- /dev/null +++ b/lib/moderation_api/models/operations/entity_matcher_output.rbi @@ -0,0 +1,44 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::EntityMatcherOutput + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::EntityMatcherOutput + def id + end + + def id=(str_) + end + + def probability + end + + def probability=(str_) + end + + def flagged + end + + def flagged=(str_) + end + + def matches + end + + def matches=(str_) + end + + def type + end + + def type=(str_) + end + + def flagged_fields + end + + def flagged_fields=(str_) + end +end diff --git a/lib/moderation_api/models/operations/error.rb b/lib/moderation_api/models/operations/error.rb new file mode 100644 index 00000000..baa789db --- /dev/null +++ b/lib/moderation_api/models/operations/error.rb @@ -0,0 +1,38 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class Error + extend T::Sig + include Crystalline::MetadataFields + + field :id, ::String, {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("id"), required: true}} + + field( + :message, + ::String, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("message"), required: true}} + ) + + sig { params(id: ::String, message: ::String).void } + def initialize(id:, message:) + @id = id + @message = message + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @id == other.id + return false unless @message == other.message + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/error.rbi b/lib/moderation_api/models/operations/error.rbi new file mode 100644 index 00000000..06a8ed0c --- /dev/null +++ b/lib/moderation_api/models/operations/error.rbi @@ -0,0 +1,20 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::Error + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::Error + def id + end + + def id=(str_) + end + + def message + end + + def message=(str_) + end +end diff --git a/lib/moderation_api/models/operations/evaluation.rb b/lib/moderation_api/models/operations/evaluation.rb new file mode 100644 index 00000000..16b1de78 --- /dev/null +++ b/lib/moderation_api/models/operations/evaluation.rb @@ -0,0 +1,76 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + # The evaluation of the content after running the channel policies. + class Evaluation + extend T::Sig + include Crystalline::MetadataFields + + # Whether the content was flagged by any policy. + field( + :flagged, + Crystalline::Boolean.new, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("flagged"), required: true}} + ) + # The probability that the content should be flagged. + field( + :flag_probability, + ::Float, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("flag_probability"), required: true}} + ) + # The severity score of the content. A higher score indicates more severe content. + field( + :severity_score, + ::Float, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("severity_score"), required: true}} + ) + # Whether the content was flagged for Unicode spoofing. + field( + :unicode_spoofed, + Crystalline::Nilable.new(Crystalline::Boolean.new), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("unicode_spoofed")}} + ) + # Whether the content would have been flagged by analyze-only policies (flag: false). + field( + :shadow_flagged, + Crystalline::Nilable.new(Crystalline::Boolean.new), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("shadow_flagged")}} + ) + + sig { + params( + flagged: T::Boolean, + flag_probability: ::Float, + severity_score: ::Float, + unicode_spoofed: T.nilable(T::Boolean), + shadow_flagged: T.nilable(T::Boolean) + ) + .void + } + def initialize(flagged:, flag_probability:, severity_score:, unicode_spoofed: nil, shadow_flagged: nil) + @flagged = flagged + @flag_probability = flag_probability + @severity_score = severity_score + @unicode_spoofed = unicode_spoofed + @shadow_flagged = shadow_flagged + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @flagged == other.flagged + return false unless @flag_probability == other.flag_probability + return false unless @severity_score == other.severity_score + return false unless @unicode_spoofed == other.unicode_spoofed + return false unless @shadow_flagged == other.shadow_flagged + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/evaluation.rbi b/lib/moderation_api/models/operations/evaluation.rbi new file mode 100644 index 00000000..a5251987 --- /dev/null +++ b/lib/moderation_api/models/operations/evaluation.rbi @@ -0,0 +1,38 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::Evaluation + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::Evaluation + def flagged + end + + def flagged=(str_) + end + + def flag_probability + end + + def flag_probability=(str_) + end + + def severity_score + end + + def severity_score=(str_) + end + + def unicode_spoofed + end + + def unicode_spoofed=(str_) + end + + def shadow_flagged + end + + def shadow_flagged=(str_) + end +end diff --git a/lib/moderation_api/models/operations/executeaction_request.rb b/lib/moderation_api/models/operations/executeaction_request.rb new file mode 100644 index 00000000..7a2c8572 --- /dev/null +++ b/lib/moderation_api/models/operations/executeaction_request.rb @@ -0,0 +1,85 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + # Input parameters + class ExecuteActionRequest + extend T::Sig + include Crystalline::MetadataFields + + # ID or key of the action to execute + field( + :action_key, + ::String, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("actionKey"), required: true}} + ) + # IDs of the content items to apply the action to. Provide this or authorIds. + field( + :content_ids, + Crystalline::Nilable.new(Crystalline::Array.new(::String)), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("contentIds")}} + ) + # IDs of the authors to apply the action to. Provide this or contentIds. + field( + :author_ids, + Crystalline::Nilable.new(Crystalline::Array.new(::String)), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("authorIds")}} + ) + # Optional value to provide with the action + field( + :value, + Crystalline::Nilable.new(::String), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("value")}} + ) + # Optional queue ID if the action is queue-specific + field( + :queue_id, + Crystalline::Nilable.new(::String), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("queueId")}} + ) + # Optional duration in milliseconds for actions with timeouts + field( + :duration, + Crystalline::Nilable.new(::Float), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("duration")}} + ) + + sig { + params( + action_key: ::String, + content_ids: T.nilable(T::Array[::String]), + author_ids: T.nilable(T::Array[::String]), + value: T.nilable(::String), + queue_id: T.nilable(::String), + duration: T.nilable(::Float) + ) + .void + } + def initialize(action_key:, content_ids: nil, author_ids: nil, value: nil, queue_id: nil, duration: nil) + @action_key = action_key + @content_ids = content_ids + @author_ids = author_ids + @value = value + @queue_id = queue_id + @duration = duration + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @action_key == other.action_key + return false unless @content_ids == other.content_ids + return false unless @author_ids == other.author_ids + return false unless @value == other.value + return false unless @queue_id == other.queue_id + return false unless @duration == other.duration + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/executeaction_request.rbi b/lib/moderation_api/models/operations/executeaction_request.rbi new file mode 100644 index 00000000..533b4d84 --- /dev/null +++ b/lib/moderation_api/models/operations/executeaction_request.rbi @@ -0,0 +1,44 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::ExecuteActionRequest + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::ExecuteActionRequest + def action_key + end + + def action_key=(str_) + end + + def content_ids + end + + def content_ids=(str_) + end + + def author_ids + end + + def author_ids=(str_) + end + + def value + end + + def value=(str_) + end + + def queue_id + end + + def queue_id=(str_) + end + + def duration + end + + def duration=(str_) + end +end diff --git a/lib/moderation_api/models/operations/executeaction_response.rb b/lib/moderation_api/models/operations/executeaction_response.rb new file mode 100644 index 00000000..5e279e94 --- /dev/null +++ b/lib/moderation_api/models/operations/executeaction_response.rb @@ -0,0 +1,51 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class ExecuteActionResponse + extend T::Sig + include Crystalline::MetadataFields + + # HTTP response content type for this operation + field :content_type, ::String + # HTTP response status code for this operation + field :status_code, ::Integer + # Raw HTTP response; suitable for custom response parsing + field :raw_response, ::Faraday::Response + # Action executed successfully + field :object, Crystalline::Nilable.new(Models::Operations::ExecuteActionResponseBody) + + sig { + params( + content_type: ::String, + status_code: ::Integer, + raw_response: ::Faraday::Response, + object: T.nilable(Models::Operations::ExecuteActionResponseBody) + ) + .void + } + def initialize(content_type:, status_code:, raw_response:, object: nil) + @content_type = content_type + @status_code = status_code + @raw_response = raw_response + @object = object + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @content_type == other.content_type + return false unless @status_code == other.status_code + return false unless @raw_response == other.raw_response + return false unless @object == other.object + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/executeaction_response.rbi b/lib/moderation_api/models/operations/executeaction_response.rbi new file mode 100644 index 00000000..1e07d107 --- /dev/null +++ b/lib/moderation_api/models/operations/executeaction_response.rbi @@ -0,0 +1,32 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::ExecuteActionResponse + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::ExecuteActionResponse + def content_type + end + + def content_type=(str_) + end + + def status_code + end + + def status_code=(str_) + end + + def raw_response + end + + def raw_response=(str_) + end + + def object + end + + def object=(str_) + end +end diff --git a/lib/moderation_api/models/operations/executeaction_responsebody.rb b/lib/moderation_api/models/operations/executeaction_responsebody.rb new file mode 100644 index 00000000..2d868580 --- /dev/null +++ b/lib/moderation_api/models/operations/executeaction_responsebody.rb @@ -0,0 +1,35 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + # Execution result + class ExecuteActionResponseBody + extend T::Sig + include Crystalline::MetadataFields + + # Whether the action was executed successfully + field( + :success, + Crystalline::Boolean.new, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("success"), required: true}} + ) + + sig { params(success: T::Boolean).void } + def initialize(success:) + @success = success + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @success == other.success + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/executeaction_responsebody.rbi b/lib/moderation_api/models/operations/executeaction_responsebody.rbi new file mode 100644 index 00000000..305f5f67 --- /dev/null +++ b/lib/moderation_api/models/operations/executeaction_responsebody.rbi @@ -0,0 +1,14 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::ExecuteActionResponseBody + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::ExecuteActionResponseBody + def success + end + + def success=(str_) + end +end diff --git a/lib/moderation_api/models/operations/extremism.rb b/lib/moderation_api/models/operations/extremism.rb new file mode 100644 index 00000000..dba46c78 --- /dev/null +++ b/lib/moderation_api/models/operations/extremism.rb @@ -0,0 +1,50 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class Extremism + extend T::Sig + include Crystalline::MetadataFields + + field( + :flag, + Crystalline::Boolean.new, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("flag"), required: true}} + ) + + field( + :threshold, + Crystalline::Nilable.new(::Float), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("threshold")}} + ) + + field :id, ::String, {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("id"), required: true}} + + sig { params(flag: T::Boolean, threshold: T.nilable(::Float), id: ::String).void } + def initialize(flag:, threshold: nil, id: "extremism") + @flag = flag + @threshold = threshold + unless id == "extremism" + raise ArgumentError, "Invalid value for id" + end + + @id = "extremism" + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @flag == other.flag + return false unless @threshold == other.threshold + return false unless @id == other.id + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/extremism.rbi b/lib/moderation_api/models/operations/extremism.rbi new file mode 100644 index 00000000..99988b98 --- /dev/null +++ b/lib/moderation_api/models/operations/extremism.rbi @@ -0,0 +1,26 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::Extremism + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::Extremism + def flag + end + + def flag=(str_) + end + + def threshold + end + + def threshold=(str_) + end + + def id + end + + def id=(str_) + end +end diff --git a/lib/moderation_api/models/operations/face_detection.rb b/lib/moderation_api/models/operations/face_detection.rb new file mode 100644 index 00000000..8f44a70f --- /dev/null +++ b/lib/moderation_api/models/operations/face_detection.rb @@ -0,0 +1,80 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class FaceDetection + extend T::Sig + include Crystalline::MetadataFields + + field( + :flag, + Crystalline::Boolean.new, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("flag"), required: true}} + ) + + field( + :threshold, + Crystalline::Nilable.new(::Float), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("threshold")}} + ) + + field :id, ::String, {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("id"), required: true}} + # Flag images that contain "at least" or "fewer than" the configured number of faces. Defaults to at_least. + field( + :comparator, + Crystalline::Nilable.new(Models::Operations::Comparator), + { + 'format_json': { + 'letter_case': ::ModerationApi::Utils.field_name("comparator"), + 'decoder': ::ModerationApi::Utils.enum_from_string(Models::Operations::Comparator, true) + } + } + ) + # Number of faces the comparator applies to. Defaults to 1, so the default rule flags any image containing a face. + field( + :count, + Crystalline::Nilable.new(::Integer), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("count")}} + ) + + sig { + params( + flag: T::Boolean, + threshold: T.nilable(::Float), + id: ::String, + comparator: T.nilable(Models::Operations::Comparator), + count: T.nilable(::Integer) + ) + .void + } + def initialize(flag:, threshold: nil, id: "face_detection", comparator: nil, count: nil) + @flag = flag + @threshold = threshold + unless id == "face_detection" + raise ArgumentError, "Invalid value for id" + end + + @id = "face_detection" + @comparator = comparator + @count = count + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @flag == other.flag + return false unless @threshold == other.threshold + return false unless @id == other.id + return false unless @comparator == other.comparator + return false unless @count == other.count + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/face_detection.rbi b/lib/moderation_api/models/operations/face_detection.rbi new file mode 100644 index 00000000..551d8670 --- /dev/null +++ b/lib/moderation_api/models/operations/face_detection.rbi @@ -0,0 +1,38 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::FaceDetection + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::FaceDetection + def flag + end + + def flag=(str_) + end + + def threshold + end + + def threshold=(str_) + end + + def id + end + + def id=(str_) + end + + def comparator + end + + def comparator=(str_) + end + + def count + end + + def count=(str_) + end +end diff --git a/lib/moderation_api/models/operations/filter.rb b/lib/moderation_api/models/operations/filter.rb new file mode 100644 index 00000000..d4c3cb4c --- /dev/null +++ b/lib/moderation_api/models/operations/filter.rb @@ -0,0 +1,306 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class Filter + extend T::Sig + include Crystalline::MetadataFields + + field( + :is_flagged, + Crystalline::Nilable.new(Models::Operations::IsFlagged), + { + 'format_json': { + 'letter_case': ::ModerationApi::Utils.field_name("isFlagged"), + 'decoder': ::ModerationApi::Utils.open_enum_from_string(Models::Operations::IsFlagged, true) + } + } + ) + + field( + :casebook_answer, + Crystalline::Nilable.new(Models::Operations::CasebookAnswer), + { + 'format_json': { + 'letter_case': ::ModerationApi::Utils.field_name("casebookAnswer"), + 'decoder': ::ModerationApi::Utils.open_enum_from_string(Models::Operations::CasebookAnswer, true) + } + } + ) + + field( + :casebook_agreement, + Crystalline::Nilable.new(Models::Operations::CasebookAgreement), + { + 'format_json': { + 'letter_case': ::ModerationApi::Utils.field_name("casebookAgreement"), + 'decoder': ::ModerationApi::Utils.open_enum_from_string(Models::Operations::CasebookAgreement, true) + } + } + ) + + field( + :labels, + Crystalline::Nilable.new(Crystalline::Array.new(::String)), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("labels")}} + ) + + field( + :filter_labels, + Crystalline::Nilable.new(Crystalline::Array.new(Models::Operations::FilterLabel)), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("filterLabels")}} + ) + + field( + :metadata_filters, + Crystalline::Nilable.new(Crystalline::Array.new(Models::Operations::MetadataFilter)), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("metadataFilters")}} + ) + + field( + :filtered_channel_ids, + Crystalline::Nilable.new(Crystalline::Array.new(::String)), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("filteredChannelIds")}} + ) + + field( + :filtered_action_ids, + Crystalline::Nilable.new(Crystalline::Array.new(::String)), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("filteredActionIds")}} + ) + + field( + :languages, + Crystalline::Nilable.new(Crystalline::Array.new(::String)), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("languages")}} + ) + + field( + :content_types, + Crystalline::Nilable.new(Crystalline::Array.new(Models::Operations::GetQueueContentType)), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("contentTypes")}} + ) + + field( + :media_types, + Crystalline::Nilable.new(Crystalline::Array.new(Models::Operations::MediaType)), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("mediaTypes")}} + ) + + field( + :author_trust_levels, + Crystalline::Nilable.new(Crystalline::Array.new(::Integer)), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("authorTrustLevels")}} + ) + + field( + :recommendation_actions, + Crystalline::Nilable.new(Crystalline::Array.new(Models::Operations::GetQueueRecommendationAction)), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("recommendationActions")}} + ) + + field( + :min_severity, + Crystalline::Nilable.new(::Integer), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("minSeverity")}} + ) + + field( + :max_severity, + Crystalline::Nilable.new(::Integer), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("maxSeverity")}} + ) + + field( + :after_date, + Crystalline::Nilable.new(::String), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("afterDate")}} + ) + + field( + :before_date, + Crystalline::Nilable.new(::String), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("beforeDate")}} + ) + + field( + :within, + Crystalline::Nilable.new(::Float), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("within")}} + ) + + field( + :within_unit, + Crystalline::Nilable.new(Models::Operations::WithinUnit), + { + 'format_json': { + 'letter_case': ::ModerationApi::Utils.field_name("withinUnit"), + 'decoder': ::ModerationApi::Utils.open_enum_from_string(Models::Operations::WithinUnit, true) + } + } + ) + + field( + :clear_date_window, + Crystalline::Nilable.new(Crystalline::Boolean.new), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("clearDateWindow")}} + ) + + field( + :author_id, + Crystalline::Nilable.new(::String), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("authorID")}} + ) + + field( + :content_id, + Crystalline::Nilable.new(::String), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("contentID")}} + ) + + field( + :conversation_ids, + Crystalline::Nilable.new(Crystalline::Array.new(::String)), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("conversationIds")}} + ) + + field( + :search, + Crystalline::Nilable.new(Crystalline::Array.new(::String)), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("search")}} + ) + + field( + :check_status, + Crystalline::Nilable.new(Models::Operations::CheckStatus), + { + 'format_json': { + 'letter_case': ::ModerationApi::Utils.field_name("checkStatus"), + 'decoder': ::ModerationApi::Utils.open_enum_from_string(Models::Operations::CheckStatus, true) + } + } + ) + + sig { + params( + is_flagged: T.nilable(Models::Operations::IsFlagged), + casebook_answer: T.nilable(Models::Operations::CasebookAnswer), + casebook_agreement: T.nilable(Models::Operations::CasebookAgreement), + labels: T.nilable(T::Array[::String]), + filter_labels: T.nilable(T::Array[Models::Operations::FilterLabel]), + metadata_filters: T.nilable(T::Array[Models::Operations::MetadataFilter]), + filtered_channel_ids: T.nilable(T::Array[::String]), + filtered_action_ids: T.nilable(T::Array[::String]), + languages: T.nilable(T::Array[::String]), + content_types: T.nilable(T::Array[Models::Operations::GetQueueContentType]), + media_types: T.nilable(T::Array[Models::Operations::MediaType]), + author_trust_levels: T.nilable(T::Array[::Integer]), + recommendation_actions: T.nilable(T::Array[Models::Operations::GetQueueRecommendationAction]), + min_severity: T.nilable(::Integer), + max_severity: T.nilable(::Integer), + after_date: T.nilable(::String), + before_date: T.nilable(::String), + within: T.nilable(::Float), + within_unit: T.nilable(Models::Operations::WithinUnit), + clear_date_window: T.nilable(T::Boolean), + author_id: T.nilable(::String), + content_id: T.nilable(::String), + conversation_ids: T.nilable(T::Array[::String]), + search: T.nilable(T::Array[::String]), + check_status: T.nilable(Models::Operations::CheckStatus) + ) + .void + } + def initialize( + is_flagged: nil, + casebook_answer: nil, + casebook_agreement: nil, + labels: nil, + filter_labels: nil, + metadata_filters: nil, + filtered_channel_ids: nil, + filtered_action_ids: nil, + languages: nil, + content_types: nil, + media_types: nil, + author_trust_levels: nil, + recommendation_actions: nil, + min_severity: nil, + max_severity: nil, + after_date: nil, + before_date: nil, + within: nil, + within_unit: nil, + clear_date_window: nil, + author_id: nil, + content_id: nil, + conversation_ids: nil, + search: nil, + check_status: nil + ) + @is_flagged = is_flagged + @casebook_answer = casebook_answer + @casebook_agreement = casebook_agreement + @labels = labels + @filter_labels = filter_labels + @metadata_filters = metadata_filters + @filtered_channel_ids = filtered_channel_ids + @filtered_action_ids = filtered_action_ids + @languages = languages + @content_types = content_types + @media_types = media_types + @author_trust_levels = author_trust_levels + @recommendation_actions = recommendation_actions + @min_severity = min_severity + @max_severity = max_severity + @after_date = after_date + @before_date = before_date + @within = within + @within_unit = within_unit + @clear_date_window = clear_date_window + @author_id = author_id + @content_id = content_id + @conversation_ids = conversation_ids + @search = search + @check_status = check_status + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @is_flagged == other.is_flagged + return false unless @casebook_answer == other.casebook_answer + return false unless @casebook_agreement == other.casebook_agreement + return false unless @labels == other.labels + return false unless @filter_labels == other.filter_labels + return false unless @metadata_filters == other.metadata_filters + return false unless @filtered_channel_ids == other.filtered_channel_ids + return false unless @filtered_action_ids == other.filtered_action_ids + return false unless @languages == other.languages + return false unless @content_types == other.content_types + return false unless @media_types == other.media_types + return false unless @author_trust_levels == other.author_trust_levels + return false unless @recommendation_actions == other.recommendation_actions + return false unless @min_severity == other.min_severity + return false unless @max_severity == other.max_severity + return false unless @after_date == other.after_date + return false unless @before_date == other.before_date + return false unless @within == other.within + return false unless @within_unit == other.within_unit + return false unless @clear_date_window == other.clear_date_window + return false unless @author_id == other.author_id + return false unless @content_id == other.content_id + return false unless @conversation_ids == other.conversation_ids + return false unless @search == other.search + return false unless @check_status == other.check_status + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/filter.rbi b/lib/moderation_api/models/operations/filter.rbi new file mode 100644 index 00000000..0e057870 --- /dev/null +++ b/lib/moderation_api/models/operations/filter.rbi @@ -0,0 +1,158 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::Filter + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::Filter + def is_flagged + end + + def is_flagged=(str_) + end + + def casebook_answer + end + + def casebook_answer=(str_) + end + + def casebook_agreement + end + + def casebook_agreement=(str_) + end + + def labels + end + + def labels=(str_) + end + + def filter_labels + end + + def filter_labels=(str_) + end + + def metadata_filters + end + + def metadata_filters=(str_) + end + + def filtered_channel_ids + end + + def filtered_channel_ids=(str_) + end + + def filtered_action_ids + end + + def filtered_action_ids=(str_) + end + + def languages + end + + def languages=(str_) + end + + def content_types + end + + def content_types=(str_) + end + + def media_types + end + + def media_types=(str_) + end + + def author_trust_levels + end + + def author_trust_levels=(str_) + end + + def recommendation_actions + end + + def recommendation_actions=(str_) + end + + def min_severity + end + + def min_severity=(str_) + end + + def max_severity + end + + def max_severity=(str_) + end + + def after_date + end + + def after_date=(str_) + end + + def before_date + end + + def before_date=(str_) + end + + def within + end + + def within=(str_) + end + + def within_unit + end + + def within_unit=(str_) + end + + def clear_date_window + end + + def clear_date_window=(str_) + end + + def author_id + end + + def author_id=(str_) + end + + def content_id + end + + def content_id=(str_) + end + + def conversation_ids + end + + def conversation_ids=(str_) + end + + def search + end + + def search=(str_) + end + + def check_status + end + + def check_status=(str_) + end +end diff --git a/lib/moderation_api/models/operations/filterlabel.rb b/lib/moderation_api/models/operations/filterlabel.rb new file mode 100644 index 00000000..20fc0d53 --- /dev/null +++ b/lib/moderation_api/models/operations/filterlabel.rb @@ -0,0 +1,72 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class FilterLabel + extend T::Sig + include Crystalline::MetadataFields + + field( + :label, + ::String, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("label"), required: true}} + ) + + field( + :type, + Models::Operations::GetQueueType, + { + 'format_json': { + 'letter_case': ::ModerationApi::Utils.field_name("type"), + required: true, + 'decoder': ::ModerationApi::Utils.open_enum_from_string(Models::Operations::GetQueueType, false) + } + } + ) + + field( + :min_threshold, + Crystalline::Nilable.new(::Float), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("minThreshold")}} + ) + + field( + :max_threshold, + Crystalline::Nilable.new(::Float), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("maxThreshold")}} + ) + + sig { + params( + label: ::String, + type: Models::Operations::GetQueueType, + min_threshold: T.nilable(::Float), + max_threshold: T.nilable(::Float) + ) + .void + } + def initialize(label:, type:, min_threshold: nil, max_threshold: nil) + @label = label + @type = type + @min_threshold = min_threshold + @max_threshold = max_threshold + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @label == other.label + return false unless @type == other.type + return false unless @min_threshold == other.min_threshold + return false unless @max_threshold == other.max_threshold + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/filterlabel.rbi b/lib/moderation_api/models/operations/filterlabel.rbi new file mode 100644 index 00000000..a2751b40 --- /dev/null +++ b/lib/moderation_api/models/operations/filterlabel.rbi @@ -0,0 +1,32 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::FilterLabel + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::FilterLabel + def label + end + + def label=(str_) + end + + def type + end + + def type=(str_) + end + + def min_threshold + end + + def min_threshold=(str_) + end + + def max_threshold + end + + def max_threshold=(str_) + end +end diff --git a/lib/moderation_api/models/operations/flaggedcontenttrend.rb b/lib/moderation_api/models/operations/flaggedcontenttrend.rb new file mode 100644 index 00000000..bd37adee --- /dev/null +++ b/lib/moderation_api/models/operations/flaggedcontenttrend.rb @@ -0,0 +1,43 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class FlaggedContentTrend + extend T::Sig + include Crystalline::MetadataFields + + # Content flag/label + field( + :label, + ::String, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("label"), required: true}} + ) + # Trend indicator (-1 to 1) showing if this type of flagged content is increasing or decreasing + field( + :trend, + ::Float, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("trend"), required: true}} + ) + + sig { params(label: ::String, trend: ::Float).void } + def initialize(label:, trend:) + @label = label + @trend = trend + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @label == other.label + return false unless @trend == other.trend + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/flaggedcontenttrend.rbi b/lib/moderation_api/models/operations/flaggedcontenttrend.rbi new file mode 100644 index 00000000..9e856368 --- /dev/null +++ b/lib/moderation_api/models/operations/flaggedcontenttrend.rbi @@ -0,0 +1,20 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::FlaggedContentTrend + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::FlaggedContentTrend + def label + end + + def label=(str_) + end + + def trend + end + + def trend=(str_) + end +end diff --git a/lib/moderation_api/models/operations/flaggingmode.rb b/lib/moderation_api/models/operations/flaggingmode.rb new file mode 100644 index 00000000..96f4079c --- /dev/null +++ b/lib/moderation_api/models/operations/flaggingmode.rb @@ -0,0 +1,18 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + # FlaggingMode - `ACTIVE` flags content. `DRY_RUN` evaluates content without flagging it. + class FlaggingMode < T::Enum + enums do + DRY_RUN = new("DRY_RUN") + ACTIVE = new("ACTIVE") + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/flaggingmode.rbi b/lib/moderation_api/models/operations/flaggingmode.rbi new file mode 100644 index 00000000..d7e23187 --- /dev/null +++ b/lib/moderation_api/models/operations/flaggingmode.rbi @@ -0,0 +1,9 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::FlaggingMode + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::FlaggingMode +end diff --git a/lib/moderation_api/models/operations/gambling.rb b/lib/moderation_api/models/operations/gambling.rb new file mode 100644 index 00000000..39906acc --- /dev/null +++ b/lib/moderation_api/models/operations/gambling.rb @@ -0,0 +1,50 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class Gambling + extend T::Sig + include Crystalline::MetadataFields + + field( + :flag, + Crystalline::Boolean.new, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("flag"), required: true}} + ) + + field( + :threshold, + Crystalline::Nilable.new(::Float), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("threshold")}} + ) + + field :id, ::String, {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("id"), required: true}} + + sig { params(flag: T::Boolean, threshold: T.nilable(::Float), id: ::String).void } + def initialize(flag:, threshold: nil, id: "gambling") + @flag = flag + @threshold = threshold + unless id == "gambling" + raise ArgumentError, "Invalid value for id" + end + + @id = "gambling" + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @flag == other.flag + return false unless @threshold == other.threshold + return false unless @id == other.id + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/gambling.rbi b/lib/moderation_api/models/operations/gambling.rbi new file mode 100644 index 00000000..180dd37f --- /dev/null +++ b/lib/moderation_api/models/operations/gambling.rbi @@ -0,0 +1,26 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::Gambling + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::Gambling + def flag + end + + def flag=(str_) + end + + def threshold + end + + def threshold=(str_) + end + + def id + end + + def id=(str_) + end +end diff --git a/lib/moderation_api/models/operations/getaccount_response.rb b/lib/moderation_api/models/operations/getaccount_response.rb new file mode 100644 index 00000000..732dabca --- /dev/null +++ b/lib/moderation_api/models/operations/getaccount_response.rb @@ -0,0 +1,51 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class GetAccountResponse + extend T::Sig + include Crystalline::MetadataFields + + # HTTP response content type for this operation + field :content_type, ::String + # HTTP response status code for this operation + field :status_code, ::Integer + # Raw HTTP response; suitable for custom response parsing + field :raw_response, ::Faraday::Response + # Account details retrieved successfully + field :object, Crystalline::Nilable.new(Models::Operations::GetAccountResponseBody) + + sig { + params( + content_type: ::String, + status_code: ::Integer, + raw_response: ::Faraday::Response, + object: T.nilable(Models::Operations::GetAccountResponseBody) + ) + .void + } + def initialize(content_type:, status_code:, raw_response:, object: nil) + @content_type = content_type + @status_code = status_code + @raw_response = raw_response + @object = object + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @content_type == other.content_type + return false unless @status_code == other.status_code + return false unless @raw_response == other.raw_response + return false unless @object == other.object + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/getaccount_response.rbi b/lib/moderation_api/models/operations/getaccount_response.rbi new file mode 100644 index 00000000..10e812ad --- /dev/null +++ b/lib/moderation_api/models/operations/getaccount_response.rbi @@ -0,0 +1,32 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::GetAccountResponse + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::GetAccountResponse + def content_type + end + + def content_type=(str_) + end + + def status_code + end + + def status_code=(str_) + end + + def raw_response + end + + def raw_response=(str_) + end + + def object + end + + def object=(str_) + end +end diff --git a/lib/moderation_api/models/operations/getaccount_responsebody.rb b/lib/moderation_api/models/operations/getaccount_responsebody.rb new file mode 100644 index 00000000..81972e41 --- /dev/null +++ b/lib/moderation_api/models/operations/getaccount_responsebody.rb @@ -0,0 +1,72 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + # Account details retrieved successfully + class GetAccountResponseBody + extend T::Sig + include Crystalline::MetadataFields + + # ID of the account + field :id, ::String, {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("id"), required: true}} + # Name of the paid plan + field( + :paid_plan_name, + ::String, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("paid_plan_name"), required: true}} + ) + # Text API quota + field( + :text_api_quota, + ::Float, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("text_api_quota"), required: true}} + ) + # Remaining quota + field( + :remaining_quota, + ::Float, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("remaining_quota"), required: true}} + ) + + field( + :current_project, + Crystalline::Nilable.new(Models::Operations::CurrentProject), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("current_project")}} + ) + + sig { + params( + id: ::String, + paid_plan_name: ::String, + text_api_quota: ::Float, + remaining_quota: ::Float, + current_project: T.nilable(Models::Operations::CurrentProject) + ) + .void + } + def initialize(id:, paid_plan_name:, text_api_quota:, remaining_quota:, current_project: nil) + @id = id + @paid_plan_name = paid_plan_name + @text_api_quota = text_api_quota + @remaining_quota = remaining_quota + @current_project = current_project + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @id == other.id + return false unless @paid_plan_name == other.paid_plan_name + return false unless @text_api_quota == other.text_api_quota + return false unless @remaining_quota == other.remaining_quota + return false unless @current_project == other.current_project + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/getaccount_responsebody.rbi b/lib/moderation_api/models/operations/getaccount_responsebody.rbi new file mode 100644 index 00000000..7ee9c0fa --- /dev/null +++ b/lib/moderation_api/models/operations/getaccount_responsebody.rbi @@ -0,0 +1,38 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::GetAccountResponseBody + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::GetAccountResponseBody + def id + end + + def id=(str_) + end + + def paid_plan_name + end + + def paid_plan_name=(str_) + end + + def text_api_quota + end + + def text_api_quota=(str_) + end + + def remaining_quota + end + + def remaining_quota=(str_) + end + + def current_project + end + + def current_project=(str_) + end +end diff --git a/lib/moderation_api/models/operations/getaction_position.rb b/lib/moderation_api/models/operations/getaction_position.rb new file mode 100644 index 00000000..94a1d579 --- /dev/null +++ b/lib/moderation_api/models/operations/getaction_position.rb @@ -0,0 +1,22 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + # GetActionPosition - Show the action in all queues, selected queues or no queues (to use via API only). + class GetActionPosition + include ::Crystalline::Enum + enums do + ALL_QUEUES = new("ALL_QUEUES") + SOME_QUEUES = new("SOME_QUEUES") + HIDDEN = new("HIDDEN") + end + + open! + end + end + end +end diff --git a/lib/moderation_api/models/operations/getaction_position.rbi b/lib/moderation_api/models/operations/getaction_position.rbi new file mode 100644 index 00000000..e52f3281 --- /dev/null +++ b/lib/moderation_api/models/operations/getaction_position.rbi @@ -0,0 +1,9 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::GetActionPosition + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::GetActionPosition +end diff --git a/lib/moderation_api/models/operations/getaction_possiblevalue.rb b/lib/moderation_api/models/operations/getaction_possiblevalue.rb new file mode 100644 index 00000000..f31aaa47 --- /dev/null +++ b/lib/moderation_api/models/operations/getaction_possiblevalue.rb @@ -0,0 +1,35 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class GetActionPossibleValue + extend T::Sig + include Crystalline::MetadataFields + + # The value of the action. + field( + :value, + ::String, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("value"), required: true}} + ) + + sig { params(value: ::String).void } + def initialize(value:) + @value = value + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @value == other.value + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/getaction_possiblevalue.rbi b/lib/moderation_api/models/operations/getaction_possiblevalue.rbi new file mode 100644 index 00000000..5a84682d --- /dev/null +++ b/lib/moderation_api/models/operations/getaction_possiblevalue.rbi @@ -0,0 +1,14 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::GetActionPossibleValue + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::GetActionPossibleValue + def value + end + + def value=(str_) + end +end diff --git a/lib/moderation_api/models/operations/getaction_queuebehaviour.rb b/lib/moderation_api/models/operations/getaction_queuebehaviour.rb new file mode 100644 index 00000000..07e1daaf --- /dev/null +++ b/lib/moderation_api/models/operations/getaction_queuebehaviour.rb @@ -0,0 +1,22 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + # GetActionQueueBehaviour - Whether the action resolves and removes the item, unresolves and re-add it to the queue, or does not change the resolve status. + class GetActionQueueBehaviour + include ::Crystalline::Enum + enums do + REMOVE = new("REMOVE") + ADD = new("ADD") + NO_CHANGE = new("NO_CHANGE") + end + + open! + end + end + end +end diff --git a/lib/moderation_api/models/operations/getaction_queuebehaviour.rbi b/lib/moderation_api/models/operations/getaction_queuebehaviour.rbi new file mode 100644 index 00000000..7a62491c --- /dev/null +++ b/lib/moderation_api/models/operations/getaction_queuebehaviour.rbi @@ -0,0 +1,9 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::GetActionQueueBehaviour + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::GetActionQueueBehaviour +end diff --git a/lib/moderation_api/models/operations/getaction_request.rb b/lib/moderation_api/models/operations/getaction_request.rb new file mode 100644 index 00000000..c36959c6 --- /dev/null +++ b/lib/moderation_api/models/operations/getaction_request.rb @@ -0,0 +1,31 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class GetActionRequest + extend T::Sig + include Crystalline::MetadataFields + + # The ID of the action to get. + field :id, ::String, {'path_param': {'field_name': "id", 'style': "simple", 'explode': false}} + + sig { params(id: ::String).void } + def initialize(id:) + @id = id + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @id == other.id + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/getaction_request.rbi b/lib/moderation_api/models/operations/getaction_request.rbi new file mode 100644 index 00000000..883a76ac --- /dev/null +++ b/lib/moderation_api/models/operations/getaction_request.rbi @@ -0,0 +1,14 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::GetActionRequest + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::GetActionRequest + def id + end + + def id=(str_) + end +end diff --git a/lib/moderation_api/models/operations/getaction_response.rb b/lib/moderation_api/models/operations/getaction_response.rb new file mode 100644 index 00000000..f635c850 --- /dev/null +++ b/lib/moderation_api/models/operations/getaction_response.rb @@ -0,0 +1,51 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class GetActionResponse + extend T::Sig + include Crystalline::MetadataFields + + # HTTP response content type for this operation + field :content_type, ::String + # HTTP response status code for this operation + field :status_code, ::Integer + # Raw HTTP response; suitable for custom response parsing + field :raw_response, ::Faraday::Response + # Action retrieved successfully + field :object, Crystalline::Nilable.new(Models::Operations::GetActionResponseBody) + + sig { + params( + content_type: ::String, + status_code: ::Integer, + raw_response: ::Faraday::Response, + object: T.nilable(Models::Operations::GetActionResponseBody) + ) + .void + } + def initialize(content_type:, status_code:, raw_response:, object: nil) + @content_type = content_type + @status_code = status_code + @raw_response = raw_response + @object = object + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @content_type == other.content_type + return false unless @status_code == other.status_code + return false unless @raw_response == other.raw_response + return false unless @object == other.object + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/getaction_response.rbi b/lib/moderation_api/models/operations/getaction_response.rbi new file mode 100644 index 00000000..f3a37339 --- /dev/null +++ b/lib/moderation_api/models/operations/getaction_response.rbi @@ -0,0 +1,32 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::GetActionResponse + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::GetActionResponse + def content_type + end + + def content_type=(str_) + end + + def status_code + end + + def status_code=(str_) + end + + def raw_response + end + + def raw_response=(str_) + end + + def object + end + + def object=(str_) + end +end diff --git a/lib/moderation_api/models/operations/getaction_responsebody.rb b/lib/moderation_api/models/operations/getaction_responsebody.rb new file mode 100644 index 00000000..e04d97a9 --- /dev/null +++ b/lib/moderation_api/models/operations/getaction_responsebody.rb @@ -0,0 +1,173 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + # Action retrieved successfully + class GetActionResponseBody + extend T::Sig + include Crystalline::MetadataFields + + # The ID of the action. + field :id, ::String, {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("id"), required: true}} + # The date the action was created. + field( + :created_at, + ::String, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("createdAt"), required: true}} + ) + # The name of the action. + field( + :name, + ::String, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("name"), required: true}} + ) + # The IDs of the queues the action is available in. + field( + :filter_in_queue_ids, + Crystalline::Array.new(::String), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("filterInQueueIds"), required: true}} + ) + # The possible values of the action. The user will be prompted to select one of these values when executing the action. + field( + :possible_values, + Crystalline::Array.new(Models::Operations::GetActionPossibleValue), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("possibleValues"), required: true}} + ) + # User defined key of the action. + field( + :key, + Crystalline::Nilable.new(::String), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("key")}} + ) + # The description of the action. + field( + :description, + Crystalline::Nilable.new(::String), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("description")}} + ) + # The type of the action. + field( + :type, + Crystalline::Nilable.new(Models::Operations::GetActionType), + { + 'format_json': { + 'letter_case': ::ModerationApi::Utils.field_name("type"), + 'decoder': ::ModerationApi::Utils.open_enum_from_string(Models::Operations::GetActionType, true) + } + } + ) + # Whether the action resolves and removes the item, unresolves and re-add it to the queue, or does not change the resolve status. + field( + :queue_behaviour, + Crystalline::Nilable.new(Models::Operations::GetActionQueueBehaviour), + { + 'format_json': { + 'letter_case': ::ModerationApi::Utils.field_name("queueBehaviour"), + 'decoder': ::ModerationApi::Utils.open_enum_from_string(Models::Operations::GetActionQueueBehaviour, true) + } + } + ) + # Show the action in all queues, selected queues or no queues (to use via API only). + field( + :position, + Crystalline::Nilable.new(Models::Operations::GetActionPosition), + { + 'format_json': { + 'letter_case': ::ModerationApi::Utils.field_name("position"), + 'decoder': ::ModerationApi::Utils.open_enum_from_string(Models::Operations::GetActionPosition, true) + } + } + ) + # Whether the action requires a value to be executed. + field( + :value_required, + Crystalline::Nilable.new(Crystalline::Boolean.new), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("valueRequired")}} + ) + # Whether the action allows any text to be entered as a value or if it must be one of the possible values. + field( + :free_text, + Crystalline::Nilable.new(Crystalline::Boolean.new), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("freeText")}} + ) + # Whether the action is a built-in action or a custom one. + field( + :built_in, + Crystalline::Nilable.new(Crystalline::Boolean.new), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("builtIn")}} + ) + + sig { + params( + id: ::String, + created_at: ::String, + name: ::String, + filter_in_queue_ids: T::Array[::String], + possible_values: T::Array[Models::Operations::GetActionPossibleValue], + key: T.nilable(::String), + description: T.nilable(::String), + type: T.nilable(Models::Operations::GetActionType), + queue_behaviour: T.nilable(Models::Operations::GetActionQueueBehaviour), + position: T.nilable(Models::Operations::GetActionPosition), + value_required: T.nilable(T::Boolean), + free_text: T.nilable(T::Boolean), + built_in: T.nilable(T::Boolean) + ) + .void + } + def initialize( + id:, + created_at:, + name:, + filter_in_queue_ids:, + possible_values:, + key: nil, + description: nil, + type: nil, + queue_behaviour: Models::Operations::GetActionQueueBehaviour::NO_CHANGE, + position: Models::Operations::GetActionPosition::ALL_QUEUES, + value_required: false, + free_text: false, + built_in: false + ) + @id = id + @created_at = created_at + @name = name + @filter_in_queue_ids = filter_in_queue_ids + @possible_values = possible_values + @key = key + @description = description + @type = type + @queue_behaviour = queue_behaviour + @position = position + @value_required = value_required + @free_text = free_text + @built_in = built_in + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @id == other.id + return false unless @created_at == other.created_at + return false unless @name == other.name + return false unless @filter_in_queue_ids == other.filter_in_queue_ids + return false unless @possible_values == other.possible_values + return false unless @key == other.key + return false unless @description == other.description + return false unless @type == other.type + return false unless @queue_behaviour == other.queue_behaviour + return false unless @position == other.position + return false unless @value_required == other.value_required + return false unless @free_text == other.free_text + return false unless @built_in == other.built_in + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/getaction_responsebody.rbi b/lib/moderation_api/models/operations/getaction_responsebody.rbi new file mode 100644 index 00000000..8dd873c2 --- /dev/null +++ b/lib/moderation_api/models/operations/getaction_responsebody.rbi @@ -0,0 +1,86 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::GetActionResponseBody + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::GetActionResponseBody + def id + end + + def id=(str_) + end + + def created_at + end + + def created_at=(str_) + end + + def name + end + + def name=(str_) + end + + def filter_in_queue_ids + end + + def filter_in_queue_ids=(str_) + end + + def possible_values + end + + def possible_values=(str_) + end + + def key + end + + def key=(str_) + end + + def description + end + + def description=(str_) + end + + def type + end + + def type=(str_) + end + + def queue_behaviour + end + + def queue_behaviour=(str_) + end + + def position + end + + def position=(str_) + end + + def value_required + end + + def value_required=(str_) + end + + def free_text + end + + def free_text=(str_) + end + + def built_in + end + + def built_in=(str_) + end +end diff --git a/lib/moderation_api/models/operations/getaction_type.rb b/lib/moderation_api/models/operations/getaction_type.rb new file mode 100644 index 00000000..9053843a --- /dev/null +++ b/lib/moderation_api/models/operations/getaction_type.rb @@ -0,0 +1,29 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class GetActionType + include ::Crystalline::Enum + enums do + AUTHOR_BLOCK = new("AUTHOR_BLOCK") + AUTHOR_BLOCK_TEMP = new("AUTHOR_BLOCK_TEMP") + AUTHOR_UNBLOCK = new("AUTHOR_UNBLOCK") + AUTHOR_DELETE = new("AUTHOR_DELETE") + AUTHOR_REPORT = new("AUTHOR_REPORT") + AUTHOR_WARN = new("AUTHOR_WARN") + AUTHOR_CUSTOM = new("AUTHOR_CUSTOM") + ITEM_REJECT = new("ITEM_REJECT") + ITEM_ALLOW = new("ITEM_ALLOW") + ITEM_CUSTOM = new("ITEM_CUSTOM") + end + + open! + end + end + end +end diff --git a/lib/moderation_api/models/operations/getaction_type.rbi b/lib/moderation_api/models/operations/getaction_type.rbi new file mode 100644 index 00000000..6190ddb0 --- /dev/null +++ b/lib/moderation_api/models/operations/getaction_type.rbi @@ -0,0 +1,9 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::GetActionType + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::GetActionType +end diff --git a/lib/moderation_api/models/operations/getauthor_request.rb b/lib/moderation_api/models/operations/getauthor_request.rb new file mode 100644 index 00000000..8cd4418c --- /dev/null +++ b/lib/moderation_api/models/operations/getauthor_request.rb @@ -0,0 +1,31 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class GetAuthorRequest + extend T::Sig + include Crystalline::MetadataFields + + # Either external ID or the ID assigned by moderation API. + field :id, ::String, {'path_param': {'field_name': "id", 'style': "simple", 'explode': false}} + + sig { params(id: ::String).void } + def initialize(id:) + @id = id + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @id == other.id + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/getauthor_request.rbi b/lib/moderation_api/models/operations/getauthor_request.rbi new file mode 100644 index 00000000..c0341d62 --- /dev/null +++ b/lib/moderation_api/models/operations/getauthor_request.rbi @@ -0,0 +1,14 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::GetAuthorRequest + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::GetAuthorRequest + def id + end + + def id=(str_) + end +end diff --git a/lib/moderation_api/models/operations/getauthor_response.rb b/lib/moderation_api/models/operations/getauthor_response.rb new file mode 100644 index 00000000..10c480fd --- /dev/null +++ b/lib/moderation_api/models/operations/getauthor_response.rb @@ -0,0 +1,51 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class GetAuthorResponse + extend T::Sig + include Crystalline::MetadataFields + + # HTTP response content type for this operation + field :content_type, ::String + # HTTP response status code for this operation + field :status_code, ::Integer + # Raw HTTP response; suitable for custom response parsing + field :raw_response, ::Faraday::Response + # Successful response + field :public_author, Crystalline::Nilable.new(Models::Components::PublicAuthor) + + sig { + params( + content_type: ::String, + status_code: ::Integer, + raw_response: ::Faraday::Response, + public_author: T.nilable(Models::Components::PublicAuthor) + ) + .void + } + def initialize(content_type:, status_code:, raw_response:, public_author: nil) + @content_type = content_type + @status_code = status_code + @raw_response = raw_response + @public_author = public_author + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @content_type == other.content_type + return false unless @status_code == other.status_code + return false unless @raw_response == other.raw_response + return false unless @public_author == other.public_author + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/getauthor_response.rbi b/lib/moderation_api/models/operations/getauthor_response.rbi new file mode 100644 index 00000000..148d3c47 --- /dev/null +++ b/lib/moderation_api/models/operations/getauthor_response.rbi @@ -0,0 +1,32 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::GetAuthorResponse + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::GetAuthorResponse + def content_type + end + + def content_type=(str_) + end + + def status_code + end + + def status_code=(str_) + end + + def raw_response + end + + def raw_response=(str_) + end + + def public_author + end + + def public_author=(str_) + end +end diff --git a/lib/moderation_api/models/operations/getchannel_request.rb b/lib/moderation_api/models/operations/getchannel_request.rb new file mode 100644 index 00000000..89be0130 --- /dev/null +++ b/lib/moderation_api/models/operations/getchannel_request.rb @@ -0,0 +1,31 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class GetChannelRequest + extend T::Sig + include Crystalline::MetadataFields + + # The ID of the channel. + field :id, ::String, {'path_param': {'field_name': "id", 'style': "simple", 'explode': false}} + + sig { params(id: ::String).void } + def initialize(id:) + @id = id + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @id == other.id + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/getchannel_request.rbi b/lib/moderation_api/models/operations/getchannel_request.rbi new file mode 100644 index 00000000..5e17e3d8 --- /dev/null +++ b/lib/moderation_api/models/operations/getchannel_request.rbi @@ -0,0 +1,14 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::GetChannelRequest + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::GetChannelRequest + def id + end + + def id=(str_) + end +end diff --git a/lib/moderation_api/models/operations/getchannel_response.rb b/lib/moderation_api/models/operations/getchannel_response.rb new file mode 100644 index 00000000..8ea5b09b --- /dev/null +++ b/lib/moderation_api/models/operations/getchannel_response.rb @@ -0,0 +1,51 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class GetChannelResponse + extend T::Sig + include Crystalline::MetadataFields + + # HTTP response content type for this operation + field :content_type, ::String + # HTTP response status code for this operation + field :status_code, ::Integer + # Raw HTTP response; suitable for custom response parsing + field :raw_response, ::Faraday::Response + # Channel retrieved successfully + field :channel, Crystalline::Nilable.new(Models::Components::Channel) + + sig { + params( + content_type: ::String, + status_code: ::Integer, + raw_response: ::Faraday::Response, + channel: T.nilable(Models::Components::Channel) + ) + .void + } + def initialize(content_type:, status_code:, raw_response:, channel: nil) + @content_type = content_type + @status_code = status_code + @raw_response = raw_response + @channel = channel + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @content_type == other.content_type + return false unless @status_code == other.status_code + return false unless @raw_response == other.raw_response + return false unless @channel == other.channel + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/getchannel_response.rbi b/lib/moderation_api/models/operations/getchannel_response.rbi new file mode 100644 index 00000000..f2f3c763 --- /dev/null +++ b/lib/moderation_api/models/operations/getchannel_response.rbi @@ -0,0 +1,32 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::GetChannelResponse + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::GetChannelResponse + def content_type + end + + def content_type=(str_) + end + + def status_code + end + + def status_code=(str_) + end + + def raw_response + end + + def raw_response=(str_) + end + + def channel + end + + def channel=(str_) + end +end diff --git a/lib/moderation_api/models/operations/getproject_request.rb b/lib/moderation_api/models/operations/getproject_request.rb new file mode 100644 index 00000000..cc584d85 --- /dev/null +++ b/lib/moderation_api/models/operations/getproject_request.rb @@ -0,0 +1,31 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class GetProjectRequest + extend T::Sig + include Crystalline::MetadataFields + + # The ID of the project. + field :id, ::String, {'path_param': {'field_name': "id", 'style': "simple", 'explode': false}} + + sig { params(id: ::String).void } + def initialize(id:) + @id = id + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @id == other.id + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/getproject_request.rbi b/lib/moderation_api/models/operations/getproject_request.rbi new file mode 100644 index 00000000..80b5d8a9 --- /dev/null +++ b/lib/moderation_api/models/operations/getproject_request.rbi @@ -0,0 +1,14 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::GetProjectRequest + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::GetProjectRequest + def id + end + + def id=(str_) + end +end diff --git a/lib/moderation_api/models/operations/getproject_response.rb b/lib/moderation_api/models/operations/getproject_response.rb new file mode 100644 index 00000000..f60f072d --- /dev/null +++ b/lib/moderation_api/models/operations/getproject_response.rb @@ -0,0 +1,51 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class GetProjectResponse + extend T::Sig + include Crystalline::MetadataFields + + # HTTP response content type for this operation + field :content_type, ::String + # HTTP response status code for this operation + field :status_code, ::Integer + # Raw HTTP response; suitable for custom response parsing + field :raw_response, ::Faraday::Response + # Project retrieved successfully + field :project, Crystalline::Nilable.new(Models::Components::Project) + + sig { + params( + content_type: ::String, + status_code: ::Integer, + raw_response: ::Faraday::Response, + project: T.nilable(Models::Components::Project) + ) + .void + } + def initialize(content_type:, status_code:, raw_response:, project: nil) + @content_type = content_type + @status_code = status_code + @raw_response = raw_response + @project = project + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @content_type == other.content_type + return false unless @status_code == other.status_code + return false unless @raw_response == other.raw_response + return false unless @project == other.project + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/getproject_response.rbi b/lib/moderation_api/models/operations/getproject_response.rbi new file mode 100644 index 00000000..2180e775 --- /dev/null +++ b/lib/moderation_api/models/operations/getproject_response.rbi @@ -0,0 +1,32 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::GetProjectResponse + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::GetProjectResponse + def content_type + end + + def content_type=(str_) + end + + def status_code + end + + def status_code=(str_) + end + + def raw_response + end + + def raw_response=(str_) + end + + def project + end + + def project=(str_) + end +end diff --git a/lib/moderation_api/models/operations/getqueue_contenttype.rb b/lib/moderation_api/models/operations/getqueue_contenttype.rb new file mode 100644 index 00000000..d53c31b2 --- /dev/null +++ b/lib/moderation_api/models/operations/getqueue_contenttype.rb @@ -0,0 +1,28 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class GetQueueContentType + include ::Crystalline::Enum + enums do + PROFILE = new("profile") + MESSAGE = new("message") + POST = new("post") + COMMENT = new("comment") + EVENT = new("event") + PRODUCT = new("product") + REVIEW = new("review") + VOICE = new("voice") + OTHER = new("other") + end + + open! + end + end + end +end diff --git a/lib/moderation_api/models/operations/getqueue_contenttype.rbi b/lib/moderation_api/models/operations/getqueue_contenttype.rbi new file mode 100644 index 00000000..c6f19c2c --- /dev/null +++ b/lib/moderation_api/models/operations/getqueue_contenttype.rbi @@ -0,0 +1,9 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::GetQueueContentType + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::GetQueueContentType +end diff --git a/lib/moderation_api/models/operations/getqueue_recommendationaction.rb b/lib/moderation_api/models/operations/getqueue_recommendationaction.rb new file mode 100644 index 00000000..0c823be9 --- /dev/null +++ b/lib/moderation_api/models/operations/getqueue_recommendationaction.rb @@ -0,0 +1,22 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class GetQueueRecommendationAction + include ::Crystalline::Enum + enums do + REVIEW = new("review") + ALLOW = new("allow") + REJECT = new("reject") + end + + open! + end + end + end +end diff --git a/lib/moderation_api/models/operations/getqueue_recommendationaction.rbi b/lib/moderation_api/models/operations/getqueue_recommendationaction.rbi new file mode 100644 index 00000000..7cfb5c6c --- /dev/null +++ b/lib/moderation_api/models/operations/getqueue_recommendationaction.rbi @@ -0,0 +1,9 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::GetQueueRecommendationAction + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::GetQueueRecommendationAction +end diff --git a/lib/moderation_api/models/operations/getqueue_request.rb b/lib/moderation_api/models/operations/getqueue_request.rb new file mode 100644 index 00000000..e6a27b94 --- /dev/null +++ b/lib/moderation_api/models/operations/getqueue_request.rb @@ -0,0 +1,31 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class GetQueueRequest + extend T::Sig + include Crystalline::MetadataFields + + # The queue ID + field :id, ::String, {'path_param': {'field_name': "id", 'style': "simple", 'explode': false}} + + sig { params(id: ::String).void } + def initialize(id:) + @id = id + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @id == other.id + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/getqueue_request.rbi b/lib/moderation_api/models/operations/getqueue_request.rbi new file mode 100644 index 00000000..ab07f153 --- /dev/null +++ b/lib/moderation_api/models/operations/getqueue_request.rbi @@ -0,0 +1,14 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::GetQueueRequest + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::GetQueueRequest + def id + end + + def id=(str_) + end +end diff --git a/lib/moderation_api/models/operations/getqueue_response.rb b/lib/moderation_api/models/operations/getqueue_response.rb new file mode 100644 index 00000000..23bdedc9 --- /dev/null +++ b/lib/moderation_api/models/operations/getqueue_response.rb @@ -0,0 +1,51 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class GetQueueResponse + extend T::Sig + include Crystalline::MetadataFields + + # HTTP response content type for this operation + field :content_type, ::String + # HTTP response status code for this operation + field :status_code, ::Integer + # Raw HTTP response; suitable for custom response parsing + field :raw_response, ::Faraday::Response + # Successful response + field :object, Crystalline::Nilable.new(Models::Operations::GetQueueResponseBody) + + sig { + params( + content_type: ::String, + status_code: ::Integer, + raw_response: ::Faraday::Response, + object: T.nilable(Models::Operations::GetQueueResponseBody) + ) + .void + } + def initialize(content_type:, status_code:, raw_response:, object: nil) + @content_type = content_type + @status_code = status_code + @raw_response = raw_response + @object = object + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @content_type == other.content_type + return false unless @status_code == other.status_code + return false unless @raw_response == other.raw_response + return false unless @object == other.object + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/getqueue_response.rbi b/lib/moderation_api/models/operations/getqueue_response.rbi new file mode 100644 index 00000000..8817f904 --- /dev/null +++ b/lib/moderation_api/models/operations/getqueue_response.rbi @@ -0,0 +1,32 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::GetQueueResponse + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::GetQueueResponse + def content_type + end + + def content_type=(str_) + end + + def status_code + end + + def status_code=(str_) + end + + def raw_response + end + + def raw_response=(str_) + end + + def object + end + + def object=(str_) + end +end diff --git a/lib/moderation_api/models/operations/getqueue_responsebody.rb b/lib/moderation_api/models/operations/getqueue_responsebody.rb new file mode 100644 index 00000000..16fa080d --- /dev/null +++ b/lib/moderation_api/models/operations/getqueue_responsebody.rb @@ -0,0 +1,34 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + # Successful response + class GetQueueResponseBody + extend T::Sig + include Crystalline::MetadataFields + + field( + :queue, + Models::Operations::Queue, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("queue"), required: true}} + ) + + sig { params(queue: Models::Operations::Queue).void } + def initialize(queue:) + @queue = queue + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @queue == other.queue + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/getqueue_responsebody.rbi b/lib/moderation_api/models/operations/getqueue_responsebody.rbi new file mode 100644 index 00000000..81bf1295 --- /dev/null +++ b/lib/moderation_api/models/operations/getqueue_responsebody.rbi @@ -0,0 +1,14 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::GetQueueResponseBody + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::GetQueueResponseBody + def queue + end + + def queue=(str_) + end +end diff --git a/lib/moderation_api/models/operations/getqueue_type.rb b/lib/moderation_api/models/operations/getqueue_type.rb new file mode 100644 index 00000000..7f80516a --- /dev/null +++ b/lib/moderation_api/models/operations/getqueue_type.rb @@ -0,0 +1,23 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class GetQueueType + include ::Crystalline::Enum + enums do + FLAGGED = new("FLAGGED") + NOT_FLAGGED = new("NOT_FLAGGED") + THRESHOLDS = new("THRESHOLDS") + MATCHED = new("MATCHED") + end + + open! + end + end + end +end diff --git a/lib/moderation_api/models/operations/getqueue_type.rbi b/lib/moderation_api/models/operations/getqueue_type.rbi new file mode 100644 index 00000000..3ed92c2f --- /dev/null +++ b/lib/moderation_api/models/operations/getqueue_type.rbi @@ -0,0 +1,9 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::GetQueueType + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::GetQueueType +end diff --git a/lib/moderation_api/models/operations/getqueuestats_request.rb b/lib/moderation_api/models/operations/getqueuestats_request.rb new file mode 100644 index 00000000..aefc8c79 --- /dev/null +++ b/lib/moderation_api/models/operations/getqueuestats_request.rb @@ -0,0 +1,39 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class GetQueueStatsRequest + extend T::Sig + include Crystalline::MetadataFields + + # The queue ID + field :id, ::String, {'path_param': {'field_name': "id", 'style': "simple", 'explode': false}} + + field( + :within_days, + Crystalline::Nilable.new(::Integer), + {'query_param': {'field_name': "withinDays", 'style': "form", 'explode': true}} + ) + + sig { params(id: ::String, within_days: T.nilable(::Integer)).void } + def initialize(id:, within_days: 30) + @id = id + @within_days = within_days + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @id == other.id + return false unless @within_days == other.within_days + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/getqueuestats_request.rbi b/lib/moderation_api/models/operations/getqueuestats_request.rbi new file mode 100644 index 00000000..c4750313 --- /dev/null +++ b/lib/moderation_api/models/operations/getqueuestats_request.rbi @@ -0,0 +1,20 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::GetQueueStatsRequest + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::GetQueueStatsRequest + def id + end + + def id=(str_) + end + + def within_days + end + + def within_days=(str_) + end +end diff --git a/lib/moderation_api/models/operations/getqueuestats_response.rb b/lib/moderation_api/models/operations/getqueuestats_response.rb new file mode 100644 index 00000000..430490da --- /dev/null +++ b/lib/moderation_api/models/operations/getqueuestats_response.rb @@ -0,0 +1,51 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class GetQueueStatsResponse + extend T::Sig + include Crystalline::MetadataFields + + # HTTP response content type for this operation + field :content_type, ::String + # HTTP response status code for this operation + field :status_code, ::Integer + # Raw HTTP response; suitable for custom response parsing + field :raw_response, ::Faraday::Response + # Successful response + field :object, Crystalline::Nilable.new(Models::Operations::GetQueueStatsResponseBody) + + sig { + params( + content_type: ::String, + status_code: ::Integer, + raw_response: ::Faraday::Response, + object: T.nilable(Models::Operations::GetQueueStatsResponseBody) + ) + .void + } + def initialize(content_type:, status_code:, raw_response:, object: nil) + @content_type = content_type + @status_code = status_code + @raw_response = raw_response + @object = object + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @content_type == other.content_type + return false unless @status_code == other.status_code + return false unless @raw_response == other.raw_response + return false unless @object == other.object + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/getqueuestats_response.rbi b/lib/moderation_api/models/operations/getqueuestats_response.rbi new file mode 100644 index 00000000..4c872dbe --- /dev/null +++ b/lib/moderation_api/models/operations/getqueuestats_response.rbi @@ -0,0 +1,32 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::GetQueueStatsResponse + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::GetQueueStatsResponse + def content_type + end + + def content_type=(str_) + end + + def status_code + end + + def status_code=(str_) + end + + def raw_response + end + + def raw_response=(str_) + end + + def object + end + + def object=(str_) + end +end diff --git a/lib/moderation_api/models/operations/getqueuestats_responsebody.rb b/lib/moderation_api/models/operations/getqueuestats_responsebody.rb new file mode 100644 index 00000000..b5b1e982 --- /dev/null +++ b/lib/moderation_api/models/operations/getqueuestats_responsebody.rb @@ -0,0 +1,66 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + # Successful response + class GetQueueStatsResponseBody + extend T::Sig + include Crystalline::MetadataFields + + field( + :review_stats, + Models::Operations::ReviewStats, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("reviewStats"), required: true}} + ) + + field( + :action_stats, + Crystalline::Array.new(Models::Operations::ActionStat), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("actionStats"), required: true}} + ) + # List of top reviewers and their statistics + field( + :top_reviewers, + Crystalline::Array.new(Models::Operations::TopReviewer), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("topReviewers"), required: true}} + ) + + field( + :trends, + Models::Operations::Trends, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("trends"), required: true}} + ) + + sig { + params( + review_stats: Models::Operations::ReviewStats, + action_stats: T::Array[Models::Operations::ActionStat], + top_reviewers: T::Array[Models::Operations::TopReviewer], + trends: Models::Operations::Trends + ) + .void + } + def initialize(review_stats:, action_stats:, top_reviewers:, trends:) + @review_stats = review_stats + @action_stats = action_stats + @top_reviewers = top_reviewers + @trends = trends + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @review_stats == other.review_stats + return false unless @action_stats == other.action_stats + return false unless @top_reviewers == other.top_reviewers + return false unless @trends == other.trends + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/getqueuestats_responsebody.rbi b/lib/moderation_api/models/operations/getqueuestats_responsebody.rbi new file mode 100644 index 00000000..dea1e853 --- /dev/null +++ b/lib/moderation_api/models/operations/getqueuestats_responsebody.rbi @@ -0,0 +1,32 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::GetQueueStatsResponseBody + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::GetQueueStatsResponseBody + def review_stats + end + + def review_stats=(str_) + end + + def action_stats + end + + def action_stats=(str_) + end + + def top_reviewers + end + + def top_reviewers=(str_) + end + + def trends + end + + def trends=(str_) + end +end diff --git a/lib/moderation_api/models/operations/getwebhook_eventtype.rb b/lib/moderation_api/models/operations/getwebhook_eventtype.rb new file mode 100644 index 00000000..000a8006 --- /dev/null +++ b/lib/moderation_api/models/operations/getwebhook_eventtype.rb @@ -0,0 +1,30 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class GetWebhookEventType + include ::Crystalline::Enum + enums do + QUEUE_ITEM_NEW = new("QUEUE_ITEM_NEW") + QUEUE_ITEM_COMPLETED = new("QUEUE_ITEM_COMPLETED") + QUEUE_ITEM_ACTION = new("QUEUE_ITEM_ACTION") + QUEUE_ITEM_REJECTED = new("QUEUE_ITEM_REJECTED") + QUEUE_ITEM_ALLOWED = new("QUEUE_ITEM_ALLOWED") + AUTHOR_BLOCKED = new("AUTHOR_BLOCKED") + AUTHOR_UNBLOCKED = new("AUTHOR_UNBLOCKED") + AUTHOR_SUSPENDED = new("AUTHOR_SUSPENDED") + AUTHOR_UPDATED = new("AUTHOR_UPDATED") + AUTHOR_TRUST_LEVEL_CHANGED = new("AUTHOR_TRUST_LEVEL_CHANGED") + AUTHOR_ACTION = new("AUTHOR_ACTION") + end + + open! + end + end + end +end diff --git a/lib/moderation_api/models/operations/getwebhook_eventtype.rbi b/lib/moderation_api/models/operations/getwebhook_eventtype.rbi new file mode 100644 index 00000000..2d796219 --- /dev/null +++ b/lib/moderation_api/models/operations/getwebhook_eventtype.rbi @@ -0,0 +1,9 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::GetWebhookEventType + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::GetWebhookEventType +end diff --git a/lib/moderation_api/models/operations/getwebhook_payloadversion.rb b/lib/moderation_api/models/operations/getwebhook_payloadversion.rb new file mode 100644 index 00000000..a59e8fe6 --- /dev/null +++ b/lib/moderation_api/models/operations/getwebhook_payloadversion.rb @@ -0,0 +1,21 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + # GetWebhookPayloadVersion - Payload envelope version. V2 is the Stripe-style envelope; V1 is the legacy flat shape and is read-only via this API. + class GetWebhookPayloadVersion + include ::Crystalline::Enum + enums do + V1 = new("V1") + V2 = new("V2") + end + + open! + end + end + end +end diff --git a/lib/moderation_api/models/operations/getwebhook_payloadversion.rbi b/lib/moderation_api/models/operations/getwebhook_payloadversion.rbi new file mode 100644 index 00000000..df8a813f --- /dev/null +++ b/lib/moderation_api/models/operations/getwebhook_payloadversion.rbi @@ -0,0 +1,9 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::GetWebhookPayloadVersion + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::GetWebhookPayloadVersion +end diff --git a/lib/moderation_api/models/operations/getwebhook_request.rb b/lib/moderation_api/models/operations/getwebhook_request.rb new file mode 100644 index 00000000..e16cd37c --- /dev/null +++ b/lib/moderation_api/models/operations/getwebhook_request.rb @@ -0,0 +1,31 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class GetWebhookRequest + extend T::Sig + include Crystalline::MetadataFields + + # The ID of the webhook to get. + field :id, ::String, {'path_param': {'field_name': "id", 'style': "simple", 'explode': false}} + + sig { params(id: ::String).void } + def initialize(id:) + @id = id + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @id == other.id + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/getwebhook_request.rbi b/lib/moderation_api/models/operations/getwebhook_request.rbi new file mode 100644 index 00000000..fd69f94f --- /dev/null +++ b/lib/moderation_api/models/operations/getwebhook_request.rbi @@ -0,0 +1,14 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::GetWebhookRequest + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::GetWebhookRequest + def id + end + + def id=(str_) + end +end diff --git a/lib/moderation_api/models/operations/getwebhook_response.rb b/lib/moderation_api/models/operations/getwebhook_response.rb new file mode 100644 index 00000000..d003f596 --- /dev/null +++ b/lib/moderation_api/models/operations/getwebhook_response.rb @@ -0,0 +1,51 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class GetWebhookResponse + extend T::Sig + include Crystalline::MetadataFields + + # HTTP response content type for this operation + field :content_type, ::String + # HTTP response status code for this operation + field :status_code, ::Integer + # Raw HTTP response; suitable for custom response parsing + field :raw_response, ::Faraday::Response + # Webhook retrieved successfully + field :object, Crystalline::Nilable.new(Models::Operations::GetWebhookResponseBody) + + sig { + params( + content_type: ::String, + status_code: ::Integer, + raw_response: ::Faraday::Response, + object: T.nilable(Models::Operations::GetWebhookResponseBody) + ) + .void + } + def initialize(content_type:, status_code:, raw_response:, object: nil) + @content_type = content_type + @status_code = status_code + @raw_response = raw_response + @object = object + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @content_type == other.content_type + return false unless @status_code == other.status_code + return false unless @raw_response == other.raw_response + return false unless @object == other.object + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/getwebhook_response.rbi b/lib/moderation_api/models/operations/getwebhook_response.rbi new file mode 100644 index 00000000..8506b968 --- /dev/null +++ b/lib/moderation_api/models/operations/getwebhook_response.rbi @@ -0,0 +1,32 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::GetWebhookResponse + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::GetWebhookResponse + def content_type + end + + def content_type=(str_) + end + + def status_code + end + + def status_code=(str_) + end + + def raw_response + end + + def raw_response=(str_) + end + + def object + end + + def object=(str_) + end +end diff --git a/lib/moderation_api/models/operations/getwebhook_responsebody.rb b/lib/moderation_api/models/operations/getwebhook_responsebody.rb new file mode 100644 index 00000000..79aa00e8 --- /dev/null +++ b/lib/moderation_api/models/operations/getwebhook_responsebody.rb @@ -0,0 +1,95 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + # Webhook retrieved successfully + class GetWebhookResponseBody + extend T::Sig + include Crystalline::MetadataFields + + # The ID of the webhook. + field :id, ::String, {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("id"), required: true}} + # The webhook's name. + field( + :name, + ::String, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("name"), required: true}} + ) + # The URL we call when a subscribed event occurs. + field :url, ::String, {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("url"), required: true}} + # Event types this webhook subscribes to. Empty for legacy v1 webhooks, which subscribe via their single deprecated `type` instead. + field( + :event_types, + Crystalline::Array.new(Models::Operations::GetWebhookEventType), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("eventTypes"), required: true}} + ) + # Payload envelope version. V2 is the Stripe-style envelope; V1 is the legacy flat shape and is read-only via this API. + field( + :payload_version, + Models::Operations::GetWebhookPayloadVersion, + { + 'format_json': { + 'letter_case': ::ModerationApi::Utils.field_name("payloadVersion"), + required: true, + 'decoder': ::ModerationApi::Utils.open_enum_from_string( + Models::Operations::GetWebhookPayloadVersion, + false + ) + } + } + ) + # The date the webhook was created. + field( + :created_at, + ::String, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("createdAt"), required: true}} + ) + # The webhook's description. + field( + :description, + Crystalline::Nilable.new(::String), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("description")}} + ) + + sig { + params( + id: ::String, + name: ::String, + url: ::String, + event_types: T::Array[Models::Operations::GetWebhookEventType], + payload_version: Models::Operations::GetWebhookPayloadVersion, + created_at: ::String, + description: T.nilable(::String) + ) + .void + } + def initialize(id:, name:, url:, event_types:, payload_version:, created_at:, description: nil) + @id = id + @name = name + @url = url + @event_types = event_types + @payload_version = payload_version + @created_at = created_at + @description = description + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @id == other.id + return false unless @name == other.name + return false unless @url == other.url + return false unless @event_types == other.event_types + return false unless @payload_version == other.payload_version + return false unless @created_at == other.created_at + return false unless @description == other.description + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/getwebhook_responsebody.rbi b/lib/moderation_api/models/operations/getwebhook_responsebody.rbi new file mode 100644 index 00000000..dacdc0d0 --- /dev/null +++ b/lib/moderation_api/models/operations/getwebhook_responsebody.rbi @@ -0,0 +1,50 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::GetWebhookResponseBody + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::GetWebhookResponseBody + def id + end + + def id=(str_) + end + + def name + end + + def name=(str_) + end + + def url + end + + def url=(str_) + end + + def event_types + end + + def event_types=(str_) + end + + def payload_version + end + + def payload_version=(str_) + end + + def created_at + end + + def created_at=(str_) + end + + def description + end + + def description=(str_) + end +end diff --git a/lib/moderation_api/models/operations/getwebhooksecret_response.rb b/lib/moderation_api/models/operations/getwebhooksecret_response.rb new file mode 100644 index 00000000..3ef8a46b --- /dev/null +++ b/lib/moderation_api/models/operations/getwebhooksecret_response.rb @@ -0,0 +1,51 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class GetWebhookSecretResponse + extend T::Sig + include Crystalline::MetadataFields + + # HTTP response content type for this operation + field :content_type, ::String + # HTTP response status code for this operation + field :status_code, ::Integer + # Raw HTTP response; suitable for custom response parsing + field :raw_response, ::Faraday::Response + # Signing secret retrieved successfully + field :object, Crystalline::Nilable.new(Models::Operations::GetWebhookSecretResponseBody) + + sig { + params( + content_type: ::String, + status_code: ::Integer, + raw_response: ::Faraday::Response, + object: T.nilable(Models::Operations::GetWebhookSecretResponseBody) + ) + .void + } + def initialize(content_type:, status_code:, raw_response:, object: nil) + @content_type = content_type + @status_code = status_code + @raw_response = raw_response + @object = object + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @content_type == other.content_type + return false unless @status_code == other.status_code + return false unless @raw_response == other.raw_response + return false unless @object == other.object + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/getwebhooksecret_response.rbi b/lib/moderation_api/models/operations/getwebhooksecret_response.rbi new file mode 100644 index 00000000..58eb44ee --- /dev/null +++ b/lib/moderation_api/models/operations/getwebhooksecret_response.rbi @@ -0,0 +1,32 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::GetWebhookSecretResponse + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::GetWebhookSecretResponse + def content_type + end + + def content_type=(str_) + end + + def status_code + end + + def status_code=(str_) + end + + def raw_response + end + + def raw_response=(str_) + end + + def object + end + + def object=(str_) + end +end diff --git a/lib/moderation_api/models/operations/getwebhooksecret_responsebody.rb b/lib/moderation_api/models/operations/getwebhooksecret_responsebody.rb new file mode 100644 index 00000000..64b34ead --- /dev/null +++ b/lib/moderation_api/models/operations/getwebhooksecret_responsebody.rb @@ -0,0 +1,35 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + # Signing secret retrieved successfully + class GetWebhookSecretResponseBody + extend T::Sig + include Crystalline::MetadataFields + + # The signing secret for this project. Every webhook delivery is signed with HMAC-SHA256 over the raw JSON body, hex-encoded in the `modapi-signature` header. + field( + :secret, + ::String, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("secret"), required: true}} + ) + + sig { params(secret: ::String).void } + def initialize(secret:) + @secret = secret + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @secret == other.secret + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/getwebhooksecret_responsebody.rbi b/lib/moderation_api/models/operations/getwebhooksecret_responsebody.rbi new file mode 100644 index 00000000..706327ae --- /dev/null +++ b/lib/moderation_api/models/operations/getwebhooksecret_responsebody.rbi @@ -0,0 +1,14 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::GetWebhookSecretResponseBody + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::GetWebhookSecretResponseBody + def secret + end + + def secret=(str_) + end +end diff --git a/lib/moderation_api/models/operations/getwordlist_request.rb b/lib/moderation_api/models/operations/getwordlist_request.rb new file mode 100644 index 00000000..02bbe8c5 --- /dev/null +++ b/lib/moderation_api/models/operations/getwordlist_request.rb @@ -0,0 +1,31 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class GetWordlistRequest + extend T::Sig + include Crystalline::MetadataFields + + # ID of the wordlist to get + field :id, ::String, {'path_param': {'field_name': "id", 'style': "simple", 'explode': false}} + + sig { params(id: ::String).void } + def initialize(id:) + @id = id + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @id == other.id + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/getwordlist_request.rbi b/lib/moderation_api/models/operations/getwordlist_request.rbi new file mode 100644 index 00000000..2596683c --- /dev/null +++ b/lib/moderation_api/models/operations/getwordlist_request.rbi @@ -0,0 +1,14 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::GetWordlistRequest + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::GetWordlistRequest + def id + end + + def id=(str_) + end +end diff --git a/lib/moderation_api/models/operations/getwordlist_response.rb b/lib/moderation_api/models/operations/getwordlist_response.rb new file mode 100644 index 00000000..d04eea9e --- /dev/null +++ b/lib/moderation_api/models/operations/getwordlist_response.rb @@ -0,0 +1,51 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class GetWordlistResponse + extend T::Sig + include Crystalline::MetadataFields + + # HTTP response content type for this operation + field :content_type, ::String + # HTTP response status code for this operation + field :status_code, ::Integer + # Raw HTTP response; suitable for custom response parsing + field :raw_response, ::Faraday::Response + # Successful response + field :object, Crystalline::Nilable.new(Models::Operations::GetWordlistResponseBody) + + sig { + params( + content_type: ::String, + status_code: ::Integer, + raw_response: ::Faraday::Response, + object: T.nilable(Models::Operations::GetWordlistResponseBody) + ) + .void + } + def initialize(content_type:, status_code:, raw_response:, object: nil) + @content_type = content_type + @status_code = status_code + @raw_response = raw_response + @object = object + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @content_type == other.content_type + return false unless @status_code == other.status_code + return false unless @raw_response == other.raw_response + return false unless @object == other.object + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/getwordlist_response.rbi b/lib/moderation_api/models/operations/getwordlist_response.rbi new file mode 100644 index 00000000..d680932c --- /dev/null +++ b/lib/moderation_api/models/operations/getwordlist_response.rbi @@ -0,0 +1,32 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::GetWordlistResponse + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::GetWordlistResponse + def content_type + end + + def content_type=(str_) + end + + def status_code + end + + def status_code=(str_) + end + + def raw_response + end + + def raw_response=(str_) + end + + def object + end + + def object=(str_) + end +end diff --git a/lib/moderation_api/models/operations/getwordlist_responsebody.rb b/lib/moderation_api/models/operations/getwordlist_responsebody.rb new file mode 100644 index 00000000..acbef420 --- /dev/null +++ b/lib/moderation_api/models/operations/getwordlist_responsebody.rb @@ -0,0 +1,90 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + # Successful response + class GetWordlistResponseBody + extend T::Sig + include Crystalline::MetadataFields + + # ID of the wordlist + field :id, ::String, {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("id"), required: true}} + # Words in the wordlist + field( + :words, + Crystalline::Array.new(::String), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("words"), required: true}} + ) + # Creation date of the wordlist + field( + :created_at, + ::String, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("createdAt"), required: true}} + ) + # ID of the organization + field( + :organization_id, + ::String, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("organizationId"), required: true}} + ) + # Strict mode + field( + :strict, + Crystalline::Boolean.new, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("strict"), required: true}} + ) + + field( + :name, + Crystalline::Nilable.new(::String), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("name"), required: true}} + ) + + field( + :user_id, + Crystalline::Nilable.new(::String), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("userId"), required: true}} + ) + + sig { + params( + id: ::String, + words: T::Array[::String], + created_at: ::String, + organization_id: ::String, + strict: T::Boolean, + name: T.nilable(::String), + user_id: T.nilable(::String) + ) + .void + } + def initialize(id:, words:, created_at:, organization_id:, strict:, name: nil, user_id: nil) + @id = id + @words = words + @created_at = created_at + @organization_id = organization_id + @strict = strict + @name = name + @user_id = user_id + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @id == other.id + return false unless @words == other.words + return false unless @created_at == other.created_at + return false unless @organization_id == other.organization_id + return false unless @strict == other.strict + return false unless @name == other.name + return false unless @user_id == other.user_id + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/getwordlist_responsebody.rbi b/lib/moderation_api/models/operations/getwordlist_responsebody.rbi new file mode 100644 index 00000000..01c6361a --- /dev/null +++ b/lib/moderation_api/models/operations/getwordlist_responsebody.rbi @@ -0,0 +1,50 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::GetWordlistResponseBody + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::GetWordlistResponseBody + def id + end + + def id=(str_) + end + + def words + end + + def words=(str_) + end + + def created_at + end + + def created_at=(str_) + end + + def organization_id + end + + def organization_id=(str_) + end + + def strict + end + + def strict=(str_) + end + + def name + end + + def name=(str_) + end + + def user_id + end + + def user_id=(str_) + end +end diff --git a/lib/moderation_api/models/operations/getwordlistembeddingstatus_request.rb b/lib/moderation_api/models/operations/getwordlistembeddingstatus_request.rb new file mode 100644 index 00000000..a244e591 --- /dev/null +++ b/lib/moderation_api/models/operations/getwordlistembeddingstatus_request.rb @@ -0,0 +1,31 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class GetWordlistEmbeddingStatusRequest + extend T::Sig + include Crystalline::MetadataFields + + # ID of the wordlist to check embedding status for + field :id, ::String, {'path_param': {'field_name': "id", 'style': "simple", 'explode': false}} + + sig { params(id: ::String).void } + def initialize(id:) + @id = id + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @id == other.id + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/getwordlistembeddingstatus_request.rbi b/lib/moderation_api/models/operations/getwordlistembeddingstatus_request.rbi new file mode 100644 index 00000000..0bb55d6b --- /dev/null +++ b/lib/moderation_api/models/operations/getwordlistembeddingstatus_request.rbi @@ -0,0 +1,14 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::GetWordlistEmbeddingStatusRequest + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::GetWordlistEmbeddingStatusRequest + def id + end + + def id=(str_) + end +end diff --git a/lib/moderation_api/models/operations/getwordlistembeddingstatus_response.rb b/lib/moderation_api/models/operations/getwordlistembeddingstatus_response.rb new file mode 100644 index 00000000..47ba5e65 --- /dev/null +++ b/lib/moderation_api/models/operations/getwordlistembeddingstatus_response.rb @@ -0,0 +1,51 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class GetWordlistEmbeddingStatusResponse + extend T::Sig + include Crystalline::MetadataFields + + # HTTP response content type for this operation + field :content_type, ::String + # HTTP response status code for this operation + field :status_code, ::Integer + # Raw HTTP response; suitable for custom response parsing + field :raw_response, ::Faraday::Response + # Successful response + field :object, Crystalline::Nilable.new(Models::Operations::GetWordlistEmbeddingStatusResponseBody) + + sig { + params( + content_type: ::String, + status_code: ::Integer, + raw_response: ::Faraday::Response, + object: T.nilable(Models::Operations::GetWordlistEmbeddingStatusResponseBody) + ) + .void + } + def initialize(content_type:, status_code:, raw_response:, object: nil) + @content_type = content_type + @status_code = status_code + @raw_response = raw_response + @object = object + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @content_type == other.content_type + return false unless @status_code == other.status_code + return false unless @raw_response == other.raw_response + return false unless @object == other.object + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/getwordlistembeddingstatus_response.rbi b/lib/moderation_api/models/operations/getwordlistembeddingstatus_response.rbi new file mode 100644 index 00000000..d4c725da --- /dev/null +++ b/lib/moderation_api/models/operations/getwordlistembeddingstatus_response.rbi @@ -0,0 +1,32 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::GetWordlistEmbeddingStatusResponse + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::GetWordlistEmbeddingStatusResponse + def content_type + end + + def content_type=(str_) + end + + def status_code + end + + def status_code=(str_) + end + + def raw_response + end + + def raw_response=(str_) + end + + def object + end + + def object=(str_) + end +end diff --git a/lib/moderation_api/models/operations/getwordlistembeddingstatus_responsebody.rb b/lib/moderation_api/models/operations/getwordlistembeddingstatus_responsebody.rb new file mode 100644 index 00000000..0493f67b --- /dev/null +++ b/lib/moderation_api/models/operations/getwordlistembeddingstatus_responsebody.rb @@ -0,0 +1,51 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + # Embedding status details + class GetWordlistEmbeddingStatusResponseBody + extend T::Sig + include Crystalline::MetadataFields + + # Percentage of words that have been embedded (0-100) + field( + :progress, + ::Float, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("progress"), required: true}} + ) + # Total number of words in the wordlist + field( + :total_words, + ::Float, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("totalWords"), required: true}} + ) + # Number of words still waiting to be embedded + field( + :remaining_words, + ::Float, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("remainingWords"), required: true}} + ) + + sig { params(progress: ::Float, total_words: ::Float, remaining_words: ::Float).void } + def initialize(progress:, total_words:, remaining_words:) + @progress = progress + @total_words = total_words + @remaining_words = remaining_words + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @progress == other.progress + return false unless @total_words == other.total_words + return false unless @remaining_words == other.remaining_words + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/getwordlistembeddingstatus_responsebody.rbi b/lib/moderation_api/models/operations/getwordlistembeddingstatus_responsebody.rbi new file mode 100644 index 00000000..633bc36b --- /dev/null +++ b/lib/moderation_api/models/operations/getwordlistembeddingstatus_responsebody.rbi @@ -0,0 +1,26 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::GetWordlistEmbeddingStatusResponseBody + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::GetWordlistEmbeddingStatusResponseBody + def progress + end + + def progress=(str_) + end + + def total_words + end + + def total_words=(str_) + end + + def remaining_words + end + + def remaining_words=(str_) + end +end diff --git a/lib/moderation_api/models/operations/globalflaggingmode.rb b/lib/moderation_api/models/operations/globalflaggingmode.rb new file mode 100644 index 00000000..5bd2cc20 --- /dev/null +++ b/lib/moderation_api/models/operations/globalflaggingmode.rb @@ -0,0 +1,18 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + # GlobalFlaggingMode - `ACTIVE` flags content. `DRY_RUN` evaluates without flagging. + class GlobalFlaggingMode < T::Enum + enums do + DRY_RUN = new("DRY_RUN") + ACTIVE = new("ACTIVE") + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/globalflaggingmode.rbi b/lib/moderation_api/models/operations/globalflaggingmode.rbi new file mode 100644 index 00000000..f4d7f59b --- /dev/null +++ b/lib/moderation_api/models/operations/globalflaggingmode.rbi @@ -0,0 +1,9 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::GlobalFlaggingMode + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::GlobalFlaggingMode +end diff --git a/lib/moderation_api/models/operations/guideline.rb b/lib/moderation_api/models/operations/guideline.rb new file mode 100644 index 00000000..5a3e525c --- /dev/null +++ b/lib/moderation_api/models/operations/guideline.rb @@ -0,0 +1,75 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class Guideline + extend T::Sig + include Crystalline::MetadataFields + + field( + :flag, + Crystalline::Boolean.new, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("flag"), required: true}} + ) + + field( + :instructions, + ::String, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("instructions"), required: true}} + ) + + field( + :guideline_key, + ::String, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("guidelineKey"), required: true}} + ) + + field( + :threshold, + Crystalline::Nilable.new(::Float), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("threshold")}} + ) + + field :id, ::String, {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("id"), required: true}} + + sig { + params( + flag: T::Boolean, + instructions: ::String, + guideline_key: ::String, + threshold: T.nilable(::Float), + id: ::String + ) + .void + } + def initialize(flag:, instructions:, guideline_key:, threshold: nil, id: "guideline") + @flag = flag + @instructions = instructions + @guideline_key = guideline_key + @threshold = threshold + unless id == "guideline" + raise ArgumentError, "Invalid value for id" + end + + @id = "guideline" + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @flag == other.flag + return false unless @instructions == other.instructions + return false unless @guideline_key == other.guideline_key + return false unless @threshold == other.threshold + return false unless @id == other.id + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/guideline.rbi b/lib/moderation_api/models/operations/guideline.rbi new file mode 100644 index 00000000..da175014 --- /dev/null +++ b/lib/moderation_api/models/operations/guideline.rbi @@ -0,0 +1,38 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::Guideline + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::Guideline + def flag + end + + def flag=(str_) + end + + def instructions + end + + def instructions=(str_) + end + + def guideline_key + end + + def guideline_key=(str_) + end + + def threshold + end + + def threshold=(str_) + end + + def id + end + + def id=(str_) + end +end diff --git a/lib/moderation_api/models/operations/hate.rb b/lib/moderation_api/models/operations/hate.rb new file mode 100644 index 00000000..a8d7cca1 --- /dev/null +++ b/lib/moderation_api/models/operations/hate.rb @@ -0,0 +1,50 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class Hate + extend T::Sig + include Crystalline::MetadataFields + + field( + :flag, + Crystalline::Boolean.new, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("flag"), required: true}} + ) + + field( + :threshold, + Crystalline::Nilable.new(::Float), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("threshold")}} + ) + + field :id, ::String, {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("id"), required: true}} + + sig { params(flag: T::Boolean, threshold: T.nilable(::Float), id: ::String).void } + def initialize(flag:, threshold: nil, id: "hate") + @flag = flag + @threshold = threshold + unless id == "hate" + raise ArgumentError, "Invalid value for id" + end + + @id = "hate" + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @flag == other.flag + return false unless @threshold == other.threshold + return false unless @id == other.id + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/hate.rbi b/lib/moderation_api/models/operations/hate.rbi new file mode 100644 index 00000000..11502d70 --- /dev/null +++ b/lib/moderation_api/models/operations/hate.rbi @@ -0,0 +1,26 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::Hate + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::Hate + def flag + end + + def flag=(str_) + end + + def threshold + end + + def threshold=(str_) + end + + def id + end + + def id=(str_) + end +end diff --git a/lib/moderation_api/models/operations/illegal_trade.rb b/lib/moderation_api/models/operations/illegal_trade.rb new file mode 100644 index 00000000..7afdef4c --- /dev/null +++ b/lib/moderation_api/models/operations/illegal_trade.rb @@ -0,0 +1,50 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class IllegalTrade + extend T::Sig + include Crystalline::MetadataFields + + field( + :flag, + Crystalline::Boolean.new, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("flag"), required: true}} + ) + + field( + :threshold, + Crystalline::Nilable.new(::Float), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("threshold")}} + ) + + field :id, ::String, {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("id"), required: true}} + + sig { params(flag: T::Boolean, threshold: T.nilable(::Float), id: ::String).void } + def initialize(flag:, threshold: nil, id: "illegal_trade") + @flag = flag + @threshold = threshold + unless id == "illegal_trade" + raise ArgumentError, "Invalid value for id" + end + + @id = "illegal_trade" + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @flag == other.flag + return false unless @threshold == other.threshold + return false unless @id == other.id + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/illegal_trade.rbi b/lib/moderation_api/models/operations/illegal_trade.rbi new file mode 100644 index 00000000..ddce100c --- /dev/null +++ b/lib/moderation_api/models/operations/illegal_trade.rbi @@ -0,0 +1,26 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::IllegalTrade + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::IllegalTrade + def flag + end + + def flag=(str_) + end + + def threshold + end + + def threshold=(str_) + end + + def id + end + + def id=(str_) + end +end diff --git a/lib/moderation_api/models/operations/illicit.rb b/lib/moderation_api/models/operations/illicit.rb new file mode 100644 index 00000000..09a68360 --- /dev/null +++ b/lib/moderation_api/models/operations/illicit.rb @@ -0,0 +1,50 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class Illicit + extend T::Sig + include Crystalline::MetadataFields + + field( + :flag, + Crystalline::Boolean.new, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("flag"), required: true}} + ) + + field( + :threshold, + Crystalline::Nilable.new(::Float), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("threshold")}} + ) + + field :id, ::String, {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("id"), required: true}} + + sig { params(flag: T::Boolean, threshold: T.nilable(::Float), id: ::String).void } + def initialize(flag:, threshold: nil, id: "illicit") + @flag = flag + @threshold = threshold + unless id == "illicit" + raise ArgumentError, "Invalid value for id" + end + + @id = "illicit" + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @flag == other.flag + return false unless @threshold == other.threshold + return false unless @id == other.id + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/illicit.rbi b/lib/moderation_api/models/operations/illicit.rbi new file mode 100644 index 00000000..67580ae2 --- /dev/null +++ b/lib/moderation_api/models/operations/illicit.rbi @@ -0,0 +1,26 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::Illicit + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::Illicit + def flag + end + + def flag=(str_) + end + + def threshold + end + + def threshold=(str_) + end + + def id + end + + def id=(str_) + end +end diff --git a/lib/moderation_api/models/operations/illicit_alcohol.rb b/lib/moderation_api/models/operations/illicit_alcohol.rb new file mode 100644 index 00000000..216afd03 --- /dev/null +++ b/lib/moderation_api/models/operations/illicit_alcohol.rb @@ -0,0 +1,50 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class IllicitAlcohol + extend T::Sig + include Crystalline::MetadataFields + + field( + :flag, + Crystalline::Boolean.new, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("flag"), required: true}} + ) + + field( + :threshold, + Crystalline::Nilable.new(::Float), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("threshold")}} + ) + + field :id, ::String, {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("id"), required: true}} + + sig { params(flag: T::Boolean, threshold: T.nilable(::Float), id: ::String).void } + def initialize(flag:, threshold: nil, id: "illicit_alcohol") + @flag = flag + @threshold = threshold + unless id == "illicit_alcohol" + raise ArgumentError, "Invalid value for id" + end + + @id = "illicit_alcohol" + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @flag == other.flag + return false unless @threshold == other.threshold + return false unless @id == other.id + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/illicit_alcohol.rbi b/lib/moderation_api/models/operations/illicit_alcohol.rbi new file mode 100644 index 00000000..3687058a --- /dev/null +++ b/lib/moderation_api/models/operations/illicit_alcohol.rbi @@ -0,0 +1,26 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::IllicitAlcohol + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::IllicitAlcohol + def flag + end + + def flag=(str_) + end + + def threshold + end + + def threshold=(str_) + end + + def id + end + + def id=(str_) + end +end diff --git a/lib/moderation_api/models/operations/illicit_drugs.rb b/lib/moderation_api/models/operations/illicit_drugs.rb new file mode 100644 index 00000000..105efa60 --- /dev/null +++ b/lib/moderation_api/models/operations/illicit_drugs.rb @@ -0,0 +1,50 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class IllicitDrugs + extend T::Sig + include Crystalline::MetadataFields + + field( + :flag, + Crystalline::Boolean.new, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("flag"), required: true}} + ) + + field( + :threshold, + Crystalline::Nilable.new(::Float), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("threshold")}} + ) + + field :id, ::String, {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("id"), required: true}} + + sig { params(flag: T::Boolean, threshold: T.nilable(::Float), id: ::String).void } + def initialize(flag:, threshold: nil, id: "illicit_drugs") + @flag = flag + @threshold = threshold + unless id == "illicit_drugs" + raise ArgumentError, "Invalid value for id" + end + + @id = "illicit_drugs" + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @flag == other.flag + return false unless @threshold == other.threshold + return false unless @id == other.id + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/illicit_drugs.rbi b/lib/moderation_api/models/operations/illicit_drugs.rbi new file mode 100644 index 00000000..cb01200e --- /dev/null +++ b/lib/moderation_api/models/operations/illicit_drugs.rbi @@ -0,0 +1,26 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::IllicitDrugs + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::IllicitDrugs + def flag + end + + def flag=(str_) + end + + def threshold + end + + def threshold=(str_) + end + + def id + end + + def id=(str_) + end +end diff --git a/lib/moderation_api/models/operations/illicit_firearms.rb b/lib/moderation_api/models/operations/illicit_firearms.rb new file mode 100644 index 00000000..178303c1 --- /dev/null +++ b/lib/moderation_api/models/operations/illicit_firearms.rb @@ -0,0 +1,50 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class IllicitFirearms + extend T::Sig + include Crystalline::MetadataFields + + field( + :flag, + Crystalline::Boolean.new, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("flag"), required: true}} + ) + + field( + :threshold, + Crystalline::Nilable.new(::Float), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("threshold")}} + ) + + field :id, ::String, {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("id"), required: true}} + + sig { params(flag: T::Boolean, threshold: T.nilable(::Float), id: ::String).void } + def initialize(flag:, threshold: nil, id: "illicit_firearms") + @flag = flag + @threshold = threshold + unless id == "illicit_firearms" + raise ArgumentError, "Invalid value for id" + end + + @id = "illicit_firearms" + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @flag == other.flag + return false unless @threshold == other.threshold + return false unless @id == other.id + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/illicit_firearms.rbi b/lib/moderation_api/models/operations/illicit_firearms.rbi new file mode 100644 index 00000000..549c3143 --- /dev/null +++ b/lib/moderation_api/models/operations/illicit_firearms.rbi @@ -0,0 +1,26 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::IllicitFirearms + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::IllicitFirearms + def flag + end + + def flag=(str_) + end + + def threshold + end + + def threshold=(str_) + end + + def id + end + + def id=(str_) + end +end diff --git a/lib/moderation_api/models/operations/illicit_gambling.rb b/lib/moderation_api/models/operations/illicit_gambling.rb new file mode 100644 index 00000000..d26f6eb8 --- /dev/null +++ b/lib/moderation_api/models/operations/illicit_gambling.rb @@ -0,0 +1,50 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class IllicitGambling + extend T::Sig + include Crystalline::MetadataFields + + field( + :flag, + Crystalline::Boolean.new, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("flag"), required: true}} + ) + + field( + :threshold, + Crystalline::Nilable.new(::Float), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("threshold")}} + ) + + field :id, ::String, {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("id"), required: true}} + + sig { params(flag: T::Boolean, threshold: T.nilable(::Float), id: ::String).void } + def initialize(flag:, threshold: nil, id: "illicit_gambling") + @flag = flag + @threshold = threshold + unless id == "illicit_gambling" + raise ArgumentError, "Invalid value for id" + end + + @id = "illicit_gambling" + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @flag == other.flag + return false unless @threshold == other.threshold + return false unless @id == other.id + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/illicit_gambling.rbi b/lib/moderation_api/models/operations/illicit_gambling.rbi new file mode 100644 index 00000000..a9f0f7f8 --- /dev/null +++ b/lib/moderation_api/models/operations/illicit_gambling.rbi @@ -0,0 +1,26 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::IllicitGambling + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::IllicitGambling + def flag + end + + def flag=(str_) + end + + def threshold + end + + def threshold=(str_) + end + + def id + end + + def id=(str_) + end +end diff --git a/lib/moderation_api/models/operations/illicit_tobacco.rb b/lib/moderation_api/models/operations/illicit_tobacco.rb new file mode 100644 index 00000000..0c8a8f20 --- /dev/null +++ b/lib/moderation_api/models/operations/illicit_tobacco.rb @@ -0,0 +1,50 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class IllicitTobacco + extend T::Sig + include Crystalline::MetadataFields + + field( + :flag, + Crystalline::Boolean.new, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("flag"), required: true}} + ) + + field( + :threshold, + Crystalline::Nilable.new(::Float), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("threshold")}} + ) + + field :id, ::String, {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("id"), required: true}} + + sig { params(flag: T::Boolean, threshold: T.nilable(::Float), id: ::String).void } + def initialize(flag:, threshold: nil, id: "illicit_tobacco") + @flag = flag + @threshold = threshold + unless id == "illicit_tobacco" + raise ArgumentError, "Invalid value for id" + end + + @id = "illicit_tobacco" + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @flag == other.flag + return false unless @threshold == other.threshold + return false unless @id == other.id + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/illicit_tobacco.rbi b/lib/moderation_api/models/operations/illicit_tobacco.rbi new file mode 100644 index 00000000..4ff31ae3 --- /dev/null +++ b/lib/moderation_api/models/operations/illicit_tobacco.rbi @@ -0,0 +1,26 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::IllicitTobacco + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::IllicitTobacco + def flag + end + + def flag=(str_) + end + + def threshold + end + + def threshold=(str_) + end + + def id + end + + def id=(str_) + end +end diff --git a/lib/moderation_api/models/operations/image_request.rb b/lib/moderation_api/models/operations/image_request.rb new file mode 100644 index 00000000..75674ff6 --- /dev/null +++ b/lib/moderation_api/models/operations/image_request.rb @@ -0,0 +1,54 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + # Image + class ImageRequest + extend T::Sig + include Crystalline::MetadataFields + + field( + :type, + ::String, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("type"), required: true}} + ) + # A public URL of the image content. Either url or data must be provided. + field( + :url, + Crystalline::Nilable.new(::String), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("url")}} + ) + # Base64-encoded image data. Either url or data must be provided. Note: base64 images are not stored and will not appear in the review queue. + field( + :data, + Crystalline::Nilable.new(::String), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("data")}} + ) + + sig { params(type: ::String, url: T.nilable(::String), data: T.nilable(::String)).void } + def initialize(type: "image", url: nil, data: nil) + unless type == "image" + raise ArgumentError, "Invalid value for type" + end + + @type = "image" + @url = url + @data = data + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @type == other.type + return false unless @url == other.url + return false unless @data == other.data + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/image_request.rbi b/lib/moderation_api/models/operations/image_request.rbi new file mode 100644 index 00000000..df912d6e --- /dev/null +++ b/lib/moderation_api/models/operations/image_request.rbi @@ -0,0 +1,26 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::ImageRequest + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::ImageRequest + def type + end + + def type=(str_) + end + + def url + end + + def url=(str_) + end + + def data + end + + def data=(str_) + end +end diff --git a/lib/moderation_api/models/operations/image_response.rb b/lib/moderation_api/models/operations/image_response.rb new file mode 100644 index 00000000..83d8adca --- /dev/null +++ b/lib/moderation_api/models/operations/image_response.rb @@ -0,0 +1,54 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + # Image + class ImageResponse + extend T::Sig + include Crystalline::MetadataFields + + field( + :type, + ::String, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("type"), required: true}} + ) + # A public URL of the image content. Either url or data must be provided. + field( + :url, + Crystalline::Nilable.new(::String), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("url")}} + ) + # Base64-encoded image data. Either url or data must be provided. Note: base64 images are not stored and will not appear in the review queue. + field( + :data, + Crystalline::Nilable.new(::String), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("data")}} + ) + + sig { params(type: ::String, url: T.nilable(::String), data: T.nilable(::String)).void } + def initialize(type: "image", url: nil, data: nil) + unless type == "image" + raise ArgumentError, "Invalid value for type" + end + + @type = "image" + @url = url + @data = data + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @type == other.type + return false unless @url == other.url + return false unless @data == other.data + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/image_response.rbi b/lib/moderation_api/models/operations/image_response.rbi new file mode 100644 index 00000000..b435b9a4 --- /dev/null +++ b/lib/moderation_api/models/operations/image_response.rbi @@ -0,0 +1,26 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::ImageResponse + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::ImageResponse + def type + end + + def type=(str_) + end + + def url + end + + def url=(str_) + end + + def data + end + + def data=(str_) + end +end diff --git a/lib/moderation_api/models/operations/insight.rb b/lib/moderation_api/models/operations/insight.rb new file mode 100644 index 00000000..710c9041 --- /dev/null +++ b/lib/moderation_api/models/operations/insight.rb @@ -0,0 +1,25 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class Insight + extend T::Sig + include Crystalline::MetadataFields + + def initialize + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/insight.rbi b/lib/moderation_api/models/operations/insight.rbi new file mode 100644 index 00000000..68083a71 --- /dev/null +++ b/lib/moderation_api/models/operations/insight.rbi @@ -0,0 +1,9 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::Insight + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::Insight +end diff --git a/lib/moderation_api/models/operations/isflagged.rb b/lib/moderation_api/models/operations/isflagged.rb new file mode 100644 index 00000000..d365658a --- /dev/null +++ b/lib/moderation_api/models/operations/isflagged.rb @@ -0,0 +1,23 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class IsFlagged + include ::Crystalline::Enum + enums do + ALL = new("ALL") + FLAGGED = new("FLAGGED") + NOT_FLAGGED = new("NOT_FLAGGED") + SHADOW_FLAGGED = new("SHADOW_FLAGGED") + end + + open! + end + end + end +end diff --git a/lib/moderation_api/models/operations/isflagged.rbi b/lib/moderation_api/models/operations/isflagged.rbi new file mode 100644 index 00000000..6ac05e4a --- /dev/null +++ b/lib/moderation_api/models/operations/isflagged.rbi @@ -0,0 +1,9 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::IsFlagged + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::IsFlagged +end diff --git a/lib/moderation_api/models/operations/language_insight.rb b/lib/moderation_api/models/operations/language_insight.rb new file mode 100644 index 00000000..eb60eafd --- /dev/null +++ b/lib/moderation_api/models/operations/language_insight.rb @@ -0,0 +1,62 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + # Language insight + class LanguageInsight + extend T::Sig + include Crystalline::MetadataFields + + field( + :probability, + ::Float, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("probability"), required: true}} + ) + + field :id, ::String, {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("id"), required: true}} + + field( + :type, + ::String, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("type"), required: true}} + ) + + field( + :value, + Crystalline::Nilable.new(::String), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("value"), required: true}} + ) + + sig { params(probability: ::Float, id: ::String, type: ::String, value: T.nilable(::String)).void } + def initialize(probability:, id: "language", type: "insight", value: nil) + @probability = probability + unless id == "language" + raise ArgumentError, "Invalid value for id" + end + + @id = "language" + unless type == "insight" + raise ArgumentError, "Invalid value for type" + end + + @type = "insight" + @value = value + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @probability == other.probability + return false unless @id == other.id + return false unless @type == other.type + return false unless @value == other.value + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/language_insight.rbi b/lib/moderation_api/models/operations/language_insight.rbi new file mode 100644 index 00000000..b4de1335 --- /dev/null +++ b/lib/moderation_api/models/operations/language_insight.rbi @@ -0,0 +1,32 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::LanguageInsight + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::LanguageInsight + def probability + end + + def probability=(str_) + end + + def id + end + + def id=(str_) + end + + def type + end + + def type=(str_) + end + + def value + end + + def value=(str_) + end +end diff --git a/lib/moderation_api/models/operations/listactions_data.rb b/lib/moderation_api/models/operations/listactions_data.rb new file mode 100644 index 00000000..10619818 --- /dev/null +++ b/lib/moderation_api/models/operations/listactions_data.rb @@ -0,0 +1,176 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class ListActionsData + extend T::Sig + include Crystalline::MetadataFields + + # The ID of the action. + field :id, ::String, {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("id"), required: true}} + # The date the action was created. + field( + :created_at, + ::String, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("createdAt"), required: true}} + ) + # The name of the action. + field( + :name, + ::String, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("name"), required: true}} + ) + # The IDs of the queues the action is available in. + field( + :filter_in_queue_ids, + Crystalline::Array.new(::String), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("filterInQueueIds"), required: true}} + ) + # The possible values of the action. The user will be prompted to select one of these values when executing the action. + field( + :possible_values, + Crystalline::Array.new(Models::Operations::ListActionsPossibleValue), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("possibleValues"), required: true}} + ) + # User defined key of the action. + field( + :key, + Crystalline::Nilable.new(::String), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("key")}} + ) + # The description of the action. + field( + :description, + Crystalline::Nilable.new(::String), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("description")}} + ) + # The type of the action. + field( + :type, + Crystalline::Nilable.new(Models::Operations::ListActionsType), + { + 'format_json': { + 'letter_case': ::ModerationApi::Utils.field_name("type"), + 'decoder': ::ModerationApi::Utils.open_enum_from_string(Models::Operations::ListActionsType, true) + } + } + ) + # Whether the action resolves and removes the item, unresolves and re-add it to the queue, or does not change the resolve status. + field( + :queue_behaviour, + Crystalline::Nilable.new(Models::Operations::ListActionsQueueBehaviour), + { + 'format_json': { + 'letter_case': ::ModerationApi::Utils.field_name("queueBehaviour"), + 'decoder': ::ModerationApi::Utils.open_enum_from_string( + Models::Operations::ListActionsQueueBehaviour, + true + ) + } + } + ) + # Show the action in all queues, selected queues or no queues (to use via API only). + field( + :position, + Crystalline::Nilable.new(Models::Operations::ListActionsPosition), + { + 'format_json': { + 'letter_case': ::ModerationApi::Utils.field_name("position"), + 'decoder': ::ModerationApi::Utils.open_enum_from_string(Models::Operations::ListActionsPosition, true) + } + } + ) + # Whether the action requires a value to be executed. + field( + :value_required, + Crystalline::Nilable.new(Crystalline::Boolean.new), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("valueRequired")}} + ) + # Whether the action allows any text to be entered as a value or if it must be one of the possible values. + field( + :free_text, + Crystalline::Nilable.new(Crystalline::Boolean.new), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("freeText")}} + ) + # Whether the action is a built-in action or a custom one. + field( + :built_in, + Crystalline::Nilable.new(Crystalline::Boolean.new), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("builtIn")}} + ) + + sig { + params( + id: ::String, + created_at: ::String, + name: ::String, + filter_in_queue_ids: T::Array[::String], + possible_values: T::Array[Models::Operations::ListActionsPossibleValue], + key: T.nilable(::String), + description: T.nilable(::String), + type: T.nilable(Models::Operations::ListActionsType), + queue_behaviour: T.nilable(Models::Operations::ListActionsQueueBehaviour), + position: T.nilable(Models::Operations::ListActionsPosition), + value_required: T.nilable(T::Boolean), + free_text: T.nilable(T::Boolean), + built_in: T.nilable(T::Boolean) + ) + .void + } + def initialize( + id:, + created_at:, + name:, + filter_in_queue_ids:, + possible_values:, + key: nil, + description: nil, + type: nil, + queue_behaviour: Models::Operations::ListActionsQueueBehaviour::NO_CHANGE, + position: Models::Operations::ListActionsPosition::ALL_QUEUES, + value_required: false, + free_text: false, + built_in: false + ) + @id = id + @created_at = created_at + @name = name + @filter_in_queue_ids = filter_in_queue_ids + @possible_values = possible_values + @key = key + @description = description + @type = type + @queue_behaviour = queue_behaviour + @position = position + @value_required = value_required + @free_text = free_text + @built_in = built_in + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @id == other.id + return false unless @created_at == other.created_at + return false unless @name == other.name + return false unless @filter_in_queue_ids == other.filter_in_queue_ids + return false unless @possible_values == other.possible_values + return false unless @key == other.key + return false unless @description == other.description + return false unless @type == other.type + return false unless @queue_behaviour == other.queue_behaviour + return false unless @position == other.position + return false unless @value_required == other.value_required + return false unless @free_text == other.free_text + return false unless @built_in == other.built_in + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/listactions_data.rbi b/lib/moderation_api/models/operations/listactions_data.rbi new file mode 100644 index 00000000..45fc8966 --- /dev/null +++ b/lib/moderation_api/models/operations/listactions_data.rbi @@ -0,0 +1,86 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::ListActionsData + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::ListActionsData + def id + end + + def id=(str_) + end + + def created_at + end + + def created_at=(str_) + end + + def name + end + + def name=(str_) + end + + def filter_in_queue_ids + end + + def filter_in_queue_ids=(str_) + end + + def possible_values + end + + def possible_values=(str_) + end + + def key + end + + def key=(str_) + end + + def description + end + + def description=(str_) + end + + def type + end + + def type=(str_) + end + + def queue_behaviour + end + + def queue_behaviour=(str_) + end + + def position + end + + def position=(str_) + end + + def value_required + end + + def value_required=(str_) + end + + def free_text + end + + def free_text=(str_) + end + + def built_in + end + + def built_in=(str_) + end +end diff --git a/lib/moderation_api/models/operations/listactions_position.rb b/lib/moderation_api/models/operations/listactions_position.rb new file mode 100644 index 00000000..d4ea6044 --- /dev/null +++ b/lib/moderation_api/models/operations/listactions_position.rb @@ -0,0 +1,22 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + # ListActionsPosition - Show the action in all queues, selected queues or no queues (to use via API only). + class ListActionsPosition + include ::Crystalline::Enum + enums do + ALL_QUEUES = new("ALL_QUEUES") + SOME_QUEUES = new("SOME_QUEUES") + HIDDEN = new("HIDDEN") + end + + open! + end + end + end +end diff --git a/lib/moderation_api/models/operations/listactions_position.rbi b/lib/moderation_api/models/operations/listactions_position.rbi new file mode 100644 index 00000000..0ff2f2a3 --- /dev/null +++ b/lib/moderation_api/models/operations/listactions_position.rbi @@ -0,0 +1,9 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::ListActionsPosition + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::ListActionsPosition +end diff --git a/lib/moderation_api/models/operations/listactions_possiblevalue.rb b/lib/moderation_api/models/operations/listactions_possiblevalue.rb new file mode 100644 index 00000000..2457f0b6 --- /dev/null +++ b/lib/moderation_api/models/operations/listactions_possiblevalue.rb @@ -0,0 +1,35 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class ListActionsPossibleValue + extend T::Sig + include Crystalline::MetadataFields + + # The value of the action. + field( + :value, + ::String, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("value"), required: true}} + ) + + sig { params(value: ::String).void } + def initialize(value:) + @value = value + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @value == other.value + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/listactions_possiblevalue.rbi b/lib/moderation_api/models/operations/listactions_possiblevalue.rbi new file mode 100644 index 00000000..31a0cdf1 --- /dev/null +++ b/lib/moderation_api/models/operations/listactions_possiblevalue.rbi @@ -0,0 +1,14 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::ListActionsPossibleValue + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::ListActionsPossibleValue + def value + end + + def value=(str_) + end +end diff --git a/lib/moderation_api/models/operations/listactions_queuebehaviour.rb b/lib/moderation_api/models/operations/listactions_queuebehaviour.rb new file mode 100644 index 00000000..feddb4e9 --- /dev/null +++ b/lib/moderation_api/models/operations/listactions_queuebehaviour.rb @@ -0,0 +1,22 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + # ListActionsQueueBehaviour - Whether the action resolves and removes the item, unresolves and re-add it to the queue, or does not change the resolve status. + class ListActionsQueueBehaviour + include ::Crystalline::Enum + enums do + REMOVE = new("REMOVE") + ADD = new("ADD") + NO_CHANGE = new("NO_CHANGE") + end + + open! + end + end + end +end diff --git a/lib/moderation_api/models/operations/listactions_queuebehaviour.rbi b/lib/moderation_api/models/operations/listactions_queuebehaviour.rbi new file mode 100644 index 00000000..5f3d2450 --- /dev/null +++ b/lib/moderation_api/models/operations/listactions_queuebehaviour.rbi @@ -0,0 +1,9 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::ListActionsQueueBehaviour + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::ListActionsQueueBehaviour +end diff --git a/lib/moderation_api/models/operations/listactions_request.rb b/lib/moderation_api/models/operations/listactions_request.rb new file mode 100644 index 00000000..2500543d --- /dev/null +++ b/lib/moderation_api/models/operations/listactions_request.rb @@ -0,0 +1,50 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class ListActionsRequest + extend T::Sig + include Crystalline::MetadataFields + + field( + :queue_id, + Crystalline::Nilable.new(::String), + {'query_param': {'field_name': "queueId", 'style': "form", 'explode': true}} + ) + + field( + :page, + Crystalline::Nilable.new(::Integer), + {'query_param': {'field_name': "page", 'style': "form", 'explode': true}} + ) + + field( + :page_size, + Crystalline::Nilable.new(::Integer), + {'query_param': {'field_name': "pageSize", 'style': "form", 'explode': true}} + ) + + sig { params(queue_id: T.nilable(::String), page: T.nilable(::Integer), page_size: T.nilable(::Integer)).void } + def initialize(queue_id: nil, page: 1, page_size: 20) + @queue_id = queue_id + @page = page + @page_size = page_size + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @queue_id == other.queue_id + return false unless @page == other.page + return false unless @page_size == other.page_size + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/listactions_request.rbi b/lib/moderation_api/models/operations/listactions_request.rbi new file mode 100644 index 00000000..3169de01 --- /dev/null +++ b/lib/moderation_api/models/operations/listactions_request.rbi @@ -0,0 +1,26 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::ListActionsRequest + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::ListActionsRequest + def queue_id + end + + def queue_id=(str_) + end + + def page + end + + def page=(str_) + end + + def page_size + end + + def page_size=(str_) + end +end diff --git a/lib/moderation_api/models/operations/listactions_response.rb b/lib/moderation_api/models/operations/listactions_response.rb new file mode 100644 index 00000000..cd9a1e5a --- /dev/null +++ b/lib/moderation_api/models/operations/listactions_response.rb @@ -0,0 +1,63 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class ListActionsResponse + extend T::Sig + include Crystalline::MetadataFields + sig { returns(T.proc.returns(T.nilable(ListActionsResponse))) } + attr_accessor :next_page + + # HTTP response content type for this operation + field :content_type, ::String + # HTTP response status code for this operation + field :status_code, ::Integer + # Raw HTTP response; suitable for custom response parsing + field :raw_response, ::Faraday::Response + # Successful response + field :object, Crystalline::Nilable.new(Models::Operations::ListActionsResponseBody) + + sig { + params( + content_type: ::String, + status_code: ::Integer, + raw_response: ::Faraday::Response, + object: T.nilable(Models::Operations::ListActionsResponseBody) + ) + .void + } + def initialize(content_type:, status_code:, raw_response:, object: nil) + @content_type = content_type + @status_code = status_code + @raw_response = raw_response + @object = object + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @content_type == other.content_type + return false unless @status_code == other.status_code + return false unless @raw_response == other.raw_response + return false unless @object == other.object + true + end + + def each + page = self + loop do + yield page + next_page = page.next_page.call if page.next_page + break if next_page.nil? + page = T.must(next_page) + end + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/listactions_response.rbi b/lib/moderation_api/models/operations/listactions_response.rbi new file mode 100644 index 00000000..02a0a033 --- /dev/null +++ b/lib/moderation_api/models/operations/listactions_response.rbi @@ -0,0 +1,32 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::ListActionsResponse + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::ListActionsResponse + def content_type + end + + def content_type=(str_) + end + + def status_code + end + + def status_code=(str_) + end + + def raw_response + end + + def raw_response=(str_) + end + + def object + end + + def object=(str_) + end +end diff --git a/lib/moderation_api/models/operations/listactions_responsebody.rb b/lib/moderation_api/models/operations/listactions_responsebody.rb new file mode 100644 index 00000000..1e08f394 --- /dev/null +++ b/lib/moderation_api/models/operations/listactions_responsebody.rb @@ -0,0 +1,45 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + # Successful response + class ListActionsResponseBody + extend T::Sig + include Crystalline::MetadataFields + + # The items on this page. + field( + :data, + Crystalline::Array.new(Models::Operations::ListActionsData), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("data"), required: true}} + ) + # Where this page is in the full list. + field( + :pagination, + Models::Components::Pagination, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("pagination"), required: true}} + ) + + sig { + params(data: T::Array[Models::Operations::ListActionsData], pagination: Models::Components::Pagination).void + } + def initialize(data:, pagination:) + @data = data + @pagination = pagination + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @data == other.data + return false unless @pagination == other.pagination + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/listactions_responsebody.rbi b/lib/moderation_api/models/operations/listactions_responsebody.rbi new file mode 100644 index 00000000..4ab4feb5 --- /dev/null +++ b/lib/moderation_api/models/operations/listactions_responsebody.rbi @@ -0,0 +1,20 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::ListActionsResponseBody + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::ListActionsResponseBody + def data + end + + def data=(str_) + end + + def pagination + end + + def pagination=(str_) + end +end diff --git a/lib/moderation_api/models/operations/listactions_type.rb b/lib/moderation_api/models/operations/listactions_type.rb new file mode 100644 index 00000000..1205fb13 --- /dev/null +++ b/lib/moderation_api/models/operations/listactions_type.rb @@ -0,0 +1,29 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class ListActionsType + include ::Crystalline::Enum + enums do + AUTHOR_BLOCK = new("AUTHOR_BLOCK") + AUTHOR_BLOCK_TEMP = new("AUTHOR_BLOCK_TEMP") + AUTHOR_UNBLOCK = new("AUTHOR_UNBLOCK") + AUTHOR_DELETE = new("AUTHOR_DELETE") + AUTHOR_REPORT = new("AUTHOR_REPORT") + AUTHOR_WARN = new("AUTHOR_WARN") + AUTHOR_CUSTOM = new("AUTHOR_CUSTOM") + ITEM_REJECT = new("ITEM_REJECT") + ITEM_ALLOW = new("ITEM_ALLOW") + ITEM_CUSTOM = new("ITEM_CUSTOM") + end + + open! + end + end + end +end diff --git a/lib/moderation_api/models/operations/listactions_type.rbi b/lib/moderation_api/models/operations/listactions_type.rbi new file mode 100644 index 00000000..2ce37a33 --- /dev/null +++ b/lib/moderation_api/models/operations/listactions_type.rbi @@ -0,0 +1,9 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::ListActionsType + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::ListActionsType +end diff --git a/lib/moderation_api/models/operations/listauthors_request.rb b/lib/moderation_api/models/operations/listauthors_request.rb new file mode 100644 index 00000000..5b22fbe2 --- /dev/null +++ b/lib/moderation_api/models/operations/listauthors_request.rb @@ -0,0 +1,101 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class ListAuthorsRequest + extend T::Sig + include Crystalline::MetadataFields + + field( + :sort_by, + Crystalline::Nilable.new(Models::Operations::SortBy), + {'query_param': {'field_name': "sortBy", 'style': "form", 'explode': true}} + ) + + field( + :member_since_date, + Crystalline::Nilable.new(::String), + {'query_param': {'field_name': "memberSinceDate", 'style': "form", 'explode': true}} + ) + + field( + :last_active_date, + Crystalline::Nilable.new(::String), + {'query_param': {'field_name': "lastActiveDate", 'style': "form", 'explode': true}} + ) + + field( + :content_types, + Crystalline::Nilable.new(Crystalline::Array.new(::String)), + {'query_param': {'field_name': "contentTypes", 'style': "form", 'explode': true}} + ) + + field( + :page, + Crystalline::Nilable.new(::Integer), + {'query_param': {'field_name': "page", 'style': "form", 'explode': true}} + ) + + field( + :page_size, + Crystalline::Nilable.new(::Integer), + {'query_param': {'field_name': "pageSize", 'style': "form", 'explode': true}} + ) + # Sort direction + field( + :sort_direction, + Crystalline::Nilable.new(Models::Operations::ListAuthorsSortDirection), + {'query_param': {'field_name': "sortDirection", 'style': "form", 'explode': true}} + ) + + sig { + params( + sort_by: T.nilable(Models::Operations::SortBy), + member_since_date: T.nilable(::String), + last_active_date: T.nilable(::String), + content_types: T.nilable(T::Array[::String]), + page: T.nilable(::Integer), + page_size: T.nilable(::Integer), + sort_direction: T.nilable(Models::Operations::ListAuthorsSortDirection) + ) + .void + } + def initialize( + sort_by: nil, + member_since_date: nil, + last_active_date: nil, + content_types: nil, + page: 1, + page_size: 20, + sort_direction: Models::Operations::ListAuthorsSortDirection::DESC + ) + @sort_by = sort_by + @member_since_date = member_since_date + @last_active_date = last_active_date + @content_types = content_types + @page = page + @page_size = page_size + @sort_direction = sort_direction + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @sort_by == other.sort_by + return false unless @member_since_date == other.member_since_date + return false unless @last_active_date == other.last_active_date + return false unless @content_types == other.content_types + return false unless @page == other.page + return false unless @page_size == other.page_size + return false unless @sort_direction == other.sort_direction + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/listauthors_request.rbi b/lib/moderation_api/models/operations/listauthors_request.rbi new file mode 100644 index 00000000..a339d7d9 --- /dev/null +++ b/lib/moderation_api/models/operations/listauthors_request.rbi @@ -0,0 +1,50 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::ListAuthorsRequest + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::ListAuthorsRequest + def sort_by + end + + def sort_by=(str_) + end + + def member_since_date + end + + def member_since_date=(str_) + end + + def last_active_date + end + + def last_active_date=(str_) + end + + def content_types + end + + def content_types=(str_) + end + + def page + end + + def page=(str_) + end + + def page_size + end + + def page_size=(str_) + end + + def sort_direction + end + + def sort_direction=(str_) + end +end diff --git a/lib/moderation_api/models/operations/listauthors_response.rb b/lib/moderation_api/models/operations/listauthors_response.rb new file mode 100644 index 00000000..a6049bec --- /dev/null +++ b/lib/moderation_api/models/operations/listauthors_response.rb @@ -0,0 +1,63 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class ListAuthorsResponse + extend T::Sig + include Crystalline::MetadataFields + sig { returns(T.proc.returns(T.nilable(ListAuthorsResponse))) } + attr_accessor :next_page + + # HTTP response content type for this operation + field :content_type, ::String + # HTTP response status code for this operation + field :status_code, ::Integer + # Raw HTTP response; suitable for custom response parsing + field :raw_response, ::Faraday::Response + # Successful response + field :object, Crystalline::Nilable.new(Models::Operations::ListAuthorsResponseBody) + + sig { + params( + content_type: ::String, + status_code: ::Integer, + raw_response: ::Faraday::Response, + object: T.nilable(Models::Operations::ListAuthorsResponseBody) + ) + .void + } + def initialize(content_type:, status_code:, raw_response:, object: nil) + @content_type = content_type + @status_code = status_code + @raw_response = raw_response + @object = object + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @content_type == other.content_type + return false unless @status_code == other.status_code + return false unless @raw_response == other.raw_response + return false unless @object == other.object + true + end + + def each + page = self + loop do + yield page + next_page = page.next_page.call if page.next_page + break if next_page.nil? + page = T.must(next_page) + end + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/listauthors_response.rbi b/lib/moderation_api/models/operations/listauthors_response.rbi new file mode 100644 index 00000000..06a77e8c --- /dev/null +++ b/lib/moderation_api/models/operations/listauthors_response.rbi @@ -0,0 +1,32 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::ListAuthorsResponse + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::ListAuthorsResponse + def content_type + end + + def content_type=(str_) + end + + def status_code + end + + def status_code=(str_) + end + + def raw_response + end + + def raw_response=(str_) + end + + def object + end + + def object=(str_) + end +end diff --git a/lib/moderation_api/models/operations/listauthors_responsebody.rb b/lib/moderation_api/models/operations/listauthors_responsebody.rb new file mode 100644 index 00000000..b87b10cf --- /dev/null +++ b/lib/moderation_api/models/operations/listauthors_responsebody.rb @@ -0,0 +1,45 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + # Successful response + class ListAuthorsResponseBody + extend T::Sig + include Crystalline::MetadataFields + + # The items on this page. + field( + :data, + Crystalline::Array.new(Models::Components::PublicAuthor), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("data"), required: true}} + ) + # Where this page is in the full list. + field( + :pagination, + Models::Components::Pagination, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("pagination"), required: true}} + ) + + sig { + params(data: T::Array[Models::Components::PublicAuthor], pagination: Models::Components::Pagination).void + } + def initialize(data:, pagination:) + @data = data + @pagination = pagination + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @data == other.data + return false unless @pagination == other.pagination + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/listauthors_responsebody.rbi b/lib/moderation_api/models/operations/listauthors_responsebody.rbi new file mode 100644 index 00000000..b0a973fd --- /dev/null +++ b/lib/moderation_api/models/operations/listauthors_responsebody.rbi @@ -0,0 +1,20 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::ListAuthorsResponseBody + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::ListAuthorsResponseBody + def data + end + + def data=(str_) + end + + def pagination + end + + def pagination=(str_) + end +end diff --git a/lib/moderation_api/models/operations/listauthors_sortdirection.rb b/lib/moderation_api/models/operations/listauthors_sortdirection.rb new file mode 100644 index 00000000..e017cdf9 --- /dev/null +++ b/lib/moderation_api/models/operations/listauthors_sortdirection.rb @@ -0,0 +1,18 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + # ListAuthorsSortDirection - Sort direction + class ListAuthorsSortDirection < T::Enum + enums do + ASC = new("asc") + DESC = new("desc") + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/listauthors_sortdirection.rbi b/lib/moderation_api/models/operations/listauthors_sortdirection.rbi new file mode 100644 index 00000000..7de88b9a --- /dev/null +++ b/lib/moderation_api/models/operations/listauthors_sortdirection.rbi @@ -0,0 +1,9 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::ListAuthorsSortDirection + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::ListAuthorsSortDirection +end diff --git a/lib/moderation_api/models/operations/listchannels_request.rb b/lib/moderation_api/models/operations/listchannels_request.rb new file mode 100644 index 00000000..8f447dfc --- /dev/null +++ b/lib/moderation_api/models/operations/listchannels_request.rb @@ -0,0 +1,47 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class ListChannelsRequest + extend T::Sig + include Crystalline::MetadataFields + + # The ID of the project. + field :project_id, ::String, {'path_param': {'field_name': "projectId", 'style': "simple", 'explode': false}} + + field( + :page, + Crystalline::Nilable.new(::Integer), + {'query_param': {'field_name': "page", 'style': "form", 'explode': true}} + ) + + field( + :page_size, + Crystalline::Nilable.new(::Integer), + {'query_param': {'field_name': "pageSize", 'style': "form", 'explode': true}} + ) + + sig { params(project_id: ::String, page: T.nilable(::Integer), page_size: T.nilable(::Integer)).void } + def initialize(project_id:, page: 1, page_size: 20) + @project_id = project_id + @page = page + @page_size = page_size + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @project_id == other.project_id + return false unless @page == other.page + return false unless @page_size == other.page_size + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/listchannels_request.rbi b/lib/moderation_api/models/operations/listchannels_request.rbi new file mode 100644 index 00000000..487ba230 --- /dev/null +++ b/lib/moderation_api/models/operations/listchannels_request.rbi @@ -0,0 +1,26 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::ListChannelsRequest + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::ListChannelsRequest + def project_id + end + + def project_id=(str_) + end + + def page + end + + def page=(str_) + end + + def page_size + end + + def page_size=(str_) + end +end diff --git a/lib/moderation_api/models/operations/listchannels_response.rb b/lib/moderation_api/models/operations/listchannels_response.rb new file mode 100644 index 00000000..d6cab7cc --- /dev/null +++ b/lib/moderation_api/models/operations/listchannels_response.rb @@ -0,0 +1,63 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class ListChannelsResponse + extend T::Sig + include Crystalline::MetadataFields + sig { returns(T.proc.returns(T.nilable(ListChannelsResponse))) } + attr_accessor :next_page + + # HTTP response content type for this operation + field :content_type, ::String + # HTTP response status code for this operation + field :status_code, ::Integer + # Raw HTTP response; suitable for custom response parsing + field :raw_response, ::Faraday::Response + # Channels retrieved successfully + field :object, Crystalline::Nilable.new(Models::Operations::ListChannelsResponseBody) + + sig { + params( + content_type: ::String, + status_code: ::Integer, + raw_response: ::Faraday::Response, + object: T.nilable(Models::Operations::ListChannelsResponseBody) + ) + .void + } + def initialize(content_type:, status_code:, raw_response:, object: nil) + @content_type = content_type + @status_code = status_code + @raw_response = raw_response + @object = object + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @content_type == other.content_type + return false unless @status_code == other.status_code + return false unless @raw_response == other.raw_response + return false unless @object == other.object + true + end + + def each + page = self + loop do + yield page + next_page = page.next_page.call if page.next_page + break if next_page.nil? + page = T.must(next_page) + end + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/listchannels_response.rbi b/lib/moderation_api/models/operations/listchannels_response.rbi new file mode 100644 index 00000000..e9d11b32 --- /dev/null +++ b/lib/moderation_api/models/operations/listchannels_response.rbi @@ -0,0 +1,32 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::ListChannelsResponse + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::ListChannelsResponse + def content_type + end + + def content_type=(str_) + end + + def status_code + end + + def status_code=(str_) + end + + def raw_response + end + + def raw_response=(str_) + end + + def object + end + + def object=(str_) + end +end diff --git a/lib/moderation_api/models/operations/listchannels_responsebody.rb b/lib/moderation_api/models/operations/listchannels_responsebody.rb new file mode 100644 index 00000000..9f06f7fb --- /dev/null +++ b/lib/moderation_api/models/operations/listchannels_responsebody.rb @@ -0,0 +1,43 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + # Channels retrieved successfully + class ListChannelsResponseBody + extend T::Sig + include Crystalline::MetadataFields + + # The items on this page. + field( + :data, + Crystalline::Array.new(Models::Components::Channel), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("data"), required: true}} + ) + # Where this page is in the full list. + field( + :pagination, + Models::Components::Pagination, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("pagination"), required: true}} + ) + + sig { params(data: T::Array[Models::Components::Channel], pagination: Models::Components::Pagination).void } + def initialize(data:, pagination:) + @data = data + @pagination = pagination + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @data == other.data + return false unless @pagination == other.pagination + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/listchannels_responsebody.rbi b/lib/moderation_api/models/operations/listchannels_responsebody.rbi new file mode 100644 index 00000000..9cd90cd5 --- /dev/null +++ b/lib/moderation_api/models/operations/listchannels_responsebody.rbi @@ -0,0 +1,20 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::ListChannelsResponseBody + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::ListChannelsResponseBody + def data + end + + def data=(str_) + end + + def pagination + end + + def pagination=(str_) + end +end diff --git a/lib/moderation_api/models/operations/listprojects_request.rb b/lib/moderation_api/models/operations/listprojects_request.rb new file mode 100644 index 00000000..89cc1aa3 --- /dev/null +++ b/lib/moderation_api/models/operations/listprojects_request.rb @@ -0,0 +1,42 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class ListProjectsRequest + extend T::Sig + include Crystalline::MetadataFields + + field( + :page, + Crystalline::Nilable.new(::Integer), + {'query_param': {'field_name': "page", 'style': "form", 'explode': true}} + ) + + field( + :page_size, + Crystalline::Nilable.new(::Integer), + {'query_param': {'field_name': "pageSize", 'style': "form", 'explode': true}} + ) + + sig { params(page: T.nilable(::Integer), page_size: T.nilable(::Integer)).void } + def initialize(page: 1, page_size: 20) + @page = page + @page_size = page_size + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @page == other.page + return false unless @page_size == other.page_size + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/listprojects_request.rbi b/lib/moderation_api/models/operations/listprojects_request.rbi new file mode 100644 index 00000000..919bb698 --- /dev/null +++ b/lib/moderation_api/models/operations/listprojects_request.rbi @@ -0,0 +1,20 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::ListProjectsRequest + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::ListProjectsRequest + def page + end + + def page=(str_) + end + + def page_size + end + + def page_size=(str_) + end +end diff --git a/lib/moderation_api/models/operations/listprojects_response.rb b/lib/moderation_api/models/operations/listprojects_response.rb new file mode 100644 index 00000000..d760bf66 --- /dev/null +++ b/lib/moderation_api/models/operations/listprojects_response.rb @@ -0,0 +1,63 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class ListProjectsResponse + extend T::Sig + include Crystalline::MetadataFields + sig { returns(T.proc.returns(T.nilable(ListProjectsResponse))) } + attr_accessor :next_page + + # HTTP response content type for this operation + field :content_type, ::String + # HTTP response status code for this operation + field :status_code, ::Integer + # Raw HTTP response; suitable for custom response parsing + field :raw_response, ::Faraday::Response + # Projects retrieved successfully + field :object, Crystalline::Nilable.new(Models::Operations::ListProjectsResponseBody) + + sig { + params( + content_type: ::String, + status_code: ::Integer, + raw_response: ::Faraday::Response, + object: T.nilable(Models::Operations::ListProjectsResponseBody) + ) + .void + } + def initialize(content_type:, status_code:, raw_response:, object: nil) + @content_type = content_type + @status_code = status_code + @raw_response = raw_response + @object = object + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @content_type == other.content_type + return false unless @status_code == other.status_code + return false unless @raw_response == other.raw_response + return false unless @object == other.object + true + end + + def each + page = self + loop do + yield page + next_page = page.next_page.call if page.next_page + break if next_page.nil? + page = T.must(next_page) + end + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/listprojects_response.rbi b/lib/moderation_api/models/operations/listprojects_response.rbi new file mode 100644 index 00000000..61b4e48f --- /dev/null +++ b/lib/moderation_api/models/operations/listprojects_response.rbi @@ -0,0 +1,32 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::ListProjectsResponse + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::ListProjectsResponse + def content_type + end + + def content_type=(str_) + end + + def status_code + end + + def status_code=(str_) + end + + def raw_response + end + + def raw_response=(str_) + end + + def object + end + + def object=(str_) + end +end diff --git a/lib/moderation_api/models/operations/listprojects_responsebody.rb b/lib/moderation_api/models/operations/listprojects_responsebody.rb new file mode 100644 index 00000000..8d14bfa6 --- /dev/null +++ b/lib/moderation_api/models/operations/listprojects_responsebody.rb @@ -0,0 +1,43 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + # Projects retrieved successfully + class ListProjectsResponseBody + extend T::Sig + include Crystalline::MetadataFields + + # The items on this page. + field( + :data, + Crystalline::Array.new(Models::Components::Project), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("data"), required: true}} + ) + # Where this page is in the full list. + field( + :pagination, + Models::Components::Pagination, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("pagination"), required: true}} + ) + + sig { params(data: T::Array[Models::Components::Project], pagination: Models::Components::Pagination).void } + def initialize(data:, pagination:) + @data = data + @pagination = pagination + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @data == other.data + return false unless @pagination == other.pagination + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/listprojects_responsebody.rbi b/lib/moderation_api/models/operations/listprojects_responsebody.rbi new file mode 100644 index 00000000..6041eb04 --- /dev/null +++ b/lib/moderation_api/models/operations/listprojects_responsebody.rbi @@ -0,0 +1,20 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::ListProjectsResponseBody + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::ListProjectsResponseBody + def data + end + + def data=(str_) + end + + def pagination + end + + def pagination=(str_) + end +end diff --git a/lib/moderation_api/models/operations/listqueueitems_action.rb b/lib/moderation_api/models/operations/listqueueitems_action.rb new file mode 100644 index 00000000..b4262f29 --- /dev/null +++ b/lib/moderation_api/models/operations/listqueueitems_action.rb @@ -0,0 +1,72 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class ListQueueItemsAction + extend T::Sig + include Crystalline::MetadataFields + + # Action ID + field :id, ::String, {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("id"), required: true}} + # Action name + field( + :name, + ::String, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("name"), required: true}} + ) + # Unix timestamp of when the action was taken + field( + :timestamp, + ::Float, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("timestamp"), required: true}} + ) + # Action comment + field( + :comment, + Crystalline::Nilable.new(::String), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("comment")}} + ) + # Moderator userID + field( + :reviewer, + Crystalline::Nilable.new(::String), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("reviewer")}} + ) + + sig { + params( + id: ::String, + name: ::String, + timestamp: ::Float, + comment: T.nilable(::String), + reviewer: T.nilable(::String) + ) + .void + } + def initialize(id:, name:, timestamp:, comment: nil, reviewer: nil) + @id = id + @name = name + @timestamp = timestamp + @comment = comment + @reviewer = reviewer + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @id == other.id + return false unless @name == other.name + return false unless @timestamp == other.timestamp + return false unless @comment == other.comment + return false unless @reviewer == other.reviewer + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/listqueueitems_action.rbi b/lib/moderation_api/models/operations/listqueueitems_action.rbi new file mode 100644 index 00000000..125a4cc2 --- /dev/null +++ b/lib/moderation_api/models/operations/listqueueitems_action.rbi @@ -0,0 +1,38 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::ListQueueItemsAction + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::ListQueueItemsAction + def id + end + + def id=(str_) + end + + def name + end + + def name=(str_) + end + + def timestamp + end + + def timestamp=(str_) + end + + def comment + end + + def comment=(str_) + end + + def reviewer + end + + def reviewer=(str_) + end +end diff --git a/lib/moderation_api/models/operations/listqueueitems_data.rb b/lib/moderation_api/models/operations/listqueueitems_data.rb new file mode 100644 index 00000000..5b9083eb --- /dev/null +++ b/lib/moderation_api/models/operations/listqueueitems_data.rb @@ -0,0 +1,144 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class ListQueueItemsData + extend T::Sig + include Crystalline::MetadataFields + + # Content ID + field :id, ::String, {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("id"), required: true}} + # The content to be moderated + field( + :content, + ::String, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("content"), required: true}} + ) + + field( + :labels, + Crystalline::Array.new(Models::Operations::ListQueueItemsLabel), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("labels"), required: true}} + ) + # Whether the item is flagged by any label + field( + :flagged, + Crystalline::Boolean.new, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("flagged"), required: true}} + ) + # Status of the item + field( + :status, + Models::Operations::ListQueueItemsStatus, + { + 'format_json': { + 'letter_case': ::ModerationApi::Utils.field_name("status"), + required: true, + 'decoder': ::ModerationApi::Utils.open_enum_from_string(Models::Operations::ListQueueItemsStatus, false) + } + } + ) + # Unix timestamp of when the item was created + field( + :timestamp, + ::Float, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("timestamp"), required: true}} + ) + # Content language + field( + :language, + Crystalline::Nilable.new(::String), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("language")}} + ) + # Conversation ID + field( + :conversation_id, + Crystalline::Nilable.new(::String), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("conversationId")}} + ) + # Author ID + field( + :author_id, + Crystalline::Nilable.new(::String), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("authorId")}} + ) + # Action IDs taken on this item + field( + :actions, + Crystalline::Nilable.new(Crystalline::Array.new(Models::Operations::ListQueueItemsAction)), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("actions")}} + ) + # Type of the content object + field( + :content_type, + Crystalline::Nilable.new(::String), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("contentType")}} + ) + + sig { + params( + id: ::String, + content: ::String, + labels: T::Array[Models::Operations::ListQueueItemsLabel], + flagged: T::Boolean, + status: Models::Operations::ListQueueItemsStatus, + timestamp: ::Float, + language: T.nilable(::String), + conversation_id: T.nilable(::String), + author_id: T.nilable(::String), + actions: T.nilable(T::Array[Models::Operations::ListQueueItemsAction]), + content_type: T.nilable(::String) + ) + .void + } + def initialize( + id:, + content:, + labels:, + flagged:, + status:, + timestamp:, + language: nil, + conversation_id: nil, + author_id: nil, + actions: nil, + content_type: nil + ) + @id = id + @content = content + @labels = labels + @flagged = flagged + @status = status + @timestamp = timestamp + @language = language + @conversation_id = conversation_id + @author_id = author_id + @actions = actions + @content_type = content_type + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @id == other.id + return false unless @content == other.content + return false unless @labels == other.labels + return false unless @flagged == other.flagged + return false unless @status == other.status + return false unless @timestamp == other.timestamp + return false unless @language == other.language + return false unless @conversation_id == other.conversation_id + return false unless @author_id == other.author_id + return false unless @actions == other.actions + return false unless @content_type == other.content_type + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/listqueueitems_data.rbi b/lib/moderation_api/models/operations/listqueueitems_data.rbi new file mode 100644 index 00000000..4a0f8f1b --- /dev/null +++ b/lib/moderation_api/models/operations/listqueueitems_data.rbi @@ -0,0 +1,74 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::ListQueueItemsData + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::ListQueueItemsData + def id + end + + def id=(str_) + end + + def content + end + + def content=(str_) + end + + def labels + end + + def labels=(str_) + end + + def flagged + end + + def flagged=(str_) + end + + def status + end + + def status=(str_) + end + + def timestamp + end + + def timestamp=(str_) + end + + def language + end + + def language=(str_) + end + + def conversation_id + end + + def conversation_id=(str_) + end + + def author_id + end + + def author_id=(str_) + end + + def actions + end + + def actions=(str_) + end + + def content_type + end + + def content_type=(str_) + end +end diff --git a/lib/moderation_api/models/operations/listqueueitems_label.rb b/lib/moderation_api/models/operations/listqueueitems_label.rb new file mode 100644 index 00000000..80f85828 --- /dev/null +++ b/lib/moderation_api/models/operations/listqueueitems_label.rb @@ -0,0 +1,51 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class ListQueueItemsLabel + extend T::Sig + include Crystalline::MetadataFields + + # Label name + field( + :label, + ::String, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("label"), required: true}} + ) + # Confidence score of the label + field( + :score, + ::Float, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("score"), required: true}} + ) + # Whether this label caused a flag + field( + :flagged, + Crystalline::Boolean.new, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("flagged"), required: true}} + ) + + sig { params(label: ::String, score: ::Float, flagged: T::Boolean).void } + def initialize(label:, score:, flagged:) + @label = label + @score = score + @flagged = flagged + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @label == other.label + return false unless @score == other.score + return false unless @flagged == other.flagged + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/listqueueitems_label.rbi b/lib/moderation_api/models/operations/listqueueitems_label.rbi new file mode 100644 index 00000000..27cbb2c5 --- /dev/null +++ b/lib/moderation_api/models/operations/listqueueitems_label.rbi @@ -0,0 +1,26 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::ListQueueItemsLabel + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::ListQueueItemsLabel + def label + end + + def label=(str_) + end + + def score + end + + def score=(str_) + end + + def flagged + end + + def flagged=(str_) + end +end diff --git a/lib/moderation_api/models/operations/listqueueitems_request.rb b/lib/moderation_api/models/operations/listqueueitems_request.rb new file mode 100644 index 00000000..9122d792 --- /dev/null +++ b/lib/moderation_api/models/operations/listqueueitems_request.rb @@ -0,0 +1,148 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class ListQueueItemsRequest + extend T::Sig + include Crystalline::MetadataFields + + # The queue ID + field :id, ::String, {'path_param': {'field_name': "id", 'style': "simple", 'explode': false}} + + field( + :sort_field, + Crystalline::Nilable.new(Models::Operations::SortField), + {'query_param': {'field_name': "sortField", 'style': "form", 'explode': true}} + ) + + field( + :conversation_ids, + Crystalline::Nilable.new(Crystalline::Array.new(::String)), + {'query_param': {'field_name': "conversationIds", 'style': "form", 'explode': true}} + ) + + field( + :labels, + Crystalline::Nilable.new(Crystalline::Array.new(::String)), + {'query_param': {'field_name': "labels", 'style': "form", 'explode': true}} + ) + + field( + :after_date, + Crystalline::Nilable.new(::String), + {'query_param': {'field_name': "afterDate", 'style': "form", 'explode': true}} + ) + + field( + :before_date, + Crystalline::Nilable.new(::String), + {'query_param': {'field_name': "beforeDate", 'style': "form", 'explode': true}} + ) + + field( + :include_resolved, + Crystalline::Nilable.new(Crystalline::Boolean.new), + {'query_param': {'field_name': "includeResolved", 'style': "form", 'explode': true}} + ) + + field( + :author_id, + Crystalline::Nilable.new(::String), + {'query_param': {'field_name': "authorId", 'style': "form", 'explode': true}} + ) + + field( + :filtered_action_ids, + Crystalline::Nilable.new(Crystalline::Array.new(::String)), + {'query_param': {'field_name': "filteredActionIds", 'style': "form", 'explode': true}} + ) + + field( + :page, + Crystalline::Nilable.new(::Integer), + {'query_param': {'field_name': "page", 'style': "form", 'explode': true}} + ) + + field( + :page_size, + Crystalline::Nilable.new(::Integer), + {'query_param': {'field_name': "pageSize", 'style': "form", 'explode': true}} + ) + # Sort direction + field( + :sort_direction, + Crystalline::Nilable.new(Models::Operations::ListQueueItemsSortDirection), + {'query_param': {'field_name': "sortDirection", 'style': "form", 'explode': true}} + ) + + sig { + params( + id: ::String, + sort_field: T.nilable(Models::Operations::SortField), + conversation_ids: T.nilable(T::Array[::String]), + labels: T.nilable(T::Array[::String]), + after_date: T.nilable(::String), + before_date: T.nilable(::String), + include_resolved: T.nilable(T::Boolean), + author_id: T.nilable(::String), + filtered_action_ids: T.nilable(T::Array[::String]), + page: T.nilable(::Integer), + page_size: T.nilable(::Integer), + sort_direction: T.nilable(Models::Operations::ListQueueItemsSortDirection) + ) + .void + } + def initialize( + id:, + sort_field: nil, + conversation_ids: nil, + labels: nil, + after_date: nil, + before_date: nil, + include_resolved: nil, + author_id: nil, + filtered_action_ids: nil, + page: 1, + page_size: 20, + sort_direction: Models::Operations::ListQueueItemsSortDirection::DESC + ) + @id = id + @sort_field = sort_field + @conversation_ids = conversation_ids + @labels = labels + @after_date = after_date + @before_date = before_date + @include_resolved = include_resolved + @author_id = author_id + @filtered_action_ids = filtered_action_ids + @page = page + @page_size = page_size + @sort_direction = sort_direction + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @id == other.id + return false unless @sort_field == other.sort_field + return false unless @conversation_ids == other.conversation_ids + return false unless @labels == other.labels + return false unless @after_date == other.after_date + return false unless @before_date == other.before_date + return false unless @include_resolved == other.include_resolved + return false unless @author_id == other.author_id + return false unless @filtered_action_ids == other.filtered_action_ids + return false unless @page == other.page + return false unless @page_size == other.page_size + return false unless @sort_direction == other.sort_direction + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/listqueueitems_request.rbi b/lib/moderation_api/models/operations/listqueueitems_request.rbi new file mode 100644 index 00000000..5f2e08e5 --- /dev/null +++ b/lib/moderation_api/models/operations/listqueueitems_request.rbi @@ -0,0 +1,80 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::ListQueueItemsRequest + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::ListQueueItemsRequest + def id + end + + def id=(str_) + end + + def sort_field + end + + def sort_field=(str_) + end + + def conversation_ids + end + + def conversation_ids=(str_) + end + + def labels + end + + def labels=(str_) + end + + def after_date + end + + def after_date=(str_) + end + + def before_date + end + + def before_date=(str_) + end + + def include_resolved + end + + def include_resolved=(str_) + end + + def author_id + end + + def author_id=(str_) + end + + def filtered_action_ids + end + + def filtered_action_ids=(str_) + end + + def page + end + + def page=(str_) + end + + def page_size + end + + def page_size=(str_) + end + + def sort_direction + end + + def sort_direction=(str_) + end +end diff --git a/lib/moderation_api/models/operations/listqueueitems_response.rb b/lib/moderation_api/models/operations/listqueueitems_response.rb new file mode 100644 index 00000000..2728a61a --- /dev/null +++ b/lib/moderation_api/models/operations/listqueueitems_response.rb @@ -0,0 +1,63 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class ListQueueItemsResponse + extend T::Sig + include Crystalline::MetadataFields + sig { returns(T.proc.returns(T.nilable(ListQueueItemsResponse))) } + attr_accessor :next_page + + # HTTP response content type for this operation + field :content_type, ::String + # HTTP response status code for this operation + field :status_code, ::Integer + # Raw HTTP response; suitable for custom response parsing + field :raw_response, ::Faraday::Response + # Successful response + field :object, Crystalline::Nilable.new(Models::Operations::ListQueueItemsResponseBody) + + sig { + params( + content_type: ::String, + status_code: ::Integer, + raw_response: ::Faraday::Response, + object: T.nilable(Models::Operations::ListQueueItemsResponseBody) + ) + .void + } + def initialize(content_type:, status_code:, raw_response:, object: nil) + @content_type = content_type + @status_code = status_code + @raw_response = raw_response + @object = object + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @content_type == other.content_type + return false unless @status_code == other.status_code + return false unless @raw_response == other.raw_response + return false unless @object == other.object + true + end + + def each + page = self + loop do + yield page + next_page = page.next_page.call if page.next_page + break if next_page.nil? + page = T.must(next_page) + end + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/listqueueitems_response.rbi b/lib/moderation_api/models/operations/listqueueitems_response.rbi new file mode 100644 index 00000000..1c3df3b8 --- /dev/null +++ b/lib/moderation_api/models/operations/listqueueitems_response.rbi @@ -0,0 +1,32 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::ListQueueItemsResponse + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::ListQueueItemsResponse + def content_type + end + + def content_type=(str_) + end + + def status_code + end + + def status_code=(str_) + end + + def raw_response + end + + def raw_response=(str_) + end + + def object + end + + def object=(str_) + end +end diff --git a/lib/moderation_api/models/operations/listqueueitems_responsebody.rb b/lib/moderation_api/models/operations/listqueueitems_responsebody.rb new file mode 100644 index 00000000..ce24d329 --- /dev/null +++ b/lib/moderation_api/models/operations/listqueueitems_responsebody.rb @@ -0,0 +1,46 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + # Successful response + class ListQueueItemsResponseBody + extend T::Sig + include Crystalline::MetadataFields + + # The items on this page. + field( + :data, + Crystalline::Array.new(Models::Operations::ListQueueItemsData), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("data"), required: true}} + ) + # Where this page is in the full list. + field( + :pagination, + Models::Components::Pagination, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("pagination"), required: true}} + ) + + sig { + params(data: T::Array[Models::Operations::ListQueueItemsData], pagination: Models::Components::Pagination) + .void + } + def initialize(data:, pagination:) + @data = data + @pagination = pagination + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @data == other.data + return false unless @pagination == other.pagination + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/listqueueitems_responsebody.rbi b/lib/moderation_api/models/operations/listqueueitems_responsebody.rbi new file mode 100644 index 00000000..edacb38c --- /dev/null +++ b/lib/moderation_api/models/operations/listqueueitems_responsebody.rbi @@ -0,0 +1,20 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::ListQueueItemsResponseBody + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::ListQueueItemsResponseBody + def data + end + + def data=(str_) + end + + def pagination + end + + def pagination=(str_) + end +end diff --git a/lib/moderation_api/models/operations/listqueueitems_sortdirection.rb b/lib/moderation_api/models/operations/listqueueitems_sortdirection.rb new file mode 100644 index 00000000..773a54e2 --- /dev/null +++ b/lib/moderation_api/models/operations/listqueueitems_sortdirection.rb @@ -0,0 +1,18 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + # ListQueueItemsSortDirection - Sort direction + class ListQueueItemsSortDirection < T::Enum + enums do + ASC = new("asc") + DESC = new("desc") + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/listqueueitems_sortdirection.rbi b/lib/moderation_api/models/operations/listqueueitems_sortdirection.rbi new file mode 100644 index 00000000..7671d2ec --- /dev/null +++ b/lib/moderation_api/models/operations/listqueueitems_sortdirection.rbi @@ -0,0 +1,9 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::ListQueueItemsSortDirection + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::ListQueueItemsSortDirection +end diff --git a/lib/moderation_api/models/operations/listqueueitems_status.rb b/lib/moderation_api/models/operations/listqueueitems_status.rb new file mode 100644 index 00000000..c5b65b3a --- /dev/null +++ b/lib/moderation_api/models/operations/listqueueitems_status.rb @@ -0,0 +1,21 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + # ListQueueItemsStatus - Status of the item + class ListQueueItemsStatus + include ::Crystalline::Enum + enums do + PENDING = new("pending") + RESOLVED = new("resolved") + end + + open! + end + end + end +end diff --git a/lib/moderation_api/models/operations/listqueueitems_status.rbi b/lib/moderation_api/models/operations/listqueueitems_status.rbi new file mode 100644 index 00000000..5a0358a9 --- /dev/null +++ b/lib/moderation_api/models/operations/listqueueitems_status.rbi @@ -0,0 +1,9 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::ListQueueItemsStatus + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::ListQueueItemsStatus +end diff --git a/lib/moderation_api/models/operations/listwebhooks_data.rb b/lib/moderation_api/models/operations/listwebhooks_data.rb new file mode 100644 index 00000000..dd05650b --- /dev/null +++ b/lib/moderation_api/models/operations/listwebhooks_data.rb @@ -0,0 +1,95 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class ListWebhooksData + extend T::Sig + include Crystalline::MetadataFields + + # The ID of the webhook. + field :id, ::String, {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("id"), required: true}} + # The webhook's name. + field( + :name, + ::String, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("name"), required: true}} + ) + # The URL we call when a subscribed event occurs. + field :url, ::String, {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("url"), required: true}} + # Event types this webhook subscribes to. Empty for legacy v1 webhooks, which subscribe via their single deprecated `type` instead. + field( + :event_types, + Crystalline::Array.new(Models::Operations::ListWebhooksEventType), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("eventTypes"), required: true}} + ) + # Payload envelope version. V2 is the Stripe-style envelope; V1 is the legacy flat shape and is read-only via this API. + field( + :payload_version, + Models::Operations::ListWebhooksPayloadVersion, + { + 'format_json': { + 'letter_case': ::ModerationApi::Utils.field_name("payloadVersion"), + required: true, + 'decoder': ::ModerationApi::Utils.open_enum_from_string( + Models::Operations::ListWebhooksPayloadVersion, + false + ) + } + } + ) + # The date the webhook was created. + field( + :created_at, + ::String, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("createdAt"), required: true}} + ) + # The webhook's description. + field( + :description, + Crystalline::Nilable.new(::String), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("description")}} + ) + + sig { + params( + id: ::String, + name: ::String, + url: ::String, + event_types: T::Array[Models::Operations::ListWebhooksEventType], + payload_version: Models::Operations::ListWebhooksPayloadVersion, + created_at: ::String, + description: T.nilable(::String) + ) + .void + } + def initialize(id:, name:, url:, event_types:, payload_version:, created_at:, description: nil) + @id = id + @name = name + @url = url + @event_types = event_types + @payload_version = payload_version + @created_at = created_at + @description = description + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @id == other.id + return false unless @name == other.name + return false unless @url == other.url + return false unless @event_types == other.event_types + return false unless @payload_version == other.payload_version + return false unless @created_at == other.created_at + return false unless @description == other.description + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/listwebhooks_data.rbi b/lib/moderation_api/models/operations/listwebhooks_data.rbi new file mode 100644 index 00000000..e8a1c153 --- /dev/null +++ b/lib/moderation_api/models/operations/listwebhooks_data.rbi @@ -0,0 +1,50 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::ListWebhooksData + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::ListWebhooksData + def id + end + + def id=(str_) + end + + def name + end + + def name=(str_) + end + + def url + end + + def url=(str_) + end + + def event_types + end + + def event_types=(str_) + end + + def payload_version + end + + def payload_version=(str_) + end + + def created_at + end + + def created_at=(str_) + end + + def description + end + + def description=(str_) + end +end diff --git a/lib/moderation_api/models/operations/listwebhooks_eventtype.rb b/lib/moderation_api/models/operations/listwebhooks_eventtype.rb new file mode 100644 index 00000000..7ba4088b --- /dev/null +++ b/lib/moderation_api/models/operations/listwebhooks_eventtype.rb @@ -0,0 +1,30 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class ListWebhooksEventType + include ::Crystalline::Enum + enums do + QUEUE_ITEM_NEW = new("QUEUE_ITEM_NEW") + QUEUE_ITEM_COMPLETED = new("QUEUE_ITEM_COMPLETED") + QUEUE_ITEM_ACTION = new("QUEUE_ITEM_ACTION") + QUEUE_ITEM_REJECTED = new("QUEUE_ITEM_REJECTED") + QUEUE_ITEM_ALLOWED = new("QUEUE_ITEM_ALLOWED") + AUTHOR_BLOCKED = new("AUTHOR_BLOCKED") + AUTHOR_UNBLOCKED = new("AUTHOR_UNBLOCKED") + AUTHOR_SUSPENDED = new("AUTHOR_SUSPENDED") + AUTHOR_UPDATED = new("AUTHOR_UPDATED") + AUTHOR_TRUST_LEVEL_CHANGED = new("AUTHOR_TRUST_LEVEL_CHANGED") + AUTHOR_ACTION = new("AUTHOR_ACTION") + end + + open! + end + end + end +end diff --git a/lib/moderation_api/models/operations/listwebhooks_eventtype.rbi b/lib/moderation_api/models/operations/listwebhooks_eventtype.rbi new file mode 100644 index 00000000..e7610211 --- /dev/null +++ b/lib/moderation_api/models/operations/listwebhooks_eventtype.rbi @@ -0,0 +1,9 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::ListWebhooksEventType + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::ListWebhooksEventType +end diff --git a/lib/moderation_api/models/operations/listwebhooks_payloadversion.rb b/lib/moderation_api/models/operations/listwebhooks_payloadversion.rb new file mode 100644 index 00000000..0cf606c3 --- /dev/null +++ b/lib/moderation_api/models/operations/listwebhooks_payloadversion.rb @@ -0,0 +1,21 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + # ListWebhooksPayloadVersion - Payload envelope version. V2 is the Stripe-style envelope; V1 is the legacy flat shape and is read-only via this API. + class ListWebhooksPayloadVersion + include ::Crystalline::Enum + enums do + V1 = new("V1") + V2 = new("V2") + end + + open! + end + end + end +end diff --git a/lib/moderation_api/models/operations/listwebhooks_payloadversion.rbi b/lib/moderation_api/models/operations/listwebhooks_payloadversion.rbi new file mode 100644 index 00000000..c6e2fe70 --- /dev/null +++ b/lib/moderation_api/models/operations/listwebhooks_payloadversion.rbi @@ -0,0 +1,9 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::ListWebhooksPayloadVersion + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::ListWebhooksPayloadVersion +end diff --git a/lib/moderation_api/models/operations/listwebhooks_request.rb b/lib/moderation_api/models/operations/listwebhooks_request.rb new file mode 100644 index 00000000..48080ecb --- /dev/null +++ b/lib/moderation_api/models/operations/listwebhooks_request.rb @@ -0,0 +1,42 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class ListWebhooksRequest + extend T::Sig + include Crystalline::MetadataFields + + field( + :page, + Crystalline::Nilable.new(::Integer), + {'query_param': {'field_name': "page", 'style': "form", 'explode': true}} + ) + + field( + :page_size, + Crystalline::Nilable.new(::Integer), + {'query_param': {'field_name': "pageSize", 'style': "form", 'explode': true}} + ) + + sig { params(page: T.nilable(::Integer), page_size: T.nilable(::Integer)).void } + def initialize(page: 1, page_size: 20) + @page = page + @page_size = page_size + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @page == other.page + return false unless @page_size == other.page_size + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/listwebhooks_request.rbi b/lib/moderation_api/models/operations/listwebhooks_request.rbi new file mode 100644 index 00000000..ea930148 --- /dev/null +++ b/lib/moderation_api/models/operations/listwebhooks_request.rbi @@ -0,0 +1,20 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::ListWebhooksRequest + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::ListWebhooksRequest + def page + end + + def page=(str_) + end + + def page_size + end + + def page_size=(str_) + end +end diff --git a/lib/moderation_api/models/operations/listwebhooks_response.rb b/lib/moderation_api/models/operations/listwebhooks_response.rb new file mode 100644 index 00000000..66e61c18 --- /dev/null +++ b/lib/moderation_api/models/operations/listwebhooks_response.rb @@ -0,0 +1,63 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class ListWebhooksResponse + extend T::Sig + include Crystalline::MetadataFields + sig { returns(T.proc.returns(T.nilable(ListWebhooksResponse))) } + attr_accessor :next_page + + # HTTP response content type for this operation + field :content_type, ::String + # HTTP response status code for this operation + field :status_code, ::Integer + # Raw HTTP response; suitable for custom response parsing + field :raw_response, ::Faraday::Response + # Webhooks retrieved successfully + field :object, Crystalline::Nilable.new(Models::Operations::ListWebhooksResponseBody) + + sig { + params( + content_type: ::String, + status_code: ::Integer, + raw_response: ::Faraday::Response, + object: T.nilable(Models::Operations::ListWebhooksResponseBody) + ) + .void + } + def initialize(content_type:, status_code:, raw_response:, object: nil) + @content_type = content_type + @status_code = status_code + @raw_response = raw_response + @object = object + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @content_type == other.content_type + return false unless @status_code == other.status_code + return false unless @raw_response == other.raw_response + return false unless @object == other.object + true + end + + def each + page = self + loop do + yield page + next_page = page.next_page.call if page.next_page + break if next_page.nil? + page = T.must(next_page) + end + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/listwebhooks_response.rbi b/lib/moderation_api/models/operations/listwebhooks_response.rbi new file mode 100644 index 00000000..e50d5b1f --- /dev/null +++ b/lib/moderation_api/models/operations/listwebhooks_response.rbi @@ -0,0 +1,32 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::ListWebhooksResponse + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::ListWebhooksResponse + def content_type + end + + def content_type=(str_) + end + + def status_code + end + + def status_code=(str_) + end + + def raw_response + end + + def raw_response=(str_) + end + + def object + end + + def object=(str_) + end +end diff --git a/lib/moderation_api/models/operations/listwebhooks_responsebody.rb b/lib/moderation_api/models/operations/listwebhooks_responsebody.rb new file mode 100644 index 00000000..672604c2 --- /dev/null +++ b/lib/moderation_api/models/operations/listwebhooks_responsebody.rb @@ -0,0 +1,45 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + # Webhooks retrieved successfully + class ListWebhooksResponseBody + extend T::Sig + include Crystalline::MetadataFields + + # The items on this page. + field( + :data, + Crystalline::Array.new(Models::Operations::ListWebhooksData), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("data"), required: true}} + ) + # Where this page is in the full list. + field( + :pagination, + Models::Components::Pagination, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("pagination"), required: true}} + ) + + sig { + params(data: T::Array[Models::Operations::ListWebhooksData], pagination: Models::Components::Pagination).void + } + def initialize(data:, pagination:) + @data = data + @pagination = pagination + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @data == other.data + return false unless @pagination == other.pagination + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/listwebhooks_responsebody.rbi b/lib/moderation_api/models/operations/listwebhooks_responsebody.rbi new file mode 100644 index 00000000..7da6b689 --- /dev/null +++ b/lib/moderation_api/models/operations/listwebhooks_responsebody.rbi @@ -0,0 +1,20 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::ListWebhooksResponseBody + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::ListWebhooksResponseBody + def data + end + + def data=(str_) + end + + def pagination + end + + def pagination=(str_) + end +end diff --git a/lib/moderation_api/models/operations/listwordlists_data.rb b/lib/moderation_api/models/operations/listwordlists_data.rb new file mode 100644 index 00000000..743880c4 --- /dev/null +++ b/lib/moderation_api/models/operations/listwordlists_data.rb @@ -0,0 +1,72 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class ListWordlistsData + extend T::Sig + include Crystalline::MetadataFields + + # Unique identifier of the wordlist + field :id, ::String, {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("id"), required: true}} + # Name of the wordlist + field( + :name, + Crystalline::Nilable.new(::String), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("name"), required: true}} + ) + # Description of the wordlist + field( + :description, + Crystalline::Nilable.new(::String), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("description"), required: true}} + ) + # When the wordlist was created + field( + :created_at, + Crystalline::Nilable.new(::String), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("createdAt"), required: true}} + ) + # User who created the wordlist + field( + :user_id, + Crystalline::Nilable.new(::String), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("userId"), required: true}} + ) + + sig { + params( + id: ::String, + name: T.nilable(::String), + description: T.nilable(::String), + created_at: T.nilable(::String), + user_id: T.nilable(::String) + ) + .void + } + def initialize(id:, name: nil, description: nil, created_at: nil, user_id: nil) + @id = id + @name = name + @description = description + @created_at = created_at + @user_id = user_id + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @id == other.id + return false unless @name == other.name + return false unless @description == other.description + return false unless @created_at == other.created_at + return false unless @user_id == other.user_id + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/listwordlists_data.rbi b/lib/moderation_api/models/operations/listwordlists_data.rbi new file mode 100644 index 00000000..6403a519 --- /dev/null +++ b/lib/moderation_api/models/operations/listwordlists_data.rbi @@ -0,0 +1,38 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::ListWordlistsData + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::ListWordlistsData + def id + end + + def id=(str_) + end + + def name + end + + def name=(str_) + end + + def description + end + + def description=(str_) + end + + def created_at + end + + def created_at=(str_) + end + + def user_id + end + + def user_id=(str_) + end +end diff --git a/lib/moderation_api/models/operations/listwordlists_request.rb b/lib/moderation_api/models/operations/listwordlists_request.rb new file mode 100644 index 00000000..d37cc999 --- /dev/null +++ b/lib/moderation_api/models/operations/listwordlists_request.rb @@ -0,0 +1,42 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class ListWordlistsRequest + extend T::Sig + include Crystalline::MetadataFields + + field( + :page, + Crystalline::Nilable.new(::Integer), + {'query_param': {'field_name': "page", 'style': "form", 'explode': true}} + ) + + field( + :page_size, + Crystalline::Nilable.new(::Integer), + {'query_param': {'field_name': "pageSize", 'style': "form", 'explode': true}} + ) + + sig { params(page: T.nilable(::Integer), page_size: T.nilable(::Integer)).void } + def initialize(page: 1, page_size: 20) + @page = page + @page_size = page_size + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @page == other.page + return false unless @page_size == other.page_size + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/listwordlists_request.rbi b/lib/moderation_api/models/operations/listwordlists_request.rbi new file mode 100644 index 00000000..bbdddd36 --- /dev/null +++ b/lib/moderation_api/models/operations/listwordlists_request.rbi @@ -0,0 +1,20 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::ListWordlistsRequest + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::ListWordlistsRequest + def page + end + + def page=(str_) + end + + def page_size + end + + def page_size=(str_) + end +end diff --git a/lib/moderation_api/models/operations/listwordlists_response.rb b/lib/moderation_api/models/operations/listwordlists_response.rb new file mode 100644 index 00000000..a6a004a1 --- /dev/null +++ b/lib/moderation_api/models/operations/listwordlists_response.rb @@ -0,0 +1,63 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class ListWordlistsResponse + extend T::Sig + include Crystalline::MetadataFields + sig { returns(T.proc.returns(T.nilable(ListWordlistsResponse))) } + attr_accessor :next_page + + # HTTP response content type for this operation + field :content_type, ::String + # HTTP response status code for this operation + field :status_code, ::Integer + # Raw HTTP response; suitable for custom response parsing + field :raw_response, ::Faraday::Response + # Successful response + field :object, Crystalline::Nilable.new(Models::Operations::ListWordlistsResponseBody) + + sig { + params( + content_type: ::String, + status_code: ::Integer, + raw_response: ::Faraday::Response, + object: T.nilable(Models::Operations::ListWordlistsResponseBody) + ) + .void + } + def initialize(content_type:, status_code:, raw_response:, object: nil) + @content_type = content_type + @status_code = status_code + @raw_response = raw_response + @object = object + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @content_type == other.content_type + return false unless @status_code == other.status_code + return false unless @raw_response == other.raw_response + return false unless @object == other.object + true + end + + def each + page = self + loop do + yield page + next_page = page.next_page.call if page.next_page + break if next_page.nil? + page = T.must(next_page) + end + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/listwordlists_response.rbi b/lib/moderation_api/models/operations/listwordlists_response.rbi new file mode 100644 index 00000000..5c96b4d8 --- /dev/null +++ b/lib/moderation_api/models/operations/listwordlists_response.rbi @@ -0,0 +1,32 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::ListWordlistsResponse + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::ListWordlistsResponse + def content_type + end + + def content_type=(str_) + end + + def status_code + end + + def status_code=(str_) + end + + def raw_response + end + + def raw_response=(str_) + end + + def object + end + + def object=(str_) + end +end diff --git a/lib/moderation_api/models/operations/listwordlists_responsebody.rb b/lib/moderation_api/models/operations/listwordlists_responsebody.rb new file mode 100644 index 00000000..9cbaf09c --- /dev/null +++ b/lib/moderation_api/models/operations/listwordlists_responsebody.rb @@ -0,0 +1,45 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + # Successful response + class ListWordlistsResponseBody + extend T::Sig + include Crystalline::MetadataFields + + # The items on this page. + field( + :data, + Crystalline::Array.new(Models::Operations::ListWordlistsData), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("data"), required: true}} + ) + # Where this page is in the full list. + field( + :pagination, + Models::Components::Pagination, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("pagination"), required: true}} + ) + + sig { + params(data: T::Array[Models::Operations::ListWordlistsData], pagination: Models::Components::Pagination).void + } + def initialize(data:, pagination:) + @data = data + @pagination = pagination + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @data == other.data + return false unless @pagination == other.pagination + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/listwordlists_responsebody.rbi b/lib/moderation_api/models/operations/listwordlists_responsebody.rbi new file mode 100644 index 00000000..eb080d9f --- /dev/null +++ b/lib/moderation_api/models/operations/listwordlists_responsebody.rbi @@ -0,0 +1,20 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::ListWordlistsResponseBody + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::ListWordlistsResponseBody + def data + end + + def data=(str_) + end + + def pagination + end + + def pagination=(str_) + end +end diff --git a/lib/moderation_api/models/operations/low_quality_content.rb b/lib/moderation_api/models/operations/low_quality_content.rb new file mode 100644 index 00000000..44e164bc --- /dev/null +++ b/lib/moderation_api/models/operations/low_quality_content.rb @@ -0,0 +1,60 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class LowQualityContent + extend T::Sig + include Crystalline::MetadataFields + + field( + :flag, + Crystalline::Boolean.new, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("flag"), required: true}} + ) + + field( + :threshold, + Crystalline::Nilable.new(::Float), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("threshold")}} + ) + + field :id, ::String, {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("id"), required: true}} + # Flag content with fewer than this many words as low-effort. Defaults to 3. Set to disable by omitting. + field( + :min_words, + Crystalline::Nilable.new(::Integer), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("minWords")}} + ) + + sig { + params(flag: T::Boolean, threshold: T.nilable(::Float), id: ::String, min_words: T.nilable(::Integer)).void + } + def initialize(flag:, threshold: nil, id: "low_quality", min_words: nil) + @flag = flag + @threshold = threshold + unless id == "low_quality" + raise ArgumentError, "Invalid value for id" + end + + @id = "low_quality" + @min_words = min_words + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @flag == other.flag + return false unless @threshold == other.threshold + return false unless @id == other.id + return false unless @min_words == other.min_words + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/low_quality_content.rbi b/lib/moderation_api/models/operations/low_quality_content.rbi new file mode 100644 index 00000000..8afc57ca --- /dev/null +++ b/lib/moderation_api/models/operations/low_quality_content.rbi @@ -0,0 +1,32 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::LowQualityContent + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::LowQualityContent + def flag + end + + def flag=(str_) + end + + def threshold + end + + def threshold=(str_) + end + + def id + end + + def id=(str_) + end + + def min_words + end + + def min_words=(str_) + end +end diff --git a/lib/moderation_api/models/operations/match.rb b/lib/moderation_api/models/operations/match.rb new file mode 100644 index 00000000..ef324740 --- /dev/null +++ b/lib/moderation_api/models/operations/match.rb @@ -0,0 +1,84 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class Match + extend T::Sig + include Crystalline::MetadataFields + + field( + :probability, + ::Float, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("probability"), required: true}} + ) + + field( + :match, + ::String, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("match"), required: true}} + ) + + field( + :span, + Crystalline::Array.new(::Integer), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("span"), required: true}} + ) + # Stable codes explaining why a URL was flagged (URL Risk only). + field( + :reasons, + Crystalline::Nilable.new(Crystalline::Array.new(::String)), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("reasons")}} + ) + # Observable properties of a URL (URL Risk only). Absent for allow/block list matches. + field( + :signals, + Crystalline::Nilable.new(Models::Operations::SignalsResponse), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("signals")}} + ) + # Sub-type of the entity match — e.g. the NER key (email, phone, name, …) for PII matches. Absent for URL Risk and wordlist matches where the type is already encoded in the parent label. + field( + :entity_type, + Crystalline::Nilable.new(::String), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("entity_type")}} + ) + + sig { + params( + probability: ::Float, + match: ::String, + span: T::Array[::Integer], + reasons: T.nilable(T::Array[::String]), + signals: T.nilable(Models::Operations::SignalsResponse), + entity_type: T.nilable(::String) + ) + .void + } + def initialize(probability:, match:, span:, reasons: nil, signals: nil, entity_type: nil) + @probability = probability + @match = match + @span = span + @reasons = reasons + @signals = signals + @entity_type = entity_type + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @probability == other.probability + return false unless @match == other.match + return false unless @span == other.span + return false unless @reasons == other.reasons + return false unless @signals == other.signals + return false unless @entity_type == other.entity_type + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/match.rbi b/lib/moderation_api/models/operations/match.rbi new file mode 100644 index 00000000..0b88f702 --- /dev/null +++ b/lib/moderation_api/models/operations/match.rbi @@ -0,0 +1,44 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::Match + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::Match + def probability + end + + def probability=(str_) + end + + def match + end + + def match=(str_) + end + + def span + end + + def span=(str_) + end + + def reasons + end + + def reasons=(str_) + end + + def signals + end + + def signals=(str_) + end + + def entity_type + end + + def entity_type=(str_) + end +end diff --git a/lib/moderation_api/models/operations/matched_rule.rb b/lib/moderation_api/models/operations/matched_rule.rb new file mode 100644 index 00000000..cd7aa01d --- /dev/null +++ b/lib/moderation_api/models/operations/matched_rule.rb @@ -0,0 +1,38 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class MatchedRule + extend T::Sig + include Crystalline::MetadataFields + + field :key, ::String, {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("key"), required: true}} + + field( + :name, + ::String, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("name"), required: true}} + ) + + sig { params(key: ::String, name: ::String).void } + def initialize(key:, name:) + @key = key + @name = name + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @key == other.key + return false unless @name == other.name + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/matched_rule.rbi b/lib/moderation_api/models/operations/matched_rule.rbi new file mode 100644 index 00000000..3aa22e20 --- /dev/null +++ b/lib/moderation_api/models/operations/matched_rule.rbi @@ -0,0 +1,20 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::MatchedRule + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::MatchedRule + def key + end + + def key=(str_) + end + + def name + end + + def name=(str_) + end +end diff --git a/lib/moderation_api/models/operations/mediatype.rb b/lib/moderation_api/models/operations/mediatype.rb new file mode 100644 index 00000000..2c595766 --- /dev/null +++ b/lib/moderation_api/models/operations/mediatype.rb @@ -0,0 +1,24 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class MediaType + include ::Crystalline::Enum + enums do + TEXT = new("text") + IMAGE = new("image") + VIDEO = new("video") + OBJECT = new("object") + AUDIO = new("audio") + end + + open! + end + end + end +end diff --git a/lib/moderation_api/models/operations/mediatype.rbi b/lib/moderation_api/models/operations/mediatype.rbi new file mode 100644 index 00000000..5303bfc7 --- /dev/null +++ b/lib/moderation_api/models/operations/mediatype.rbi @@ -0,0 +1,9 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::MediaType + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::MediaType +end diff --git a/lib/moderation_api/models/operations/meta.rb b/lib/moderation_api/models/operations/meta.rb new file mode 100644 index 00000000..6ca0bc16 --- /dev/null +++ b/lib/moderation_api/models/operations/meta.rb @@ -0,0 +1,81 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + # Metadata about the moderation request + class Meta + extend T::Sig + include Crystalline::MetadataFields + + field( + :status, + Models::Operations::MetaStatus, + { + 'format_json': { + 'letter_case': ::ModerationApi::Utils.field_name("status"), + required: true, + 'decoder': ::ModerationApi::Utils.open_enum_from_string(Models::Operations::MetaStatus, false) + } + } + ) + + field( + :timestamp, + ::Float, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("timestamp"), required: true}} + ) + # The unique key of the channel where the content was handled. Either the channel provided by you or automatically routed. + field( + :channel_key, + ::String, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("channel_key"), required: true}} + ) + + field( + :usage, + ::Float, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("usage"), required: true}} + ) + + field( + :processing_time, + Crystalline::Nilable.new(::String), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("processing_time")}} + ) + + sig { + params( + status: Models::Operations::MetaStatus, + timestamp: ::Float, + channel_key: ::String, + usage: ::Float, + processing_time: T.nilable(::String) + ) + .void + } + def initialize(status:, timestamp:, channel_key:, usage:, processing_time: nil) + @status = status + @timestamp = timestamp + @channel_key = channel_key + @usage = usage + @processing_time = processing_time + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @status == other.status + return false unless @timestamp == other.timestamp + return false unless @channel_key == other.channel_key + return false unless @usage == other.usage + return false unless @processing_time == other.processing_time + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/meta.rbi b/lib/moderation_api/models/operations/meta.rbi new file mode 100644 index 00000000..3433831a --- /dev/null +++ b/lib/moderation_api/models/operations/meta.rbi @@ -0,0 +1,38 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::Meta + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::Meta + def status + end + + def status=(str_) + end + + def timestamp + end + + def timestamp=(str_) + end + + def channel_key + end + + def channel_key=(str_) + end + + def usage + end + + def usage=(str_) + end + + def processing_time + end + + def processing_time=(str_) + end +end diff --git a/lib/moderation_api/models/operations/meta_status.rb b/lib/moderation_api/models/operations/meta_status.rb new file mode 100644 index 00000000..10856c48 --- /dev/null +++ b/lib/moderation_api/models/operations/meta_status.rb @@ -0,0 +1,21 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class MetaStatus + include ::Crystalline::Enum + enums do + SUCCESS = new("success") + PARTIAL_SUCCESS = new("partial_success") + end + + open! + end + end + end +end diff --git a/lib/moderation_api/models/operations/meta_status.rbi b/lib/moderation_api/models/operations/meta_status.rbi new file mode 100644 index 00000000..d8c7360e --- /dev/null +++ b/lib/moderation_api/models/operations/meta_status.rbi @@ -0,0 +1,9 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::MetaStatus + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::MetaStatus +end diff --git a/lib/moderation_api/models/operations/metadatafilter.rb b/lib/moderation_api/models/operations/metadatafilter.rb new file mode 100644 index 00000000..e444ed23 --- /dev/null +++ b/lib/moderation_api/models/operations/metadatafilter.rb @@ -0,0 +1,38 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class MetadataFilter + extend T::Sig + include Crystalline::MetadataFields + + field :key, ::String, {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("key"), required: true}} + + field( + :value, + ::String, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("value"), required: true}} + ) + + sig { params(key: ::String, value: ::String).void } + def initialize(key:, value:) + @key = key + @value = value + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @key == other.key + return false unless @value == other.value + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/metadatafilter.rbi b/lib/moderation_api/models/operations/metadatafilter.rbi new file mode 100644 index 00000000..d9a9cd6f --- /dev/null +++ b/lib/moderation_api/models/operations/metadatafilter.rbi @@ -0,0 +1,20 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::MetadataFilter + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::MetadataFilter + def key + end + + def key=(str_) + end + + def value + end + + def value=(str_) + end +end diff --git a/lib/moderation_api/models/operations/metatype.rb b/lib/moderation_api/models/operations/metatype.rb new file mode 100644 index 00000000..19057774 --- /dev/null +++ b/lib/moderation_api/models/operations/metatype.rb @@ -0,0 +1,25 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + # MetaType - The meta type of content being moderated + class MetaType < T::Enum + enums do + PROFILE = new("profile") + MESSAGE = new("message") + POST = new("post") + COMMENT = new("comment") + EVENT = new("event") + PRODUCT = new("product") + REVIEW = new("review") + VOICE = new("voice") + OTHER = new("other") + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/metatype.rbi b/lib/moderation_api/models/operations/metatype.rbi new file mode 100644 index 00000000..7b6fedd4 --- /dev/null +++ b/lib/moderation_api/models/operations/metatype.rbi @@ -0,0 +1,9 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::MetaType + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::MetaType +end diff --git a/lib/moderation_api/models/operations/method.rb b/lib/moderation_api/models/operations/method.rb new file mode 100644 index 00000000..ae90ac67 --- /dev/null +++ b/lib/moderation_api/models/operations/method.rb @@ -0,0 +1,21 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class Method + include ::Crystalline::Enum + enums do + REGISTERED_DOMAIN_TOKEN = new("registered_domain_token") + SUBDOMAIN_TOKEN = new("subdomain_token") + end + + open! + end + end + end +end diff --git a/lib/moderation_api/models/operations/method.rbi b/lib/moderation_api/models/operations/method.rbi new file mode 100644 index 00000000..dedfeec7 --- /dev/null +++ b/lib/moderation_api/models/operations/method.rbi @@ -0,0 +1,9 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::Method + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::Method +end diff --git a/lib/moderation_api/models/operations/modified.rb b/lib/moderation_api/models/operations/modified.rb new file mode 100644 index 00000000..3054ae76 --- /dev/null +++ b/lib/moderation_api/models/operations/modified.rb @@ -0,0 +1,25 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class Modified + extend T::Sig + include Crystalline::MetadataFields + + def initialize + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/modified.rbi b/lib/moderation_api/models/operations/modified.rbi new file mode 100644 index 00000000..198da1d0 --- /dev/null +++ b/lib/moderation_api/models/operations/modified.rbi @@ -0,0 +1,9 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::Modified + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::Modified +end diff --git a/lib/moderation_api/models/operations/object.rb b/lib/moderation_api/models/operations/object.rb new file mode 100644 index 00000000..e776f322 --- /dev/null +++ b/lib/moderation_api/models/operations/object.rb @@ -0,0 +1,69 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + # Object + class Object + extend T::Sig + include Crystalline::MetadataFields + + # Values in the object. Can be mixed content types. + field( + :data, + Crystalline::Hash.new( + Symbol, + Crystalline::Union.new( + Models::Operations::DataText, + Models::Operations::DataImage, + Models::Operations::DataVideo, + Models::Operations::DataAudio + ) + ), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("data"), required: true}} + ) + + field( + :type, + ::String, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("type"), required: true}} + ) + + sig { + params( + data: T::Hash[ + Symbol, + T.any( + Models::Operations::DataText, + Models::Operations::DataImage, + Models::Operations::DataVideo, + Models::Operations::DataAudio + ) + ], + type: ::String + ) + .void + } + def initialize(data:, type: "object") + @data = data + unless type == "object" + raise ArgumentError, "Invalid value for type" + end + + @type = "object" + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @data == other.data + return false unless @type == other.type + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/object.rbi b/lib/moderation_api/models/operations/object.rbi new file mode 100644 index 00000000..90354764 --- /dev/null +++ b/lib/moderation_api/models/operations/object.rbi @@ -0,0 +1,20 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::Object + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::Object + def data + end + + def data=(str_) + end + + def type + end + + def type=(str_) + end +end diff --git a/lib/moderation_api/models/operations/personal_information.rb b/lib/moderation_api/models/operations/personal_information.rb new file mode 100644 index 00000000..8d670e62 --- /dev/null +++ b/lib/moderation_api/models/operations/personal_information.rb @@ -0,0 +1,50 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class PersonalInformation + extend T::Sig + include Crystalline::MetadataFields + + field( + :flag, + Crystalline::Boolean.new, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("flag"), required: true}} + ) + + field( + :threshold, + Crystalline::Nilable.new(::Float), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("threshold")}} + ) + + field :id, ::String, {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("id"), required: true}} + + sig { params(flag: T::Boolean, threshold: T.nilable(::Float), id: ::String).void } + def initialize(flag:, threshold: nil, id: "personal_information") + @flag = flag + @threshold = threshold + unless id == "personal_information" + raise ArgumentError, "Invalid value for id" + end + + @id = "personal_information" + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @flag == other.flag + return false unless @threshold == other.threshold + return false unless @id == other.id + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/personal_information.rbi b/lib/moderation_api/models/operations/personal_information.rbi new file mode 100644 index 00000000..73f11761 --- /dev/null +++ b/lib/moderation_api/models/operations/personal_information.rbi @@ -0,0 +1,26 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::PersonalInformation + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::PersonalInformation + def flag + end + + def flag=(str_) + end + + def threshold + end + + def threshold=(str_) + end + + def id + end + + def id=(str_) + end +end diff --git a/lib/moderation_api/models/operations/personal_story_insight.rb b/lib/moderation_api/models/operations/personal_story_insight.rb new file mode 100644 index 00000000..b77187d1 --- /dev/null +++ b/lib/moderation_api/models/operations/personal_story_insight.rb @@ -0,0 +1,62 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + # Personal story insight. Includes a personal experience or story as a source of support for the statements made in the comment. + class PersonalStoryInsight + extend T::Sig + include Crystalline::MetadataFields + + field( + :probability, + ::Float, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("probability"), required: true}} + ) + + field :id, ::String, {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("id"), required: true}} + + field( + :type, + ::String, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("type"), required: true}} + ) + # Whether the content shows personal story. + field( + :value, + Crystalline::Nilable.new(Crystalline::Boolean.new), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("value"), required: true}} + ) + + sig { params(probability: ::Float, id: ::String, type: ::String, value: T.nilable(T::Boolean)).void } + def initialize(probability:, id: "personal_story", type: "insight", value: nil) + @probability = probability + unless id == "personal_story" + raise ArgumentError, "Invalid value for id" + end + + @id = "personal_story" + unless type == "insight" + raise ArgumentError, "Invalid value for type" + end + + @type = "insight" + @value = value + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @probability == other.probability + return false unless @id == other.id + return false unless @type == other.type + return false unless @value == other.value + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/personal_story_insight.rbi b/lib/moderation_api/models/operations/personal_story_insight.rbi new file mode 100644 index 00000000..855fb47b --- /dev/null +++ b/lib/moderation_api/models/operations/personal_story_insight.rbi @@ -0,0 +1,32 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::PersonalStoryInsight + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::PersonalStoryInsight + def probability + end + + def probability=(str_) + end + + def id + end + + def id=(str_) + end + + def type + end + + def type=(str_) + end + + def value + end + + def value=(str_) + end +end diff --git a/lib/moderation_api/models/operations/pii_masking.rb b/lib/moderation_api/models/operations/pii_masking.rb new file mode 100644 index 00000000..a4ef3b68 --- /dev/null +++ b/lib/moderation_api/models/operations/pii_masking.rb @@ -0,0 +1,42 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class PIIMasking + extend T::Sig + include Crystalline::MetadataFields + + field( + :entities, + Crystalline::Hash.new(Symbol, Models::Operations::Entities1), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("entities"), required: true}} + ) + + field :id, ::String, {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("id"), required: true}} + + sig { params(entities: T::Hash[Symbol, Models::Operations::Entities1], id: ::String).void } + def initialize(entities:, id: "pii") + @entities = entities + unless id == "pii" + raise ArgumentError, "Invalid value for id" + end + + @id = "pii" + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @entities == other.entities + return false unless @id == other.id + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/pii_masking.rbi b/lib/moderation_api/models/operations/pii_masking.rbi new file mode 100644 index 00000000..6b24201a --- /dev/null +++ b/lib/moderation_api/models/operations/pii_masking.rbi @@ -0,0 +1,20 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::PIIMasking + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::PIIMasking + def entities + end + + def entities=(str_) + end + + def id + end + + def id=(str_) + end +end diff --git a/lib/moderation_api/models/operations/policy_request.rb b/lib/moderation_api/models/operations/policy_request.rb new file mode 100644 index 00000000..f243bef9 --- /dev/null +++ b/lib/moderation_api/models/operations/policy_request.rb @@ -0,0 +1,25 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class PolicyRequest + extend T::Sig + include Crystalline::MetadataFields + + def initialize + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/policy_request.rbi b/lib/moderation_api/models/operations/policy_request.rbi new file mode 100644 index 00000000..750a4d59 --- /dev/null +++ b/lib/moderation_api/models/operations/policy_request.rbi @@ -0,0 +1,9 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::PolicyRequest + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::PolicyRequest +end diff --git a/lib/moderation_api/models/operations/policy_response.rb b/lib/moderation_api/models/operations/policy_response.rb new file mode 100644 index 00000000..0d7b6002 --- /dev/null +++ b/lib/moderation_api/models/operations/policy_response.rb @@ -0,0 +1,25 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + # Policy output schema. + class PolicyResponse + extend T::Sig + include Crystalline::MetadataFields + + def initialize + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/policy_response.rbi b/lib/moderation_api/models/operations/policy_response.rbi new file mode 100644 index 00000000..b1bf37c6 --- /dev/null +++ b/lib/moderation_api/models/operations/policy_response.rbi @@ -0,0 +1,9 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::PolicyResponse + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::PolicyResponse +end diff --git a/lib/moderation_api/models/operations/political.rb b/lib/moderation_api/models/operations/political.rb new file mode 100644 index 00000000..7e58239a --- /dev/null +++ b/lib/moderation_api/models/operations/political.rb @@ -0,0 +1,50 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class Political + extend T::Sig + include Crystalline::MetadataFields + + field( + :flag, + Crystalline::Boolean.new, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("flag"), required: true}} + ) + + field( + :threshold, + Crystalline::Nilable.new(::Float), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("threshold")}} + ) + + field :id, ::String, {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("id"), required: true}} + + sig { params(flag: T::Boolean, threshold: T.nilable(::Float), id: ::String).void } + def initialize(flag:, threshold: nil, id: "political") + @flag = flag + @threshold = threshold + unless id == "political" + raise ArgumentError, "Invalid value for id" + end + + @id = "political" + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @flag == other.flag + return false unless @threshold == other.threshold + return false unless @id == other.id + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/political.rbi b/lib/moderation_api/models/operations/political.rbi new file mode 100644 index 00000000..78eac97b --- /dev/null +++ b/lib/moderation_api/models/operations/political.rbi @@ -0,0 +1,26 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::Political + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::Political + def flag + end + + def flag=(str_) + end + + def threshold + end + + def threshold=(str_) + end + + def id + end + + def id=(str_) + end +end diff --git a/lib/moderation_api/models/operations/profanity.rb b/lib/moderation_api/models/operations/profanity.rb new file mode 100644 index 00000000..b4a2ae93 --- /dev/null +++ b/lib/moderation_api/models/operations/profanity.rb @@ -0,0 +1,50 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class Profanity + extend T::Sig + include Crystalline::MetadataFields + + field( + :flag, + Crystalline::Boolean.new, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("flag"), required: true}} + ) + + field( + :threshold, + Crystalline::Nilable.new(::Float), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("threshold")}} + ) + + field :id, ::String, {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("id"), required: true}} + + sig { params(flag: T::Boolean, threshold: T.nilable(::Float), id: ::String).void } + def initialize(flag:, threshold: nil, id: "profanity") + @flag = flag + @threshold = threshold + unless id == "profanity" + raise ArgumentError, "Invalid value for id" + end + + @id = "profanity" + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @flag == other.flag + return false unless @threshold == other.threshold + return false unless @id == other.id + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/profanity.rbi b/lib/moderation_api/models/operations/profanity.rbi new file mode 100644 index 00000000..32aa95ce --- /dev/null +++ b/lib/moderation_api/models/operations/profanity.rbi @@ -0,0 +1,26 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::Profanity + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::Profanity + def flag + end + + def flag=(str_) + end + + def threshold + end + + def threshold=(str_) + end + + def id + end + + def id=(str_) + end +end diff --git a/lib/moderation_api/models/operations/promotion.rb b/lib/moderation_api/models/operations/promotion.rb new file mode 100644 index 00000000..312adb95 --- /dev/null +++ b/lib/moderation_api/models/operations/promotion.rb @@ -0,0 +1,50 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class Promotion + extend T::Sig + include Crystalline::MetadataFields + + field( + :flag, + Crystalline::Boolean.new, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("flag"), required: true}} + ) + + field( + :threshold, + Crystalline::Nilable.new(::Float), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("threshold")}} + ) + + field :id, ::String, {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("id"), required: true}} + + sig { params(flag: T::Boolean, threshold: T.nilable(::Float), id: ::String).void } + def initialize(flag:, threshold: nil, id: "promotion") + @flag = flag + @threshold = threshold + unless id == "promotion" + raise ArgumentError, "Invalid value for id" + end + + @id = "promotion" + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @flag == other.flag + return false unless @threshold == other.threshold + return false unless @id == other.id + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/promotion.rbi b/lib/moderation_api/models/operations/promotion.rbi new file mode 100644 index 00000000..46b14990 --- /dev/null +++ b/lib/moderation_api/models/operations/promotion.rbi @@ -0,0 +1,26 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::Promotion + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::Promotion + def flag + end + + def flag=(str_) + end + + def threshold + end + + def threshold=(str_) + end + + def id + end + + def id=(str_) + end +end diff --git a/lib/moderation_api/models/operations/queue.rb b/lib/moderation_api/models/operations/queue.rb new file mode 100644 index 00000000..3bf317aa --- /dev/null +++ b/lib/moderation_api/models/operations/queue.rb @@ -0,0 +1,97 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class Queue + extend T::Sig + include Crystalline::MetadataFields + + field :id, ::String, {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("id"), required: true}} + + field( + :name, + ::String, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("name"), required: true}} + ) + + field( + :description, + ::String, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("description"), required: true}} + ) + + field( + :filter, + Models::Operations::Filter, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("filter"), required: true}} + ) + + field( + :unresolved_items_count, + ::Float, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("unresolvedItemsCount"), required: true}} + ) + + field( + :resolved_items_count, + ::Float, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("resolvedItemsCount"), required: true}} + ) + + field( + :total_items_count, + ::Float, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("totalItemsCount"), required: true}} + ) + + sig { + params( + id: ::String, + name: ::String, + description: ::String, + filter: Models::Operations::Filter, + unresolved_items_count: ::Float, + resolved_items_count: ::Float, + total_items_count: ::Float + ) + .void + } + def initialize( + id:, + name:, + description:, + filter:, + unresolved_items_count:, + resolved_items_count:, + total_items_count: + ) + @id = id + @name = name + @description = description + @filter = filter + @unresolved_items_count = unresolved_items_count + @resolved_items_count = resolved_items_count + @total_items_count = total_items_count + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @id == other.id + return false unless @name == other.name + return false unless @description == other.description + return false unless @filter == other.filter + return false unless @unresolved_items_count == other.unresolved_items_count + return false unless @resolved_items_count == other.resolved_items_count + return false unless @total_items_count == other.total_items_count + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/queue.rbi b/lib/moderation_api/models/operations/queue.rbi new file mode 100644 index 00000000..d0937db1 --- /dev/null +++ b/lib/moderation_api/models/operations/queue.rbi @@ -0,0 +1,50 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::Queue + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::Queue + def id + end + + def id=(str_) + end + + def name + end + + def name=(str_) + end + + def description + end + + def description=(str_) + end + + def filter + end + + def filter=(str_) + end + + def unresolved_items_count + end + + def unresolved_items_count=(str_) + end + + def resolved_items_count + end + + def resolved_items_count=(str_) + end + + def total_items_count + end + + def total_items_count=(str_) + end +end diff --git a/lib/moderation_api/models/operations/reason_code.rb b/lib/moderation_api/models/operations/reason_code.rb new file mode 100644 index 00000000..aebf9851 --- /dev/null +++ b/lib/moderation_api/models/operations/reason_code.rb @@ -0,0 +1,25 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class ReasonCode + extend T::Sig + include Crystalline::MetadataFields + + def initialize + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/reason_code.rbi b/lib/moderation_api/models/operations/reason_code.rbi new file mode 100644 index 00000000..2700d073 --- /dev/null +++ b/lib/moderation_api/models/operations/reason_code.rbi @@ -0,0 +1,9 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::ReasonCode + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::ReasonCode +end diff --git a/lib/moderation_api/models/operations/reason_code_enum.rb b/lib/moderation_api/models/operations/reason_code_enum.rb new file mode 100644 index 00000000..2a18bf3b --- /dev/null +++ b/lib/moderation_api/models/operations/reason_code_enum.rb @@ -0,0 +1,30 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class ReasonCodeEnum + include ::Crystalline::Enum + enums do + SEVERITY_REJECT = new("severity_reject") + SEVERITY_REVIEW = new("severity_review") + AUTHOR_BLOCK = new("author_block") + DRY_RUN = new("dry_run") + TRUSTED_ALLOW = new("trusted_allow") + UNTRUSTED_SEVERITY = new("untrusted_severity") + RULE_MATCH = new("rule_match") + RULE_DEFAULT = new("rule_default") + RULE_FALLBACK = new("rule_fallback") + CLIENT_OVERRIDE = new("client_override") + CASEBOOK_MATCH = new("casebook_match") + end + + open! + end + end + end +end diff --git a/lib/moderation_api/models/operations/reason_code_enum.rbi b/lib/moderation_api/models/operations/reason_code_enum.rbi new file mode 100644 index 00000000..9748e750 --- /dev/null +++ b/lib/moderation_api/models/operations/reason_code_enum.rbi @@ -0,0 +1,9 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::ReasonCodeEnum + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::ReasonCodeEnum +end diff --git a/lib/moderation_api/models/operations/recommendation.rb b/lib/moderation_api/models/operations/recommendation.rb new file mode 100644 index 00000000..4472d088 --- /dev/null +++ b/lib/moderation_api/models/operations/recommendation.rb @@ -0,0 +1,67 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + # The recommendation for the content based on the evaluation. + class Recommendation + extend T::Sig + include Crystalline::MetadataFields + + # The action to take based on the recommendation + field( + :action, + Models::Operations::SubmitContentRecommendationAction, + { + 'format_json': { + 'letter_case': ::ModerationApi::Utils.field_name("action"), + required: true, + 'decoder': ::ModerationApi::Utils.open_enum_from_string( + Models::Operations::SubmitContentRecommendationAction, + false + ) + } + } + ) + # Reason codes for the recommendation. Standard codes plus a `rule:` code identifying the rule that produced the action. Can be used to display a reason to the user. + field( + :reason_codes, + Crystalline::Array.new(Crystalline::Union.new(Models::Operations::ReasonCodeEnum, ::String)), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("reason_codes"), required: true}} + ) + # Rules that matched during evaluation, if rules engine is active. + field( + :matched_rules, + Crystalline::Nilable.new(Crystalline::Array.new(Models::Operations::MatchedRule)), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("matched_rules")}} + ) + + sig { + params( + action: Models::Operations::SubmitContentRecommendationAction, + reason_codes: T::Array[T.any(Models::Operations::ReasonCodeEnum, ::String)], + matched_rules: T.nilable(T::Array[Models::Operations::MatchedRule]) + ) + .void + } + def initialize(action:, reason_codes:, matched_rules: nil) + @action = action + @reason_codes = reason_codes + @matched_rules = matched_rules + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @action == other.action + return false unless @reason_codes == other.reason_codes + return false unless @matched_rules == other.matched_rules + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/recommendation.rbi b/lib/moderation_api/models/operations/recommendation.rbi new file mode 100644 index 00000000..a66a96f1 --- /dev/null +++ b/lib/moderation_api/models/operations/recommendation.rbi @@ -0,0 +1,26 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::Recommendation + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::Recommendation + def action + end + + def action=(str_) + end + + def reason_codes + end + + def reason_codes=(str_) + end + + def matched_rules + end + + def matched_rules=(str_) + end +end diff --git a/lib/moderation_api/models/operations/religion.rb b/lib/moderation_api/models/operations/religion.rb new file mode 100644 index 00000000..bd6abf61 --- /dev/null +++ b/lib/moderation_api/models/operations/religion.rb @@ -0,0 +1,50 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class Religion + extend T::Sig + include Crystalline::MetadataFields + + field( + :flag, + Crystalline::Boolean.new, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("flag"), required: true}} + ) + + field( + :threshold, + Crystalline::Nilable.new(::Float), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("threshold")}} + ) + + field :id, ::String, {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("id"), required: true}} + + sig { params(flag: T::Boolean, threshold: T.nilable(::Float), id: ::String).void } + def initialize(flag:, threshold: nil, id: "religion") + @flag = flag + @threshold = threshold + unless id == "religion" + raise ArgumentError, "Invalid value for id" + end + + @id = "religion" + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @flag == other.flag + return false unless @threshold == other.threshold + return false unless @id == other.id + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/religion.rbi b/lib/moderation_api/models/operations/religion.rbi new file mode 100644 index 00000000..558ba952 --- /dev/null +++ b/lib/moderation_api/models/operations/religion.rbi @@ -0,0 +1,26 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::Religion + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::Religion + def flag + end + + def flag=(str_) + end + + def threshold + end + + def threshold=(str_) + end + + def id + end + + def id=(str_) + end +end diff --git a/lib/moderation_api/models/operations/removewordlistwords_request.rb b/lib/moderation_api/models/operations/removewordlistwords_request.rb new file mode 100644 index 00000000..0a283dc7 --- /dev/null +++ b/lib/moderation_api/models/operations/removewordlistwords_request.rb @@ -0,0 +1,39 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class RemoveWordlistWordsRequest + extend T::Sig + include Crystalline::MetadataFields + + # ID of the wordlist to remove words from + field :id, ::String, {'path_param': {'field_name': "id", 'style': "simple", 'explode': false}} + # Array of words to remove from the wordlist + field( + :words, + Crystalline::Array.new(::String), + {'query_param': {'field_name': "words", 'style': "form", 'explode': true}} + ) + + sig { params(id: ::String, words: T::Array[::String]).void } + def initialize(id:, words:) + @id = id + @words = words + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @id == other.id + return false unless @words == other.words + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/removewordlistwords_request.rbi b/lib/moderation_api/models/operations/removewordlistwords_request.rbi new file mode 100644 index 00000000..522dc8b1 --- /dev/null +++ b/lib/moderation_api/models/operations/removewordlistwords_request.rbi @@ -0,0 +1,20 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::RemoveWordlistWordsRequest + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::RemoveWordlistWordsRequest + def id + end + + def id=(str_) + end + + def words + end + + def words=(str_) + end +end diff --git a/lib/moderation_api/models/operations/removewordlistwords_response.rb b/lib/moderation_api/models/operations/removewordlistwords_response.rb new file mode 100644 index 00000000..7196e636 --- /dev/null +++ b/lib/moderation_api/models/operations/removewordlistwords_response.rb @@ -0,0 +1,51 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class RemoveWordlistWordsResponse + extend T::Sig + include Crystalline::MetadataFields + + # HTTP response content type for this operation + field :content_type, ::String + # HTTP response status code for this operation + field :status_code, ::Integer + # Raw HTTP response; suitable for custom response parsing + field :raw_response, ::Faraday::Response + # Words successfully removed from wordlist + field :object, Crystalline::Nilable.new(Models::Operations::RemoveWordlistWordsResponseBody) + + sig { + params( + content_type: ::String, + status_code: ::Integer, + raw_response: ::Faraday::Response, + object: T.nilable(Models::Operations::RemoveWordlistWordsResponseBody) + ) + .void + } + def initialize(content_type:, status_code:, raw_response:, object: nil) + @content_type = content_type + @status_code = status_code + @raw_response = raw_response + @object = object + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @content_type == other.content_type + return false unless @status_code == other.status_code + return false unless @raw_response == other.raw_response + return false unless @object == other.object + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/removewordlistwords_response.rbi b/lib/moderation_api/models/operations/removewordlistwords_response.rbi new file mode 100644 index 00000000..36030719 --- /dev/null +++ b/lib/moderation_api/models/operations/removewordlistwords_response.rbi @@ -0,0 +1,32 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::RemoveWordlistWordsResponse + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::RemoveWordlistWordsResponse + def content_type + end + + def content_type=(str_) + end + + def status_code + end + + def status_code=(str_) + end + + def raw_response + end + + def raw_response=(str_) + end + + def object + end + + def object=(str_) + end +end diff --git a/lib/moderation_api/models/operations/removewordlistwords_responsebody.rb b/lib/moderation_api/models/operations/removewordlistwords_responsebody.rb new file mode 100644 index 00000000..a2607ffb --- /dev/null +++ b/lib/moderation_api/models/operations/removewordlistwords_responsebody.rb @@ -0,0 +1,51 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + # Words successfully removed from wordlist + class RemoveWordlistWordsResponseBody + extend T::Sig + include Crystalline::MetadataFields + + # Number of words removed + field( + :removed_count, + ::Float, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("removedCount"), required: true}} + ) + # Total number of words in wordlist + field( + :total_count, + ::Float, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("totalCount"), required: true}} + ) + # List of words removed + field( + :removed_words, + Crystalline::Array.new(::String), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("removedWords"), required: true}} + ) + + sig { params(removed_count: ::Float, total_count: ::Float, removed_words: T::Array[::String]).void } + def initialize(removed_count:, total_count:, removed_words:) + @removed_count = removed_count + @total_count = total_count + @removed_words = removed_words + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @removed_count == other.removed_count + return false unless @total_count == other.total_count + return false unless @removed_words == other.removed_words + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/removewordlistwords_responsebody.rbi b/lib/moderation_api/models/operations/removewordlistwords_responsebody.rbi new file mode 100644 index 00000000..d8297efa --- /dev/null +++ b/lib/moderation_api/models/operations/removewordlistwords_responsebody.rbi @@ -0,0 +1,26 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::RemoveWordlistWordsResponseBody + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::RemoveWordlistWordsResponseBody + def removed_count + end + + def removed_count=(str_) + end + + def total_count + end + + def total_count=(str_) + end + + def removed_words + end + + def removed_words=(str_) + end +end diff --git a/lib/moderation_api/models/operations/resolvequeueitem_request.rb b/lib/moderation_api/models/operations/resolvequeueitem_request.rb new file mode 100644 index 00000000..8400a580 --- /dev/null +++ b/lib/moderation_api/models/operations/resolvequeueitem_request.rb @@ -0,0 +1,39 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class ResolveQueueItemRequest + extend T::Sig + include Crystalline::MetadataFields + + # The queue ID + field :id, ::String, {'path_param': {'field_name': "id", 'style': "simple", 'explode': false}} + # The item ID to resolve + field :item_id, ::String, {'path_param': {'field_name': "itemId", 'style': "simple", 'explode': false}} + + field :body, Models::Operations::ResolveQueueItemRequestBody, {'request': {'media_type': "application/json"}} + + sig { params(id: ::String, item_id: ::String, body: Models::Operations::ResolveQueueItemRequestBody).void } + def initialize(id:, item_id:, body:) + @id = id + @item_id = item_id + @body = body + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @id == other.id + return false unless @item_id == other.item_id + return false unless @body == other.body + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/resolvequeueitem_request.rbi b/lib/moderation_api/models/operations/resolvequeueitem_request.rbi new file mode 100644 index 00000000..97dbaf97 --- /dev/null +++ b/lib/moderation_api/models/operations/resolvequeueitem_request.rbi @@ -0,0 +1,26 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::ResolveQueueItemRequest + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::ResolveQueueItemRequest + def id + end + + def id=(str_) + end + + def item_id + end + + def item_id=(str_) + end + + def body + end + + def body=(str_) + end +end diff --git a/lib/moderation_api/models/operations/resolvequeueitem_requestbody.rb b/lib/moderation_api/models/operations/resolvequeueitem_requestbody.rb new file mode 100644 index 00000000..85722d6b --- /dev/null +++ b/lib/moderation_api/models/operations/resolvequeueitem_requestbody.rb @@ -0,0 +1,35 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class ResolveQueueItemRequestBody + extend T::Sig + include Crystalline::MetadataFields + + # Optional comment + field( + :comment, + Crystalline::Nilable.new(::String), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("comment")}} + ) + + sig { params(comment: T.nilable(::String)).void } + def initialize(comment: nil) + @comment = comment + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @comment == other.comment + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/resolvequeueitem_requestbody.rbi b/lib/moderation_api/models/operations/resolvequeueitem_requestbody.rbi new file mode 100644 index 00000000..49a8a9d4 --- /dev/null +++ b/lib/moderation_api/models/operations/resolvequeueitem_requestbody.rbi @@ -0,0 +1,14 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::ResolveQueueItemRequestBody + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::ResolveQueueItemRequestBody + def comment + end + + def comment=(str_) + end +end diff --git a/lib/moderation_api/models/operations/resolvequeueitem_response.rb b/lib/moderation_api/models/operations/resolvequeueitem_response.rb new file mode 100644 index 00000000..58f394ef --- /dev/null +++ b/lib/moderation_api/models/operations/resolvequeueitem_response.rb @@ -0,0 +1,51 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class ResolveQueueItemResponse + extend T::Sig + include Crystalline::MetadataFields + + # HTTP response content type for this operation + field :content_type, ::String + # HTTP response status code for this operation + field :status_code, ::Integer + # Raw HTTP response; suitable for custom response parsing + field :raw_response, ::Faraday::Response + # Successful response + field :object, Crystalline::Nilable.new(Models::Operations::ResolveQueueItemResponseBody) + + sig { + params( + content_type: ::String, + status_code: ::Integer, + raw_response: ::Faraday::Response, + object: T.nilable(Models::Operations::ResolveQueueItemResponseBody) + ) + .void + } + def initialize(content_type:, status_code:, raw_response:, object: nil) + @content_type = content_type + @status_code = status_code + @raw_response = raw_response + @object = object + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @content_type == other.content_type + return false unless @status_code == other.status_code + return false unless @raw_response == other.raw_response + return false unless @object == other.object + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/resolvequeueitem_response.rbi b/lib/moderation_api/models/operations/resolvequeueitem_response.rbi new file mode 100644 index 00000000..c68dff4c --- /dev/null +++ b/lib/moderation_api/models/operations/resolvequeueitem_response.rbi @@ -0,0 +1,32 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::ResolveQueueItemResponse + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::ResolveQueueItemResponse + def content_type + end + + def content_type=(str_) + end + + def status_code + end + + def status_code=(str_) + end + + def raw_response + end + + def raw_response=(str_) + end + + def object + end + + def object=(str_) + end +end diff --git a/lib/moderation_api/models/operations/resolvequeueitem_responsebody.rb b/lib/moderation_api/models/operations/resolvequeueitem_responsebody.rb new file mode 100644 index 00000000..d03dcc9f --- /dev/null +++ b/lib/moderation_api/models/operations/resolvequeueitem_responsebody.rb @@ -0,0 +1,50 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + # Successful response + class ResolveQueueItemResponseBody + extend T::Sig + include Crystalline::MetadataFields + + field( + :success, + Crystalline::Boolean.new, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("success"), required: true}} + ) + # Timestamp when the item was resolved + field( + :resolved_at, + ::String, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("resolvedAt"), required: true}} + ) + # Optional comment + field( + :comment, + Crystalline::Nilable.new(::String), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("comment")}} + ) + + sig { params(success: T::Boolean, resolved_at: ::String, comment: T.nilable(::String)).void } + def initialize(success:, resolved_at:, comment: nil) + @success = success + @resolved_at = resolved_at + @comment = comment + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @success == other.success + return false unless @resolved_at == other.resolved_at + return false unless @comment == other.comment + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/resolvequeueitem_responsebody.rbi b/lib/moderation_api/models/operations/resolvequeueitem_responsebody.rbi new file mode 100644 index 00000000..0702b97d --- /dev/null +++ b/lib/moderation_api/models/operations/resolvequeueitem_responsebody.rbi @@ -0,0 +1,26 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::ResolveQueueItemResponseBody + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::ResolveQueueItemResponseBody + def success + end + + def success=(str_) + end + + def resolved_at + end + + def resolved_at=(str_) + end + + def comment + end + + def comment=(str_) + end +end diff --git a/lib/moderation_api/models/operations/respect_insight.rb b/lib/moderation_api/models/operations/respect_insight.rb new file mode 100644 index 00000000..4c0f464b --- /dev/null +++ b/lib/moderation_api/models/operations/respect_insight.rb @@ -0,0 +1,62 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + # Respect insight. Shows deference or appreciation to others, or acknowledges the validity of another person. + class RespectInsight + extend T::Sig + include Crystalline::MetadataFields + + field( + :probability, + ::Float, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("probability"), required: true}} + ) + + field :id, ::String, {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("id"), required: true}} + + field( + :type, + ::String, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("type"), required: true}} + ) + # Whether the content shows respect. + field( + :value, + Crystalline::Nilable.new(Crystalline::Boolean.new), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("value"), required: true}} + ) + + sig { params(probability: ::Float, id: ::String, type: ::String, value: T.nilable(T::Boolean)).void } + def initialize(probability:, id: "respect", type: "insight", value: nil) + @probability = probability + unless id == "respect" + raise ArgumentError, "Invalid value for id" + end + + @id = "respect" + unless type == "insight" + raise ArgumentError, "Invalid value for type" + end + + @type = "insight" + @value = value + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @probability == other.probability + return false unless @id == other.id + return false unless @type == other.type + return false unless @value == other.value + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/respect_insight.rbi b/lib/moderation_api/models/operations/respect_insight.rbi new file mode 100644 index 00000000..dd89c342 --- /dev/null +++ b/lib/moderation_api/models/operations/respect_insight.rbi @@ -0,0 +1,32 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::RespectInsight + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::RespectInsight + def probability + end + + def probability=(str_) + end + + def id + end + + def id=(str_) + end + + def type + end + + def type=(str_) + end + + def value + end + + def value=(str_) + end +end diff --git a/lib/moderation_api/models/operations/reviewstats.rb b/lib/moderation_api/models/operations/reviewstats.rb new file mode 100644 index 00000000..400960fd --- /dev/null +++ b/lib/moderation_api/models/operations/reviewstats.rb @@ -0,0 +1,51 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class ReviewStats + extend T::Sig + include Crystalline::MetadataFields + + # Average time in milliseconds to review an item + field( + :average_time_to_review, + ::Float, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("averageTimeToReview"), required: true}} + ) + # Total number of items reviewed + field( + :total_reviewed, + ::Float, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("totalReviewed"), required: true}} + ) + # Total number of items pending review + field( + :total_pending, + ::Float, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("totalPending"), required: true}} + ) + + sig { params(average_time_to_review: ::Float, total_reviewed: ::Float, total_pending: ::Float).void } + def initialize(average_time_to_review:, total_reviewed:, total_pending:) + @average_time_to_review = average_time_to_review + @total_reviewed = total_reviewed + @total_pending = total_pending + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @average_time_to_review == other.average_time_to_review + return false unless @total_reviewed == other.total_reviewed + return false unless @total_pending == other.total_pending + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/reviewstats.rbi b/lib/moderation_api/models/operations/reviewstats.rbi new file mode 100644 index 00000000..58c1e7bd --- /dev/null +++ b/lib/moderation_api/models/operations/reviewstats.rbi @@ -0,0 +1,26 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::ReviewStats + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::ReviewStats + def average_time_to_review + end + + def average_time_to_review=(str_) + end + + def total_reviewed + end + + def total_reviewed=(str_) + end + + def total_pending + end + + def total_pending=(str_) + end +end diff --git a/lib/moderation_api/models/operations/scores.rb b/lib/moderation_api/models/operations/scores.rb new file mode 100644 index 00000000..62442a27 --- /dev/null +++ b/lib/moderation_api/models/operations/scores.rb @@ -0,0 +1,43 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + # Positive and negative scored independently: mixed content scores high on both. Present whenever `value` is set. + class Scores + extend T::Sig + include Crystalline::MetadataFields + + # How positive the content is, 0 to 1. + field( + :positive, + ::Float, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("positive"), required: true}} + ) + # How negative the content is, 0 to 1. + field( + :negative, + ::Float, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("negative"), required: true}} + ) + + sig { params(positive: ::Float, negative: ::Float).void } + def initialize(positive:, negative:) + @positive = positive + @negative = negative + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @positive == other.positive + return false unless @negative == other.negative + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/scores.rbi b/lib/moderation_api/models/operations/scores.rbi new file mode 100644 index 00000000..eb429381 --- /dev/null +++ b/lib/moderation_api/models/operations/scores.rbi @@ -0,0 +1,20 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::Scores + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::Scores + def positive + end + + def positive=(str_) + end + + def negative + end + + def negative=(str_) + end +end diff --git a/lib/moderation_api/models/operations/self_harm.rb b/lib/moderation_api/models/operations/self_harm.rb new file mode 100644 index 00000000..1315f0e3 --- /dev/null +++ b/lib/moderation_api/models/operations/self_harm.rb @@ -0,0 +1,50 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class SelfHarm + extend T::Sig + include Crystalline::MetadataFields + + field( + :flag, + Crystalline::Boolean.new, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("flag"), required: true}} + ) + + field( + :threshold, + Crystalline::Nilable.new(::Float), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("threshold")}} + ) + + field :id, ::String, {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("id"), required: true}} + + sig { params(flag: T::Boolean, threshold: T.nilable(::Float), id: ::String).void } + def initialize(flag:, threshold: nil, id: "self_harm") + @flag = flag + @threshold = threshold + unless id == "self_harm" + raise ArgumentError, "Invalid value for id" + end + + @id = "self_harm" + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @flag == other.flag + return false unless @threshold == other.threshold + return false unless @id == other.id + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/self_harm.rbi b/lib/moderation_api/models/operations/self_harm.rbi new file mode 100644 index 00000000..0b4d06d9 --- /dev/null +++ b/lib/moderation_api/models/operations/self_harm.rbi @@ -0,0 +1,26 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::SelfHarm + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::SelfHarm + def flag + end + + def flag=(str_) + end + + def threshold + end + + def threshold=(str_) + end + + def id + end + + def id=(str_) + end +end diff --git a/lib/moderation_api/models/operations/self_promotion.rb b/lib/moderation_api/models/operations/self_promotion.rb new file mode 100644 index 00000000..f1bd7ea3 --- /dev/null +++ b/lib/moderation_api/models/operations/self_promotion.rb @@ -0,0 +1,50 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class SelfPromotion + extend T::Sig + include Crystalline::MetadataFields + + field( + :flag, + Crystalline::Boolean.new, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("flag"), required: true}} + ) + + field( + :threshold, + Crystalline::Nilable.new(::Float), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("threshold")}} + ) + + field :id, ::String, {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("id"), required: true}} + + sig { params(flag: T::Boolean, threshold: T.nilable(::Float), id: ::String).void } + def initialize(flag:, threshold: nil, id: "self_promotion") + @flag = flag + @threshold = threshold + unless id == "self_promotion" + raise ArgumentError, "Invalid value for id" + end + + @id = "self_promotion" + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @flag == other.flag + return false unless @threshold == other.threshold + return false unless @id == other.id + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/self_promotion.rbi b/lib/moderation_api/models/operations/self_promotion.rbi new file mode 100644 index 00000000..ebbb7429 --- /dev/null +++ b/lib/moderation_api/models/operations/self_promotion.rbi @@ -0,0 +1,26 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::SelfPromotion + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::SelfPromotion + def flag + end + + def flag=(str_) + end + + def threshold + end + + def threshold=(str_) + end + + def id + end + + def id=(str_) + end +end diff --git a/lib/moderation_api/models/operations/sentiment_insight.rb b/lib/moderation_api/models/operations/sentiment_insight.rb new file mode 100644 index 00000000..87b077bd --- /dev/null +++ b/lib/moderation_api/models/operations/sentiment_insight.rb @@ -0,0 +1,85 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + # Sentiment insight + class SentimentInsight + extend T::Sig + include Crystalline::MetadataFields + + field( + :probability, + ::Float, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("probability"), required: true}} + ) + + field :id, ::String, {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("id"), required: true}} + + field( + :type, + ::String, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("type"), required: true}} + ) + + field( + :value, + Crystalline::Nilable.new(Models::Operations::Value), + { + 'format_json': { + 'letter_case': ::ModerationApi::Utils.field_name("value"), + required: true, + 'decoder': ::ModerationApi::Utils.open_enum_from_string(Models::Operations::Value, false) + } + } + ) + # Positive and negative scored independently: mixed content scores high on both. Present whenever `value` is set. + field( + :scores, + Crystalline::Nilable.new(Models::Operations::Scores), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("scores")}} + ) + + sig { + params( + probability: ::Float, + id: ::String, + type: ::String, + value: T.nilable(Models::Operations::Value), + scores: T.nilable(Models::Operations::Scores) + ) + .void + } + def initialize(probability:, id: "sentiment", type: "insight", value: nil, scores: nil) + @probability = probability + unless id == "sentiment" + raise ArgumentError, "Invalid value for id" + end + + @id = "sentiment" + unless type == "insight" + raise ArgumentError, "Invalid value for type" + end + + @type = "insight" + @value = value + @scores = scores + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @probability == other.probability + return false unless @id == other.id + return false unless @type == other.type + return false unless @value == other.value + return false unless @scores == other.scores + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/sentiment_insight.rbi b/lib/moderation_api/models/operations/sentiment_insight.rbi new file mode 100644 index 00000000..b03a65da --- /dev/null +++ b/lib/moderation_api/models/operations/sentiment_insight.rbi @@ -0,0 +1,38 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::SentimentInsight + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::SentimentInsight + def probability + end + + def probability=(str_) + end + + def id + end + + def id=(str_) + end + + def type + end + + def type=(str_) + end + + def value + end + + def value=(str_) + end + + def scores + end + + def scores=(str_) + end +end diff --git a/lib/moderation_api/models/operations/sexual.rb b/lib/moderation_api/models/operations/sexual.rb new file mode 100644 index 00000000..48313b73 --- /dev/null +++ b/lib/moderation_api/models/operations/sexual.rb @@ -0,0 +1,50 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class Sexual + extend T::Sig + include Crystalline::MetadataFields + + field( + :flag, + Crystalline::Boolean.new, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("flag"), required: true}} + ) + + field( + :threshold, + Crystalline::Nilable.new(::Float), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("threshold")}} + ) + + field :id, ::String, {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("id"), required: true}} + + sig { params(flag: T::Boolean, threshold: T.nilable(::Float), id: ::String).void } + def initialize(flag:, threshold: nil, id: "sexual") + @flag = flag + @threshold = threshold + unless id == "sexual" + raise ArgumentError, "Invalid value for id" + end + + @id = "sexual" + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @flag == other.flag + return false unless @threshold == other.threshold + return false unless @id == other.id + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/sexual.rbi b/lib/moderation_api/models/operations/sexual.rbi new file mode 100644 index 00000000..82b3c456 --- /dev/null +++ b/lib/moderation_api/models/operations/sexual.rbi @@ -0,0 +1,26 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::Sexual + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::Sexual + def flag + end + + def flag=(str_) + end + + def threshold + end + + def threshold=(str_) + end + + def id + end + + def id=(str_) + end +end diff --git a/lib/moderation_api/models/operations/sexual_minors.rb b/lib/moderation_api/models/operations/sexual_minors.rb new file mode 100644 index 00000000..eecfcba9 --- /dev/null +++ b/lib/moderation_api/models/operations/sexual_minors.rb @@ -0,0 +1,50 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class SexualMinors + extend T::Sig + include Crystalline::MetadataFields + + field( + :flag, + Crystalline::Boolean.new, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("flag"), required: true}} + ) + + field( + :threshold, + Crystalline::Nilable.new(::Float), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("threshold")}} + ) + + field :id, ::String, {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("id"), required: true}} + + sig { params(flag: T::Boolean, threshold: T.nilable(::Float), id: ::String).void } + def initialize(flag:, threshold: nil, id: "sexual_minors") + @flag = flag + @threshold = threshold + unless id == "sexual_minors" + raise ArgumentError, "Invalid value for id" + end + + @id = "sexual_minors" + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @flag == other.flag + return false unless @threshold == other.threshold + return false unless @id == other.id + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/sexual_minors.rbi b/lib/moderation_api/models/operations/sexual_minors.rbi new file mode 100644 index 00000000..773d053d --- /dev/null +++ b/lib/moderation_api/models/operations/sexual_minors.rbi @@ -0,0 +1,26 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::SexualMinors + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::SexualMinors + def flag + end + + def flag=(str_) + end + + def threshold + end + + def threshold=(str_) + end + + def id + end + + def id=(str_) + end +end diff --git a/lib/moderation_api/models/operations/sexual_solicitation.rb b/lib/moderation_api/models/operations/sexual_solicitation.rb new file mode 100644 index 00000000..0c9e7adb --- /dev/null +++ b/lib/moderation_api/models/operations/sexual_solicitation.rb @@ -0,0 +1,50 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class SexualSolicitation + extend T::Sig + include Crystalline::MetadataFields + + field( + :flag, + Crystalline::Boolean.new, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("flag"), required: true}} + ) + + field( + :threshold, + Crystalline::Nilable.new(::Float), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("threshold")}} + ) + + field :id, ::String, {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("id"), required: true}} + + sig { params(flag: T::Boolean, threshold: T.nilable(::Float), id: ::String).void } + def initialize(flag:, threshold: nil, id: "sexual_solicitation") + @flag = flag + @threshold = threshold + unless id == "sexual_solicitation" + raise ArgumentError, "Invalid value for id" + end + + @id = "sexual_solicitation" + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @flag == other.flag + return false unless @threshold == other.threshold + return false unless @id == other.id + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/sexual_solicitation.rbi b/lib/moderation_api/models/operations/sexual_solicitation.rbi new file mode 100644 index 00000000..d036efad --- /dev/null +++ b/lib/moderation_api/models/operations/sexual_solicitation.rbi @@ -0,0 +1,26 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::SexualSolicitation + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::SexualSolicitation + def flag + end + + def flag=(str_) + end + + def threshold + end + + def threshold=(str_) + end + + def id + end + + def id=(str_) + end +end diff --git a/lib/moderation_api/models/operations/signals_request.rb b/lib/moderation_api/models/operations/signals_request.rb new file mode 100644 index 00000000..09bb8f49 --- /dev/null +++ b/lib/moderation_api/models/operations/signals_request.rb @@ -0,0 +1,34 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class SignalsRequest + extend T::Sig + include Crystalline::MetadataFields + + field( + :flag, + Crystalline::Nilable.new(Crystalline::Boolean.new), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("flag")}} + ) + + sig { params(flag: T.nilable(T::Boolean)).void } + def initialize(flag: nil) + @flag = flag + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @flag == other.flag + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/signals_request.rbi b/lib/moderation_api/models/operations/signals_request.rbi new file mode 100644 index 00000000..2efea5c0 --- /dev/null +++ b/lib/moderation_api/models/operations/signals_request.rbi @@ -0,0 +1,14 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::SignalsRequest + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::SignalsRequest + def flag + end + + def flag=(str_) + end +end diff --git a/lib/moderation_api/models/operations/signals_response.rb b/lib/moderation_api/models/operations/signals_response.rb new file mode 100644 index 00000000..3e2e79f2 --- /dev/null +++ b/lib/moderation_api/models/operations/signals_response.rb @@ -0,0 +1,126 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + # Observable properties of a URL (URL Risk only). Absent for allow/block list matches. + class SignalsResponse + extend T::Sig + include Crystalline::MetadataFields + + field( + :has_suspicious_characters, + Crystalline::Boolean.new, + { + 'format_json': { + 'letter_case': ::ModerationApi::Utils.field_name("has_suspicious_characters"), + required: true + } + } + ) + + field( + :is_link_shortener, + Crystalline::Boolean.new, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("is_link_shortener"), required: true}} + ) + + field( + :is_reported, + Crystalline::Boolean.new, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("is_reported"), required: true}} + ) + + field( + :brand_impersonation, + Crystalline::Nilable.new(Models::Operations::BrandImpersonation), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("brand_impersonation"), required: true}} + ) + + field( + :domain_age_days, + Crystalline::Nilable.new(::Integer), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("domain_age_days"), required: true}} + ) + + field( + :has_email_setup, + Crystalline::Nilable.new(Crystalline::Boolean.new), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("has_email_setup"), required: true}} + ) + + field( + :redirect_count, + Crystalline::Nilable.new(::Integer), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("redirect_count"), required: true}} + ) + + field( + :final_url, + Crystalline::Nilable.new(::String), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("final_url"), required: true}} + ) + + field( + :bot_protection, + Crystalline::Nilable.new(Crystalline::Boolean.new), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("bot_protection"), required: true}} + ) + + sig { + params( + has_suspicious_characters: T::Boolean, + is_link_shortener: T::Boolean, + is_reported: T::Boolean, + brand_impersonation: T.nilable(Models::Operations::BrandImpersonation), + domain_age_days: T.nilable(::Integer), + has_email_setup: T.nilable(T::Boolean), + redirect_count: T.nilable(::Integer), + final_url: T.nilable(::String), + bot_protection: T.nilable(T::Boolean) + ) + .void + } + def initialize( + has_suspicious_characters:, + is_link_shortener:, + is_reported:, + brand_impersonation: nil, + domain_age_days: nil, + has_email_setup: nil, + redirect_count: nil, + final_url: nil, + bot_protection: nil + ) + @has_suspicious_characters = has_suspicious_characters + @is_link_shortener = is_link_shortener + @is_reported = is_reported + @brand_impersonation = brand_impersonation + @domain_age_days = domain_age_days + @has_email_setup = has_email_setup + @redirect_count = redirect_count + @final_url = final_url + @bot_protection = bot_protection + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @has_suspicious_characters == other.has_suspicious_characters + return false unless @is_link_shortener == other.is_link_shortener + return false unless @is_reported == other.is_reported + return false unless @brand_impersonation == other.brand_impersonation + return false unless @domain_age_days == other.domain_age_days + return false unless @has_email_setup == other.has_email_setup + return false unless @redirect_count == other.redirect_count + return false unless @final_url == other.final_url + return false unless @bot_protection == other.bot_protection + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/signals_response.rbi b/lib/moderation_api/models/operations/signals_response.rbi new file mode 100644 index 00000000..0f13fb5a --- /dev/null +++ b/lib/moderation_api/models/operations/signals_response.rbi @@ -0,0 +1,62 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::SignalsResponse + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::SignalsResponse + def has_suspicious_characters + end + + def has_suspicious_characters=(str_) + end + + def is_link_shortener + end + + def is_link_shortener=(str_) + end + + def is_reported + end + + def is_reported=(str_) + end + + def brand_impersonation + end + + def brand_impersonation=(str_) + end + + def domain_age_days + end + + def domain_age_days=(str_) + end + + def has_email_setup + end + + def has_email_setup=(str_) + end + + def redirect_count + end + + def redirect_count=(str_) + end + + def final_url + end + + def final_url=(str_) + end + + def bot_protection + end + + def bot_protection=(str_) + end +end diff --git a/lib/moderation_api/models/operations/sortby.rb b/lib/moderation_api/models/operations/sortby.rb new file mode 100644 index 00000000..477263de --- /dev/null +++ b/lib/moderation_api/models/operations/sortby.rb @@ -0,0 +1,24 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + # SortBy + class SortBy < T::Enum + enums do + TRUST_LEVEL = new("trustLevel") + VIOLATION_COUNT = new("violationCount") + REPORT_COUNT = new("reportCount") + MEMBER_SINCE = new("memberSince") + LAST_ACTIVE = new("lastActive") + CONTENT_COUNT = new("contentCount") + FLAGGED_CONTENT_RATIO = new("flaggedContentRatio") + AVERAGE_SENTIMENT = new("averageSentiment") + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/sortby.rbi b/lib/moderation_api/models/operations/sortby.rbi new file mode 100644 index 00000000..70b0b56d --- /dev/null +++ b/lib/moderation_api/models/operations/sortby.rbi @@ -0,0 +1,9 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::SortBy + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::SortBy +end diff --git a/lib/moderation_api/models/operations/sortfield.rb b/lib/moderation_api/models/operations/sortfield.rb new file mode 100644 index 00000000..9252701f --- /dev/null +++ b/lib/moderation_api/models/operations/sortfield.rb @@ -0,0 +1,19 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + # SortField + class SortField < T::Enum + enums do + CREATED_AT = new("createdAt") + SEVERITY = new("severity") + REVIEWED_AT = new("reviewedAt") + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/sortfield.rbi b/lib/moderation_api/models/operations/sortfield.rbi new file mode 100644 index 00000000..bf7af683 --- /dev/null +++ b/lib/moderation_api/models/operations/sortfield.rbi @@ -0,0 +1,9 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::SortField + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::SortField +end diff --git a/lib/moderation_api/models/operations/spam.rb b/lib/moderation_api/models/operations/spam.rb new file mode 100644 index 00000000..1efbe967 --- /dev/null +++ b/lib/moderation_api/models/operations/spam.rb @@ -0,0 +1,50 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class Spam + extend T::Sig + include Crystalline::MetadataFields + + field( + :flag, + Crystalline::Boolean.new, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("flag"), required: true}} + ) + + field( + :threshold, + Crystalline::Nilable.new(::Float), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("threshold")}} + ) + + field :id, ::String, {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("id"), required: true}} + + sig { params(flag: T::Boolean, threshold: T.nilable(::Float), id: ::String).void } + def initialize(flag:, threshold: nil, id: "spam") + @flag = flag + @threshold = threshold + unless id == "spam" + raise ArgumentError, "Invalid value for id" + end + + @id = "spam" + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @flag == other.flag + return false unless @threshold == other.threshold + return false unless @id == other.id + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/spam.rbi b/lib/moderation_api/models/operations/spam.rbi new file mode 100644 index 00000000..4dd34fa5 --- /dev/null +++ b/lib/moderation_api/models/operations/spam.rbi @@ -0,0 +1,26 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::Spam + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::Spam + def flag + end + + def flag=(str_) + end + + def threshold + end + + def threshold=(str_) + end + + def id + end + + def id=(str_) + end +end diff --git a/lib/moderation_api/models/operations/submitcontent_label.rb b/lib/moderation_api/models/operations/submitcontent_label.rb new file mode 100644 index 00000000..8b4ce380 --- /dev/null +++ b/lib/moderation_api/models/operations/submitcontent_label.rb @@ -0,0 +1,56 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class SubmitContentLabel + extend T::Sig + include Crystalline::MetadataFields + + field :id, ::String, {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("id"), required: true}} + + field( + :probability, + ::Float, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("probability"), required: true}} + ) + + field( + :flagged, + Crystalline::Boolean.new, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("flagged"), required: true}} + ) + + field( + :shadow_flagged, + Crystalline::Nilable.new(Crystalline::Boolean.new), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("shadowFlagged")}} + ) + + sig { + params(id: ::String, probability: ::Float, flagged: T::Boolean, shadow_flagged: T.nilable(T::Boolean)).void + } + def initialize(id:, probability:, flagged:, shadow_flagged: nil) + @id = id + @probability = probability + @flagged = flagged + @shadow_flagged = shadow_flagged + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @id == other.id + return false unless @probability == other.probability + return false unless @flagged == other.flagged + return false unless @shadow_flagged == other.shadow_flagged + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/submitcontent_label.rbi b/lib/moderation_api/models/operations/submitcontent_label.rbi new file mode 100644 index 00000000..8bc202c5 --- /dev/null +++ b/lib/moderation_api/models/operations/submitcontent_label.rbi @@ -0,0 +1,32 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::SubmitContentLabel + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::SubmitContentLabel + def id + end + + def id=(str_) + end + + def probability + end + + def probability=(str_) + end + + def flagged + end + + def flagged=(str_) + end + + def shadow_flagged + end + + def shadow_flagged=(str_) + end +end diff --git a/lib/moderation_api/models/operations/submitcontent_recommendation_action.rb b/lib/moderation_api/models/operations/submitcontent_recommendation_action.rb new file mode 100644 index 00000000..d9a9dd21 --- /dev/null +++ b/lib/moderation_api/models/operations/submitcontent_recommendation_action.rb @@ -0,0 +1,22 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + # SubmitContentRecommendationAction - The action to take based on the recommendation + class SubmitContentRecommendationAction + include ::Crystalline::Enum + enums do + REVIEW = new("review") + ALLOW = new("allow") + REJECT = new("reject") + end + + open! + end + end + end +end diff --git a/lib/moderation_api/models/operations/submitcontent_recommendation_action.rbi b/lib/moderation_api/models/operations/submitcontent_recommendation_action.rbi new file mode 100644 index 00000000..65827225 --- /dev/null +++ b/lib/moderation_api/models/operations/submitcontent_recommendation_action.rbi @@ -0,0 +1,9 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::SubmitContentRecommendationAction + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::SubmitContentRecommendationAction +end diff --git a/lib/moderation_api/models/operations/submitcontent_request.rb b/lib/moderation_api/models/operations/submitcontent_request.rb new file mode 100644 index 00000000..5533666f --- /dev/null +++ b/lib/moderation_api/models/operations/submitcontent_request.rb @@ -0,0 +1,259 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class SubmitContentRequest + extend T::Sig + include Crystalline::MetadataFields + + # The content sent for moderation + field( + :content, + Crystalline::Union.new( + Models::Operations::TextRequest, + Models::Operations::ImageRequest, + Models::Operations::VideoRequest, + Models::Operations::AudioRequest, + Models::Operations::Object + ), + { + 'format_json': {'letter_case': ::ModerationApi::Utils.field_name("content"), required: true}, + 'discriminator': "type", + 'discriminator_mapping': { + "text" => Models::Operations::TextRequest, + "image" => Models::Operations::ImageRequest, + "video" => Models::Operations::VideoRequest, + "audio" => Models::Operations::AudioRequest, + "object" => Models::Operations::Object + } + } + ) + # Unix timestamp (in milliseconds) of when the content was created. Use if content is not submitted in real-time. + field( + :timestamp, + Crystalline::Nilable.new(::Float), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("timestamp")}} + ) + # Provide a channel ID or key. Will use the project's default channel if not provided. + field( + :channel, + Crystalline::Nilable.new(::String), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("channel")}} + ) + # The unique ID of the content in your database. + field( + :content_id, + Crystalline::Nilable.new(::String), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("contentId")}} + ) + # The meta type of content being moderated + field( + :meta_type, + Crystalline::Nilable.new(Models::Operations::MetaType), + { + 'format_json': { + 'letter_case': ::ModerationApi::Utils.field_name("metaType"), + 'decoder': ::ModerationApi::Utils.enum_from_string(Models::Operations::MetaType, true) + } + } + ) + # The author of the content. + field( + :author_id, + Crystalline::Nilable.new(::String), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("authorId")}} + ) + # For example the ID of a chat room or a post + field( + :conversation_id, + Crystalline::Nilable.new(::String), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("conversationId")}} + ) + # Any metadata you want to store with the content + field( + :metadata, + Crystalline::Nilable.new(Crystalline::Hash.new(Symbol, ::Object)), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("metadata")}} + ) + # A recommendation from your own client-side flagging (e.g. a banned-IP list or a third-party tool). Feeds the rules engine and can escalate or override the recommended action. Does not change whether our analysis flagged the content. + field( + :client_action, + Crystalline::Nilable.new(Models::Operations::ClientAction), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("clientAction")}} + ) + # Do not store the content. The content won't enter the review queue + field( + :do_not_store, + Crystalline::Nilable.new(Crystalline::Boolean.new), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("doNotStore")}} + ) + # (Enterprise) override the channel policies for this moderation request only. + field( + :policies, + Crystalline::Nilable.new( + Crystalline::Array.new( + Crystalline::Union.new( + Models::Operations::Toxicity, + Models::Operations::PersonalInformation, + Models::Operations::Hate, + Models::Operations::Illicit, + Models::Operations::IllicitDrugs, + Models::Operations::IllicitAlcohol, + Models::Operations::IllicitFirearms, + Models::Operations::IllicitTobacco, + Models::Operations::IllicitGambling, + Models::Operations::Cannabis, + Models::Operations::Adult, + Models::Operations::Crypto, + Models::Operations::Sexual, + Models::Operations::SexualMinors, + Models::Operations::Profanity, + Models::Operations::Violence, + Models::Operations::SelfHarm, + Models::Operations::Spam, + Models::Operations::LowQualityContent, + Models::Operations::FaceDetection, + Models::Operations::SelfPromotion, + Models::Operations::Political, + Models::Operations::Religion, + Models::Operations::Threat, + Models::Operations::SexualSolicitation, + Models::Operations::ChannelCircumvention, + Models::Operations::IllegalTrade, + Models::Operations::Alcohol, + Models::Operations::Drugs, + Models::Operations::Gambling, + Models::Operations::Tobacco, + Models::Operations::Weapons, + Models::Operations::Promotion, + Models::Operations::Extremism, + Models::Operations::CodeAbuse, + Models::Operations::UnicodeSpoofing, + Models::Operations::PIIMasking, + Models::Operations::URLMasking, + Models::Operations::URLRisk, + Models::Operations::Guideline + ) + ) + ), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("policies")}} + ) + + sig { + params( + content: T.any( + Models::Operations::TextRequest, + Models::Operations::ImageRequest, + Models::Operations::VideoRequest, + Models::Operations::AudioRequest, + Models::Operations::Object + ), + timestamp: T.nilable(::Float), + channel: T.nilable(::String), + content_id: T.nilable(::String), + meta_type: T.nilable(Models::Operations::MetaType), + author_id: T.nilable(::String), + conversation_id: T.nilable(::String), + metadata: T.nilable(T::Hash[Symbol, ::Object]), + client_action: T.nilable(Models::Operations::ClientAction), + do_not_store: T.nilable(T::Boolean), + policies: T.nilable( + T::Array[ + T.any( + Models::Operations::Toxicity, + Models::Operations::PersonalInformation, + Models::Operations::Hate, + Models::Operations::Illicit, + Models::Operations::IllicitDrugs, + Models::Operations::IllicitAlcohol, + Models::Operations::IllicitFirearms, + Models::Operations::IllicitTobacco, + Models::Operations::IllicitGambling, + Models::Operations::Cannabis, + Models::Operations::Adult, + Models::Operations::Crypto, + Models::Operations::Sexual, + Models::Operations::SexualMinors, + Models::Operations::Profanity, + Models::Operations::Violence, + Models::Operations::SelfHarm, + Models::Operations::Spam, + Models::Operations::LowQualityContent, + Models::Operations::FaceDetection, + Models::Operations::SelfPromotion, + Models::Operations::Political, + Models::Operations::Religion, + Models::Operations::Threat, + Models::Operations::SexualSolicitation, + Models::Operations::ChannelCircumvention, + Models::Operations::IllegalTrade, + Models::Operations::Alcohol, + Models::Operations::Drugs, + Models::Operations::Gambling, + Models::Operations::Tobacco, + Models::Operations::Weapons, + Models::Operations::Promotion, + Models::Operations::Extremism, + Models::Operations::CodeAbuse, + Models::Operations::UnicodeSpoofing, + Models::Operations::PIIMasking, + Models::Operations::URLMasking, + Models::Operations::URLRisk, + Models::Operations::Guideline + ) + ] + ) + ) + .void + } + def initialize( + content:, + timestamp: nil, + channel: nil, + content_id: nil, + meta_type: nil, + author_id: nil, + conversation_id: nil, + metadata: nil, + client_action: nil, + do_not_store: nil, + policies: nil + ) + @content = content + @timestamp = timestamp + @channel = channel + @content_id = content_id + @meta_type = meta_type + @author_id = author_id + @conversation_id = conversation_id + @metadata = metadata + @client_action = client_action + @do_not_store = do_not_store + @policies = policies + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @content == other.content + return false unless @timestamp == other.timestamp + return false unless @channel == other.channel + return false unless @content_id == other.content_id + return false unless @meta_type == other.meta_type + return false unless @author_id == other.author_id + return false unless @conversation_id == other.conversation_id + return false unless @metadata == other.metadata + return false unless @client_action == other.client_action + return false unless @do_not_store == other.do_not_store + return false unless @policies == other.policies + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/submitcontent_request.rbi b/lib/moderation_api/models/operations/submitcontent_request.rbi new file mode 100644 index 00000000..2427a7d3 --- /dev/null +++ b/lib/moderation_api/models/operations/submitcontent_request.rbi @@ -0,0 +1,74 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::SubmitContentRequest + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::SubmitContentRequest + def content + end + + def content=(str_) + end + + def timestamp + end + + def timestamp=(str_) + end + + def channel + end + + def channel=(str_) + end + + def content_id + end + + def content_id=(str_) + end + + def meta_type + end + + def meta_type=(str_) + end + + def author_id + end + + def author_id=(str_) + end + + def conversation_id + end + + def conversation_id=(str_) + end + + def metadata + end + + def metadata=(str_) + end + + def client_action + end + + def client_action=(str_) + end + + def do_not_store + end + + def do_not_store=(str_) + end + + def policies + end + + def policies=(str_) + end +end diff --git a/lib/moderation_api/models/operations/submitcontent_response.rb b/lib/moderation_api/models/operations/submitcontent_response.rb new file mode 100644 index 00000000..abe5af88 --- /dev/null +++ b/lib/moderation_api/models/operations/submitcontent_response.rb @@ -0,0 +1,51 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class SubmitContentResponse + extend T::Sig + include Crystalline::MetadataFields + + # HTTP response content type for this operation + field :content_type, ::String + # HTTP response status code for this operation + field :status_code, ::Integer + # Raw HTTP response; suitable for custom response parsing + field :raw_response, ::Faraday::Response + # Successful response + field :object, Crystalline::Nilable.new(Models::Operations::SubmitContentResponseBody) + + sig { + params( + content_type: ::String, + status_code: ::Integer, + raw_response: ::Faraday::Response, + object: T.nilable(Models::Operations::SubmitContentResponseBody) + ) + .void + } + def initialize(content_type:, status_code:, raw_response:, object: nil) + @content_type = content_type + @status_code = status_code + @raw_response = raw_response + @object = object + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @content_type == other.content_type + return false unless @status_code == other.status_code + return false unless @raw_response == other.raw_response + return false unless @object == other.object + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/submitcontent_response.rbi b/lib/moderation_api/models/operations/submitcontent_response.rbi new file mode 100644 index 00000000..af118ecc --- /dev/null +++ b/lib/moderation_api/models/operations/submitcontent_response.rbi @@ -0,0 +1,32 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::SubmitContentResponse + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::SubmitContentResponse + def content_type + end + + def content_type=(str_) + end + + def status_code + end + + def status_code=(str_) + end + + def raw_response + end + + def raw_response=(str_) + end + + def object + end + + def object=(str_) + end +end diff --git a/lib/moderation_api/models/operations/submitcontent_responsebody.rb b/lib/moderation_api/models/operations/submitcontent_responsebody.rb new file mode 100644 index 00000000..d0ea1ac6 --- /dev/null +++ b/lib/moderation_api/models/operations/submitcontent_responsebody.rb @@ -0,0 +1,151 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + # Successful response + class SubmitContentResponseBody + extend T::Sig + include Crystalline::MetadataFields + + # Potentially modified content. + field( + :content, + Models::Operations::ContentResponse, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("content"), required: true}} + ) + # The evaluation of the content after running the channel policies. + field( + :evaluation, + Models::Operations::Evaluation, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("evaluation"), required: true}} + ) + # The recommendation for the content based on the evaluation. + field( + :recommendation, + Models::Operations::Recommendation, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("recommendation"), required: true}} + ) + # Results of all policies in the channel. Sorted by highest probability. + field( + :policies, + Crystalline::Array.new( + Crystalline::DiscriminatedUnion.new( + "type", + { + "classifier" => Models::Operations::ClassifierOutput, + "entity_matcher" => Models::Operations::EntityMatcherOutput + } + ) + ), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("policies"), required: true}} + ) + # Results of all insights enabled in the channel. + field( + :insights, + Crystalline::Array.new( + Crystalline::DiscriminatedUnion.new( + "id", + { + "sentiment" => Models::Operations::SentimentInsight, + "language" => Models::Operations::LanguageInsight, + "curiosity" => Models::Operations::CuriosityInsight, + "respect" => Models::Operations::RespectInsight, + "personal_story" => Models::Operations::PersonalStoryInsight, + "compassion" => Models::Operations::CompassionInsight + } + ) + ), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("insights"), required: true}} + ) + # Metadata about the moderation request + field( + :meta, + Models::Operations::Meta, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("meta"), required: true}} + ) + # The author of the content if your account has authors enabled. Requires you to send authorId when submitting content. + field( + :author, + Crystalline::Nilable.new(Models::Operations::Author), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("author"), required: true}} + ) + # What your casebook — the record of your past moderation decisions — found for this content, or null when it had nothing close enough to say, when the matching cases disagreed, or when casebook lookups are not switched on for this channel. Reports what the casebook found; whether it decided the outcome is shown in `recommendation`, where a higher-priority rule may have settled the item first. + field( + :casebook, + Crystalline::Nilable.new(Models::Operations::Casebook), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("casebook"), required: true}} + ) + # Policies that had errors + field( + :errors, + Crystalline::Nilable.new(Crystalline::Array.new(Models::Operations::Error)), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("errors")}} + ) + + sig { + params( + content: Models::Operations::ContentResponse, + evaluation: Models::Operations::Evaluation, + recommendation: Models::Operations::Recommendation, + policies: T::Array[T.any(Models::Operations::ClassifierOutput, Models::Operations::EntityMatcherOutput)], + insights: T::Array[ + T.any( + Models::Operations::SentimentInsight, + Models::Operations::LanguageInsight, + Models::Operations::CuriosityInsight, + Models::Operations::RespectInsight, + Models::Operations::PersonalStoryInsight, + Models::Operations::CompassionInsight + ) + ], + meta: Models::Operations::Meta, + author: T.nilable(Models::Operations::Author), + casebook: T.nilable(Models::Operations::Casebook), + errors: T.nilable(T::Array[Models::Operations::Error]) + ) + .void + } + def initialize( + content:, + evaluation:, + recommendation:, + policies:, + insights:, + meta:, + author: nil, + casebook: nil, + errors: nil + ) + @content = content + @evaluation = evaluation + @recommendation = recommendation + @policies = policies + @insights = insights + @meta = meta + @author = author + @casebook = casebook + @errors = errors + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @content == other.content + return false unless @evaluation == other.evaluation + return false unless @recommendation == other.recommendation + return false unless @policies == other.policies + return false unless @insights == other.insights + return false unless @meta == other.meta + return false unless @author == other.author + return false unless @casebook == other.casebook + return false unless @errors == other.errors + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/submitcontent_responsebody.rbi b/lib/moderation_api/models/operations/submitcontent_responsebody.rbi new file mode 100644 index 00000000..1f67db70 --- /dev/null +++ b/lib/moderation_api/models/operations/submitcontent_responsebody.rbi @@ -0,0 +1,62 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::SubmitContentResponseBody + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::SubmitContentResponseBody + def content + end + + def content=(str_) + end + + def evaluation + end + + def evaluation=(str_) + end + + def recommendation + end + + def recommendation=(str_) + end + + def policies + end + + def policies=(str_) + end + + def insights + end + + def insights=(str_) + end + + def meta + end + + def meta=(str_) + end + + def author + end + + def author=(str_) + end + + def casebook + end + + def casebook=(str_) + end + + def errors + end + + def errors=(str_) + end +end diff --git a/lib/moderation_api/models/operations/text_request.rb b/lib/moderation_api/models/operations/text_request.rb new file mode 100644 index 00000000..bab89959 --- /dev/null +++ b/lib/moderation_api/models/operations/text_request.rb @@ -0,0 +1,47 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + # Text + class TextRequest + extend T::Sig + include Crystalline::MetadataFields + + # The content text + field( + :text, + ::String, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("text"), required: true}} + ) + + field( + :type, + ::String, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("type"), required: true}} + ) + + sig { params(text: ::String, type: ::String).void } + def initialize(text:, type: "text") + @text = text + unless type == "text" + raise ArgumentError, "Invalid value for type" + end + + @type = "text" + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @text == other.text + return false unless @type == other.type + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/text_request.rbi b/lib/moderation_api/models/operations/text_request.rbi new file mode 100644 index 00000000..c187accf --- /dev/null +++ b/lib/moderation_api/models/operations/text_request.rbi @@ -0,0 +1,20 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::TextRequest + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::TextRequest + def text + end + + def text=(str_) + end + + def type + end + + def type=(str_) + end +end diff --git a/lib/moderation_api/models/operations/text_response.rb b/lib/moderation_api/models/operations/text_response.rb new file mode 100644 index 00000000..e4a922ed --- /dev/null +++ b/lib/moderation_api/models/operations/text_response.rb @@ -0,0 +1,47 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + # Text + class TextResponse + extend T::Sig + include Crystalline::MetadataFields + + # The content text + field( + :text, + ::String, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("text"), required: true}} + ) + + field( + :type, + ::String, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("type"), required: true}} + ) + + sig { params(text: ::String, type: ::String).void } + def initialize(text:, type: "text") + @text = text + unless type == "text" + raise ArgumentError, "Invalid value for type" + end + + @type = "text" + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @text == other.text + return false unless @type == other.type + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/text_response.rbi b/lib/moderation_api/models/operations/text_response.rbi new file mode 100644 index 00000000..a12d075f --- /dev/null +++ b/lib/moderation_api/models/operations/text_response.rbi @@ -0,0 +1,20 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::TextResponse + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::TextResponse + def text + end + + def text=(str_) + end + + def type + end + + def type=(str_) + end +end diff --git a/lib/moderation_api/models/operations/threat.rb b/lib/moderation_api/models/operations/threat.rb new file mode 100644 index 00000000..e8078a7b --- /dev/null +++ b/lib/moderation_api/models/operations/threat.rb @@ -0,0 +1,50 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class Threat + extend T::Sig + include Crystalline::MetadataFields + + field( + :flag, + Crystalline::Boolean.new, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("flag"), required: true}} + ) + + field( + :threshold, + Crystalline::Nilable.new(::Float), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("threshold")}} + ) + + field :id, ::String, {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("id"), required: true}} + + sig { params(flag: T::Boolean, threshold: T.nilable(::Float), id: ::String).void } + def initialize(flag:, threshold: nil, id: "threat") + @flag = flag + @threshold = threshold + unless id == "threat" + raise ArgumentError, "Invalid value for id" + end + + @id = "threat" + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @flag == other.flag + return false unless @threshold == other.threshold + return false unless @id == other.id + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/threat.rbi b/lib/moderation_api/models/operations/threat.rbi new file mode 100644 index 00000000..1a8e8e26 --- /dev/null +++ b/lib/moderation_api/models/operations/threat.rbi @@ -0,0 +1,26 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::Threat + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::Threat + def flag + end + + def flag=(str_) + end + + def threshold + end + + def threshold=(str_) + end + + def id + end + + def id=(str_) + end +end diff --git a/lib/moderation_api/models/operations/tobacco.rb b/lib/moderation_api/models/operations/tobacco.rb new file mode 100644 index 00000000..07ba394b --- /dev/null +++ b/lib/moderation_api/models/operations/tobacco.rb @@ -0,0 +1,50 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class Tobacco + extend T::Sig + include Crystalline::MetadataFields + + field( + :flag, + Crystalline::Boolean.new, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("flag"), required: true}} + ) + + field( + :threshold, + Crystalline::Nilable.new(::Float), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("threshold")}} + ) + + field :id, ::String, {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("id"), required: true}} + + sig { params(flag: T::Boolean, threshold: T.nilable(::Float), id: ::String).void } + def initialize(flag:, threshold: nil, id: "tobacco") + @flag = flag + @threshold = threshold + unless id == "tobacco" + raise ArgumentError, "Invalid value for id" + end + + @id = "tobacco" + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @flag == other.flag + return false unless @threshold == other.threshold + return false unless @id == other.id + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/tobacco.rbi b/lib/moderation_api/models/operations/tobacco.rbi new file mode 100644 index 00000000..a2edb47b --- /dev/null +++ b/lib/moderation_api/models/operations/tobacco.rbi @@ -0,0 +1,26 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::Tobacco + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::Tobacco + def flag + end + + def flag=(str_) + end + + def threshold + end + + def threshold=(str_) + end + + def id + end + + def id=(str_) + end +end diff --git a/lib/moderation_api/models/operations/topaction.rb b/lib/moderation_api/models/operations/topaction.rb new file mode 100644 index 00000000..ac76265c --- /dev/null +++ b/lib/moderation_api/models/operations/topaction.rb @@ -0,0 +1,51 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class TopAction + extend T::Sig + include Crystalline::MetadataFields + + # Most used action by this reviewer + field( + :action_id, + ::String, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("actionId"), required: true}} + ) + # Name of the most used action + field( + :action_name, + ::String, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("actionName"), required: true}} + ) + # Number of times this action was used + field( + :count, + ::Float, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("count"), required: true}} + ) + + sig { params(action_id: ::String, action_name: ::String, count: ::Float).void } + def initialize(action_id:, action_name:, count:) + @action_id = action_id + @action_name = action_name + @count = count + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @action_id == other.action_id + return false unless @action_name == other.action_name + return false unless @count == other.count + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/topaction.rbi b/lib/moderation_api/models/operations/topaction.rbi new file mode 100644 index 00000000..0e0caf55 --- /dev/null +++ b/lib/moderation_api/models/operations/topaction.rbi @@ -0,0 +1,26 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::TopAction + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::TopAction + def action_id + end + + def action_id=(str_) + end + + def action_name + end + + def action_name=(str_) + end + + def count + end + + def count=(str_) + end +end diff --git a/lib/moderation_api/models/operations/topic.rb b/lib/moderation_api/models/operations/topic.rb new file mode 100644 index 00000000..aadeadd0 --- /dev/null +++ b/lib/moderation_api/models/operations/topic.rb @@ -0,0 +1,38 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class Topic + extend T::Sig + include Crystalline::MetadataFields + + field :id, ::String, {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("id"), required: true}} + + field( + :label, + ::String, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("label"), required: true}} + ) + + sig { params(id: ::String, label: ::String).void } + def initialize(id:, label:) + @id = id + @label = label + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @id == other.id + return false unless @label == other.label + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/topic.rbi b/lib/moderation_api/models/operations/topic.rbi new file mode 100644 index 00000000..aebe9009 --- /dev/null +++ b/lib/moderation_api/models/operations/topic.rbi @@ -0,0 +1,20 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::Topic + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::Topic + def id + end + + def id=(str_) + end + + def label + end + + def label=(str_) + end +end diff --git a/lib/moderation_api/models/operations/topreviewer.rb b/lib/moderation_api/models/operations/topreviewer.rb new file mode 100644 index 00000000..9f677dc5 --- /dev/null +++ b/lib/moderation_api/models/operations/topreviewer.rb @@ -0,0 +1,85 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class TopReviewer + extend T::Sig + include Crystalline::MetadataFields + + # ID of the reviewer + field( + :user_id, + ::String, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("userId"), required: true}} + ) + # Name of the reviewer + field( + :name, + ::String, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("name"), required: true}} + ) + # Number of items reviewed + field( + :review_count, + ::Float, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("reviewCount"), required: true}} + ) + # Average review time in milliseconds + field( + :average_time_per_review, + ::Float, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("averageTimePerReview"), required: true}} + ) + # Most common actions taken by this reviewer + field( + :top_actions, + Crystalline::Array.new(Models::Operations::TopAction), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("topActions"), required: true}} + ) + # Optional accuracy score based on review quality metrics + field( + :accuracy_score, + Crystalline::Nilable.new(::Float), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("accuracyScore")}} + ) + + sig { + params( + user_id: ::String, + name: ::String, + review_count: ::Float, + average_time_per_review: ::Float, + top_actions: T::Array[Models::Operations::TopAction], + accuracy_score: T.nilable(::Float) + ) + .void + } + def initialize(user_id:, name:, review_count:, average_time_per_review:, top_actions:, accuracy_score: nil) + @user_id = user_id + @name = name + @review_count = review_count + @average_time_per_review = average_time_per_review + @top_actions = top_actions + @accuracy_score = accuracy_score + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @user_id == other.user_id + return false unless @name == other.name + return false unless @review_count == other.review_count + return false unless @average_time_per_review == other.average_time_per_review + return false unless @top_actions == other.top_actions + return false unless @accuracy_score == other.accuracy_score + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/topreviewer.rbi b/lib/moderation_api/models/operations/topreviewer.rbi new file mode 100644 index 00000000..cd980980 --- /dev/null +++ b/lib/moderation_api/models/operations/topreviewer.rbi @@ -0,0 +1,44 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::TopReviewer + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::TopReviewer + def user_id + end + + def user_id=(str_) + end + + def name + end + + def name=(str_) + end + + def review_count + end + + def review_count=(str_) + end + + def average_time_per_review + end + + def average_time_per_review=(str_) + end + + def top_actions + end + + def top_actions=(str_) + end + + def accuracy_score + end + + def accuracy_score=(str_) + end +end diff --git a/lib/moderation_api/models/operations/toxicity.rb b/lib/moderation_api/models/operations/toxicity.rb new file mode 100644 index 00000000..ca57ad84 --- /dev/null +++ b/lib/moderation_api/models/operations/toxicity.rb @@ -0,0 +1,50 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class Toxicity + extend T::Sig + include Crystalline::MetadataFields + + field( + :flag, + Crystalline::Boolean.new, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("flag"), required: true}} + ) + + field( + :threshold, + Crystalline::Nilable.new(::Float), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("threshold")}} + ) + + field :id, ::String, {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("id"), required: true}} + + sig { params(flag: T::Boolean, threshold: T.nilable(::Float), id: ::String).void } + def initialize(flag:, threshold: nil, id: "toxicity") + @flag = flag + @threshold = threshold + unless id == "toxicity" + raise ArgumentError, "Invalid value for id" + end + + @id = "toxicity" + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @flag == other.flag + return false unless @threshold == other.threshold + return false unless @id == other.id + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/toxicity.rbi b/lib/moderation_api/models/operations/toxicity.rbi new file mode 100644 index 00000000..812ce302 --- /dev/null +++ b/lib/moderation_api/models/operations/toxicity.rbi @@ -0,0 +1,26 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::Toxicity + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::Toxicity + def flag + end + + def flag=(str_) + end + + def threshold + end + + def threshold=(str_) + end + + def id + end + + def id=(str_) + end +end diff --git a/lib/moderation_api/models/operations/transcriptionquality.rb b/lib/moderation_api/models/operations/transcriptionquality.rb new file mode 100644 index 00000000..c121df00 --- /dev/null +++ b/lib/moderation_api/models/operations/transcriptionquality.rb @@ -0,0 +1,19 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + # TranscriptionQuality - Trade-off between transcription speed and accuracy. + class TranscriptionQuality < T::Enum + enums do + SPEED = new("SPEED") + BALANCED = new("BALANCED") + ACCURACY = new("ACCURACY") + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/transcriptionquality.rbi b/lib/moderation_api/models/operations/transcriptionquality.rbi new file mode 100644 index 00000000..b7709783 --- /dev/null +++ b/lib/moderation_api/models/operations/transcriptionquality.rbi @@ -0,0 +1,9 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::TranscriptionQuality + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::TranscriptionQuality +end diff --git a/lib/moderation_api/models/operations/trends.rb b/lib/moderation_api/models/operations/trends.rb new file mode 100644 index 00000000..46ed10d2 --- /dev/null +++ b/lib/moderation_api/models/operations/trends.rb @@ -0,0 +1,48 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class Trends + extend T::Sig + include Crystalline::MetadataFields + + field( + :daily_review_counts, + Crystalline::Array.new(Models::Operations::DailyReviewCount), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("dailyReviewCounts"), required: true}} + ) + + field( + :flagged_content_trends, + Crystalline::Array.new(Models::Operations::FlaggedContentTrend), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("flaggedContentTrends"), required: true}} + ) + + sig { + params( + daily_review_counts: T::Array[Models::Operations::DailyReviewCount], + flagged_content_trends: T::Array[Models::Operations::FlaggedContentTrend] + ) + .void + } + def initialize(daily_review_counts:, flagged_content_trends:) + @daily_review_counts = daily_review_counts + @flagged_content_trends = flagged_content_trends + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @daily_review_counts == other.daily_review_counts + return false unless @flagged_content_trends == other.flagged_content_trends + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/trends.rbi b/lib/moderation_api/models/operations/trends.rbi new file mode 100644 index 00000000..dc464661 --- /dev/null +++ b/lib/moderation_api/models/operations/trends.rbi @@ -0,0 +1,20 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::Trends + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::Trends + def daily_review_counts + end + + def daily_review_counts=(str_) + end + + def flagged_content_trends + end + + def flagged_content_trends=(str_) + end +end diff --git a/lib/moderation_api/models/operations/trust_level.rb b/lib/moderation_api/models/operations/trust_level.rb new file mode 100644 index 00000000..04e157a3 --- /dev/null +++ b/lib/moderation_api/models/operations/trust_level.rb @@ -0,0 +1,43 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class TrustLevel + extend T::Sig + include Crystalline::MetadataFields + + # Author trust level (-1, 0, 1, 2, 3, or 4) + field( + :level, + ::Float, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("level"), required: true}} + ) + # True if the trust level was set manually by a moderator + field( + :manual, + Crystalline::Boolean.new, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("manual"), required: true}} + ) + + sig { params(level: ::Float, manual: T::Boolean).void } + def initialize(level:, manual:) + @level = level + @manual = manual + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @level == other.level + return false unless @manual == other.manual + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/trust_level.rbi b/lib/moderation_api/models/operations/trust_level.rbi new file mode 100644 index 00000000..691a1724 --- /dev/null +++ b/lib/moderation_api/models/operations/trust_level.rbi @@ -0,0 +1,20 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::TrustLevel + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::TrustLevel + def level + end + + def level=(str_) + end + + def manual + end + + def manual=(str_) + end +end diff --git a/lib/moderation_api/models/operations/unicode_spoofing.rb b/lib/moderation_api/models/operations/unicode_spoofing.rb new file mode 100644 index 00000000..aafe3351 --- /dev/null +++ b/lib/moderation_api/models/operations/unicode_spoofing.rb @@ -0,0 +1,66 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class UnicodeSpoofing + extend T::Sig + include Crystalline::MetadataFields + + field( + :flag, + Crystalline::Boolean.new, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("flag"), required: true}} + ) + + field( + :threshold, + Crystalline::Nilable.new(::Float), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("threshold")}} + ) + + field :id, ::String, {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("id"), required: true}} + # Per-signal flag toggles. Omitted spoofing signals are enabled; encoding_damage defaults to off because decode damage (U+FFFD) marks a broken pipeline, not an attack. A disabled signal is still detected and reported as a label, but does not by itself flag the policy. + field( + :signals, + Crystalline::Nilable.new(Crystalline::Hash.new(Symbol, Models::Operations::SignalsRequest)), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("signals")}} + ) + + sig { + params( + flag: T::Boolean, + threshold: T.nilable(::Float), + id: ::String, + signals: T.nilable(T::Hash[Symbol, Models::Operations::SignalsRequest]) + ) + .void + } + def initialize(flag:, threshold: nil, id: "unicode_spoofing", signals: nil) + @flag = flag + @threshold = threshold + unless id == "unicode_spoofing" + raise ArgumentError, "Invalid value for id" + end + + @id = "unicode_spoofing" + @signals = signals + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @flag == other.flag + return false unless @threshold == other.threshold + return false unless @id == other.id + return false unless @signals == other.signals + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/unicode_spoofing.rbi b/lib/moderation_api/models/operations/unicode_spoofing.rbi new file mode 100644 index 00000000..6e558b49 --- /dev/null +++ b/lib/moderation_api/models/operations/unicode_spoofing.rbi @@ -0,0 +1,32 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::UnicodeSpoofing + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::UnicodeSpoofing + def flag + end + + def flag=(str_) + end + + def threshold + end + + def threshold=(str_) + end + + def id + end + + def id=(str_) + end + + def signals + end + + def signals=(str_) + end +end diff --git a/lib/moderation_api/models/operations/unresolvequeueitem_request.rb b/lib/moderation_api/models/operations/unresolvequeueitem_request.rb new file mode 100644 index 00000000..e7eff7eb --- /dev/null +++ b/lib/moderation_api/models/operations/unresolvequeueitem_request.rb @@ -0,0 +1,39 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class UnresolveQueueItemRequest + extend T::Sig + include Crystalline::MetadataFields + + # The queue ID + field :id, ::String, {'path_param': {'field_name': "id", 'style': "simple", 'explode': false}} + # The item ID to unresolve + field :item_id, ::String, {'path_param': {'field_name': "itemId", 'style': "simple", 'explode': false}} + + field :body, Models::Operations::UnresolveQueueItemRequestBody, {'request': {'media_type': "application/json"}} + + sig { params(id: ::String, item_id: ::String, body: Models::Operations::UnresolveQueueItemRequestBody).void } + def initialize(id:, item_id:, body:) + @id = id + @item_id = item_id + @body = body + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @id == other.id + return false unless @item_id == other.item_id + return false unless @body == other.body + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/unresolvequeueitem_request.rbi b/lib/moderation_api/models/operations/unresolvequeueitem_request.rbi new file mode 100644 index 00000000..153346fa --- /dev/null +++ b/lib/moderation_api/models/operations/unresolvequeueitem_request.rbi @@ -0,0 +1,26 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::UnresolveQueueItemRequest + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::UnresolveQueueItemRequest + def id + end + + def id=(str_) + end + + def item_id + end + + def item_id=(str_) + end + + def body + end + + def body=(str_) + end +end diff --git a/lib/moderation_api/models/operations/unresolvequeueitem_requestbody.rb b/lib/moderation_api/models/operations/unresolvequeueitem_requestbody.rb new file mode 100644 index 00000000..544fea34 --- /dev/null +++ b/lib/moderation_api/models/operations/unresolvequeueitem_requestbody.rb @@ -0,0 +1,35 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class UnresolveQueueItemRequestBody + extend T::Sig + include Crystalline::MetadataFields + + # Optional reason for unresolving the item + field( + :comment, + Crystalline::Nilable.new(::String), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("comment")}} + ) + + sig { params(comment: T.nilable(::String)).void } + def initialize(comment: nil) + @comment = comment + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @comment == other.comment + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/unresolvequeueitem_requestbody.rbi b/lib/moderation_api/models/operations/unresolvequeueitem_requestbody.rbi new file mode 100644 index 00000000..406b48e6 --- /dev/null +++ b/lib/moderation_api/models/operations/unresolvequeueitem_requestbody.rbi @@ -0,0 +1,14 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::UnresolveQueueItemRequestBody + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::UnresolveQueueItemRequestBody + def comment + end + + def comment=(str_) + end +end diff --git a/lib/moderation_api/models/operations/unresolvequeueitem_response.rb b/lib/moderation_api/models/operations/unresolvequeueitem_response.rb new file mode 100644 index 00000000..41878532 --- /dev/null +++ b/lib/moderation_api/models/operations/unresolvequeueitem_response.rb @@ -0,0 +1,51 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class UnresolveQueueItemResponse + extend T::Sig + include Crystalline::MetadataFields + + # HTTP response content type for this operation + field :content_type, ::String + # HTTP response status code for this operation + field :status_code, ::Integer + # Raw HTTP response; suitable for custom response parsing + field :raw_response, ::Faraday::Response + # Successful response + field :object, Crystalline::Nilable.new(Models::Operations::UnresolveQueueItemResponseBody) + + sig { + params( + content_type: ::String, + status_code: ::Integer, + raw_response: ::Faraday::Response, + object: T.nilable(Models::Operations::UnresolveQueueItemResponseBody) + ) + .void + } + def initialize(content_type:, status_code:, raw_response:, object: nil) + @content_type = content_type + @status_code = status_code + @raw_response = raw_response + @object = object + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @content_type == other.content_type + return false unless @status_code == other.status_code + return false unless @raw_response == other.raw_response + return false unless @object == other.object + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/unresolvequeueitem_response.rbi b/lib/moderation_api/models/operations/unresolvequeueitem_response.rbi new file mode 100644 index 00000000..635fe19f --- /dev/null +++ b/lib/moderation_api/models/operations/unresolvequeueitem_response.rbi @@ -0,0 +1,32 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::UnresolveQueueItemResponse + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::UnresolveQueueItemResponse + def content_type + end + + def content_type=(str_) + end + + def status_code + end + + def status_code=(str_) + end + + def raw_response + end + + def raw_response=(str_) + end + + def object + end + + def object=(str_) + end +end diff --git a/lib/moderation_api/models/operations/unresolvequeueitem_responsebody.rb b/lib/moderation_api/models/operations/unresolvequeueitem_responsebody.rb new file mode 100644 index 00000000..ccf4e1b2 --- /dev/null +++ b/lib/moderation_api/models/operations/unresolvequeueitem_responsebody.rb @@ -0,0 +1,50 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + # Successful response + class UnresolveQueueItemResponseBody + extend T::Sig + include Crystalline::MetadataFields + + field( + :success, + Crystalline::Boolean.new, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("success"), required: true}} + ) + # New status of the item + field( + :status, + ::String, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("status"), required: true}} + ) + # Timestamp when the item was unresolved + field( + :unresolved_at, + ::String, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("unresolvedAt"), required: true}} + ) + + sig { params(success: T::Boolean, status: ::String, unresolved_at: ::String).void } + def initialize(success:, status:, unresolved_at:) + @success = success + @status = status + @unresolved_at = unresolved_at + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @success == other.success + return false unless @status == other.status + return false unless @unresolved_at == other.unresolved_at + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/unresolvequeueitem_responsebody.rbi b/lib/moderation_api/models/operations/unresolvequeueitem_responsebody.rbi new file mode 100644 index 00000000..be50415a --- /dev/null +++ b/lib/moderation_api/models/operations/unresolvequeueitem_responsebody.rbi @@ -0,0 +1,26 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::UnresolveQueueItemResponseBody + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::UnresolveQueueItemResponseBody + def success + end + + def success=(str_) + end + + def status + end + + def status=(str_) + end + + def unresolved_at + end + + def unresolved_at=(str_) + end +end diff --git a/lib/moderation_api/models/operations/updateaction_position_request.rb b/lib/moderation_api/models/operations/updateaction_position_request.rb new file mode 100644 index 00000000..de859a0a --- /dev/null +++ b/lib/moderation_api/models/operations/updateaction_position_request.rb @@ -0,0 +1,19 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + # UpdateActionPositionRequest - Show the action in all queues, selected queues or no queues (to use via API only). + class UpdateActionPositionRequest < T::Enum + enums do + ALL_QUEUES = new("ALL_QUEUES") + SOME_QUEUES = new("SOME_QUEUES") + HIDDEN = new("HIDDEN") + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/updateaction_position_request.rbi b/lib/moderation_api/models/operations/updateaction_position_request.rbi new file mode 100644 index 00000000..c93be180 --- /dev/null +++ b/lib/moderation_api/models/operations/updateaction_position_request.rbi @@ -0,0 +1,9 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::UpdateActionPositionRequest + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::UpdateActionPositionRequest +end diff --git a/lib/moderation_api/models/operations/updateaction_position_response.rb b/lib/moderation_api/models/operations/updateaction_position_response.rb new file mode 100644 index 00000000..18f8ff50 --- /dev/null +++ b/lib/moderation_api/models/operations/updateaction_position_response.rb @@ -0,0 +1,22 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + # UpdateActionPositionResponse - Show the action in all queues, selected queues or no queues (to use via API only). + class UpdateActionPositionResponse + include ::Crystalline::Enum + enums do + ALL_QUEUES = new("ALL_QUEUES") + SOME_QUEUES = new("SOME_QUEUES") + HIDDEN = new("HIDDEN") + end + + open! + end + end + end +end diff --git a/lib/moderation_api/models/operations/updateaction_position_response.rbi b/lib/moderation_api/models/operations/updateaction_position_response.rbi new file mode 100644 index 00000000..56f07d67 --- /dev/null +++ b/lib/moderation_api/models/operations/updateaction_position_response.rbi @@ -0,0 +1,9 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::UpdateActionPositionResponse + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::UpdateActionPositionResponse +end diff --git a/lib/moderation_api/models/operations/updateaction_possiblevalue_request.rb b/lib/moderation_api/models/operations/updateaction_possiblevalue_request.rb new file mode 100644 index 00000000..f33a17f0 --- /dev/null +++ b/lib/moderation_api/models/operations/updateaction_possiblevalue_request.rb @@ -0,0 +1,35 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class UpdateActionPossibleValueRequest + extend T::Sig + include Crystalline::MetadataFields + + # The value of the action. + field( + :value, + ::String, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("value"), required: true}} + ) + + sig { params(value: ::String).void } + def initialize(value:) + @value = value + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @value == other.value + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/updateaction_possiblevalue_request.rbi b/lib/moderation_api/models/operations/updateaction_possiblevalue_request.rbi new file mode 100644 index 00000000..bdd1b48f --- /dev/null +++ b/lib/moderation_api/models/operations/updateaction_possiblevalue_request.rbi @@ -0,0 +1,14 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::UpdateActionPossibleValueRequest + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::UpdateActionPossibleValueRequest + def value + end + + def value=(str_) + end +end diff --git a/lib/moderation_api/models/operations/updateaction_possiblevalue_response.rb b/lib/moderation_api/models/operations/updateaction_possiblevalue_response.rb new file mode 100644 index 00000000..e20bf591 --- /dev/null +++ b/lib/moderation_api/models/operations/updateaction_possiblevalue_response.rb @@ -0,0 +1,35 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class UpdateActionPossibleValueResponse + extend T::Sig + include Crystalline::MetadataFields + + # The value of the action. + field( + :value, + ::String, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("value"), required: true}} + ) + + sig { params(value: ::String).void } + def initialize(value:) + @value = value + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @value == other.value + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/updateaction_possiblevalue_response.rbi b/lib/moderation_api/models/operations/updateaction_possiblevalue_response.rbi new file mode 100644 index 00000000..e33f52d6 --- /dev/null +++ b/lib/moderation_api/models/operations/updateaction_possiblevalue_response.rbi @@ -0,0 +1,14 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::UpdateActionPossibleValueResponse + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::UpdateActionPossibleValueResponse + def value + end + + def value=(str_) + end +end diff --git a/lib/moderation_api/models/operations/updateaction_queuebehaviour_request.rb b/lib/moderation_api/models/operations/updateaction_queuebehaviour_request.rb new file mode 100644 index 00000000..54f162d5 --- /dev/null +++ b/lib/moderation_api/models/operations/updateaction_queuebehaviour_request.rb @@ -0,0 +1,19 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + # UpdateActionQueueBehaviourRequest - Whether the action resolves and removes the item, unresolves and re-add it to the queue, or does not change the resolve status. + class UpdateActionQueueBehaviourRequest < T::Enum + enums do + REMOVE = new("REMOVE") + ADD = new("ADD") + NO_CHANGE = new("NO_CHANGE") + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/updateaction_queuebehaviour_request.rbi b/lib/moderation_api/models/operations/updateaction_queuebehaviour_request.rbi new file mode 100644 index 00000000..aa1c83c5 --- /dev/null +++ b/lib/moderation_api/models/operations/updateaction_queuebehaviour_request.rbi @@ -0,0 +1,9 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::UpdateActionQueueBehaviourRequest + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::UpdateActionQueueBehaviourRequest +end diff --git a/lib/moderation_api/models/operations/updateaction_queuebehaviour_response.rb b/lib/moderation_api/models/operations/updateaction_queuebehaviour_response.rb new file mode 100644 index 00000000..09d6cc38 --- /dev/null +++ b/lib/moderation_api/models/operations/updateaction_queuebehaviour_response.rb @@ -0,0 +1,22 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + # UpdateActionQueueBehaviourResponse - Whether the action resolves and removes the item, unresolves and re-add it to the queue, or does not change the resolve status. + class UpdateActionQueueBehaviourResponse + include ::Crystalline::Enum + enums do + REMOVE = new("REMOVE") + ADD = new("ADD") + NO_CHANGE = new("NO_CHANGE") + end + + open! + end + end + end +end diff --git a/lib/moderation_api/models/operations/updateaction_queuebehaviour_response.rbi b/lib/moderation_api/models/operations/updateaction_queuebehaviour_response.rbi new file mode 100644 index 00000000..77720133 --- /dev/null +++ b/lib/moderation_api/models/operations/updateaction_queuebehaviour_response.rbi @@ -0,0 +1,9 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::UpdateActionQueueBehaviourResponse + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::UpdateActionQueueBehaviourResponse +end diff --git a/lib/moderation_api/models/operations/updateaction_request.rb b/lib/moderation_api/models/operations/updateaction_request.rb new file mode 100644 index 00000000..39b81694 --- /dev/null +++ b/lib/moderation_api/models/operations/updateaction_request.rb @@ -0,0 +1,35 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class UpdateActionRequest + extend T::Sig + include Crystalline::MetadataFields + + # The ID of the action to update. + field :id, ::String, {'path_param': {'field_name': "id", 'style': "simple", 'explode': false}} + + field :body, Models::Operations::UpdateActionRequestBody, {'request': {'media_type': "application/json"}} + + sig { params(id: ::String, body: Models::Operations::UpdateActionRequestBody).void } + def initialize(id:, body:) + @id = id + @body = body + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @id == other.id + return false unless @body == other.body + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/updateaction_request.rbi b/lib/moderation_api/models/operations/updateaction_request.rbi new file mode 100644 index 00000000..503955ab --- /dev/null +++ b/lib/moderation_api/models/operations/updateaction_request.rbi @@ -0,0 +1,20 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::UpdateActionRequest + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::UpdateActionRequest + def id + end + + def id=(str_) + end + + def body + end + + def body=(str_) + end +end diff --git a/lib/moderation_api/models/operations/updateaction_requestbody.rb b/lib/moderation_api/models/operations/updateaction_requestbody.rb new file mode 100644 index 00000000..5d69d3df --- /dev/null +++ b/lib/moderation_api/models/operations/updateaction_requestbody.rb @@ -0,0 +1,160 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class UpdateActionRequestBody + extend T::Sig + include Crystalline::MetadataFields + + # The name of the action. + field( + :name, + Crystalline::Nilable.new(::String), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("name")}} + ) + # The IDs of the queues the action is available in. + field( + :filter_in_queue_ids, + Crystalline::Nilable.new(Crystalline::Array.new(::String)), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("filterInQueueIds")}} + ) + # The possible values of the action. The user will be prompted to select one of these values when executing the action. + field( + :possible_values, + Crystalline::Nilable.new(Crystalline::Array.new(Models::Operations::UpdateActionPossibleValueRequest)), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("possibleValues")}} + ) + # User defined key of the action. + field( + :key, + Crystalline::Nilable.new(::String), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("key")}} + ) + # The description of the action. + field( + :description, + Crystalline::Nilable.new(::String), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("description")}} + ) + # The type of the action. + field( + :type, + Crystalline::Nilable.new(Models::Operations::UpdateActionTypeRequest), + { + 'format_json': { + 'letter_case': ::ModerationApi::Utils.field_name("type"), + 'decoder': ::ModerationApi::Utils.enum_from_string(Models::Operations::UpdateActionTypeRequest, true) + } + } + ) + # Whether the action resolves and removes the item, unresolves and re-add it to the queue, or does not change the resolve status. + field( + :queue_behaviour, + Crystalline::Nilable.new(Models::Operations::UpdateActionQueueBehaviourRequest), + { + 'format_json': { + 'letter_case': ::ModerationApi::Utils.field_name("queueBehaviour"), + 'decoder': ::ModerationApi::Utils.enum_from_string( + Models::Operations::UpdateActionQueueBehaviourRequest, + true + ) + } + } + ) + # Show the action in all queues, selected queues or no queues (to use via API only). + field( + :position, + Crystalline::Nilable.new(Models::Operations::UpdateActionPositionRequest), + { + 'format_json': { + 'letter_case': ::ModerationApi::Utils.field_name("position"), + 'decoder': ::ModerationApi::Utils.enum_from_string(Models::Operations::UpdateActionPositionRequest, true) + } + } + ) + # Whether the action requires a value to be executed. + field( + :value_required, + Crystalline::Nilable.new(Crystalline::Boolean.new), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("valueRequired")}} + ) + # Whether the action allows any text to be entered as a value or if it must be one of the possible values. + field( + :free_text, + Crystalline::Nilable.new(Crystalline::Boolean.new), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("freeText")}} + ) + # Whether the action is a built-in action or a custom one. + field( + :built_in, + Crystalline::Nilable.new(Crystalline::Boolean.new), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("builtIn")}} + ) + + sig { + params( + name: T.nilable(::String), + filter_in_queue_ids: T.nilable(T::Array[::String]), + possible_values: T.nilable(T::Array[Models::Operations::UpdateActionPossibleValueRequest]), + key: T.nilable(::String), + description: T.nilable(::String), + type: T.nilable(Models::Operations::UpdateActionTypeRequest), + queue_behaviour: T.nilable(Models::Operations::UpdateActionQueueBehaviourRequest), + position: T.nilable(Models::Operations::UpdateActionPositionRequest), + value_required: T.nilable(T::Boolean), + free_text: T.nilable(T::Boolean), + built_in: T.nilable(T::Boolean) + ) + .void + } + def initialize( + name: nil, + filter_in_queue_ids: nil, + possible_values: nil, + key: nil, + description: nil, + type: nil, + queue_behaviour: Models::Operations::UpdateActionQueueBehaviourRequest::NO_CHANGE, + position: Models::Operations::UpdateActionPositionRequest::ALL_QUEUES, + value_required: false, + free_text: false, + built_in: false + ) + @name = name + @filter_in_queue_ids = filter_in_queue_ids + @possible_values = possible_values + @key = key + @description = description + @type = type + @queue_behaviour = queue_behaviour + @position = position + @value_required = value_required + @free_text = free_text + @built_in = built_in + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @name == other.name + return false unless @filter_in_queue_ids == other.filter_in_queue_ids + return false unless @possible_values == other.possible_values + return false unless @key == other.key + return false unless @description == other.description + return false unless @type == other.type + return false unless @queue_behaviour == other.queue_behaviour + return false unless @position == other.position + return false unless @value_required == other.value_required + return false unless @free_text == other.free_text + return false unless @built_in == other.built_in + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/updateaction_requestbody.rbi b/lib/moderation_api/models/operations/updateaction_requestbody.rbi new file mode 100644 index 00000000..e2f3ca2e --- /dev/null +++ b/lib/moderation_api/models/operations/updateaction_requestbody.rbi @@ -0,0 +1,74 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::UpdateActionRequestBody + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::UpdateActionRequestBody + def name + end + + def name=(str_) + end + + def filter_in_queue_ids + end + + def filter_in_queue_ids=(str_) + end + + def possible_values + end + + def possible_values=(str_) + end + + def key + end + + def key=(str_) + end + + def description + end + + def description=(str_) + end + + def type + end + + def type=(str_) + end + + def queue_behaviour + end + + def queue_behaviour=(str_) + end + + def position + end + + def position=(str_) + end + + def value_required + end + + def value_required=(str_) + end + + def free_text + end + + def free_text=(str_) + end + + def built_in + end + + def built_in=(str_) + end +end diff --git a/lib/moderation_api/models/operations/updateaction_response.rb b/lib/moderation_api/models/operations/updateaction_response.rb new file mode 100644 index 00000000..93d13ab4 --- /dev/null +++ b/lib/moderation_api/models/operations/updateaction_response.rb @@ -0,0 +1,51 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class UpdateActionResponse + extend T::Sig + include Crystalline::MetadataFields + + # HTTP response content type for this operation + field :content_type, ::String + # HTTP response status code for this operation + field :status_code, ::Integer + # Raw HTTP response; suitable for custom response parsing + field :raw_response, ::Faraday::Response + # Action updated successfully + field :object, Crystalline::Nilable.new(Models::Operations::UpdateActionResponseBody) + + sig { + params( + content_type: ::String, + status_code: ::Integer, + raw_response: ::Faraday::Response, + object: T.nilable(Models::Operations::UpdateActionResponseBody) + ) + .void + } + def initialize(content_type:, status_code:, raw_response:, object: nil) + @content_type = content_type + @status_code = status_code + @raw_response = raw_response + @object = object + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @content_type == other.content_type + return false unless @status_code == other.status_code + return false unless @raw_response == other.raw_response + return false unless @object == other.object + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/updateaction_response.rbi b/lib/moderation_api/models/operations/updateaction_response.rbi new file mode 100644 index 00000000..6d2115b4 --- /dev/null +++ b/lib/moderation_api/models/operations/updateaction_response.rbi @@ -0,0 +1,32 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::UpdateActionResponse + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::UpdateActionResponse + def content_type + end + + def content_type=(str_) + end + + def status_code + end + + def status_code=(str_) + end + + def raw_response + end + + def raw_response=(str_) + end + + def object + end + + def object=(str_) + end +end diff --git a/lib/moderation_api/models/operations/updateaction_responsebody.rb b/lib/moderation_api/models/operations/updateaction_responsebody.rb new file mode 100644 index 00000000..7da04894 --- /dev/null +++ b/lib/moderation_api/models/operations/updateaction_responsebody.rb @@ -0,0 +1,182 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + # Action updated successfully + class UpdateActionResponseBody + extend T::Sig + include Crystalline::MetadataFields + + # The ID of the action. + field :id, ::String, {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("id"), required: true}} + # The date the action was created. + field( + :created_at, + ::String, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("createdAt"), required: true}} + ) + # The name of the action. + field( + :name, + ::String, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("name"), required: true}} + ) + # The IDs of the queues the action is available in. + field( + :filter_in_queue_ids, + Crystalline::Array.new(::String), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("filterInQueueIds"), required: true}} + ) + # The possible values of the action. The user will be prompted to select one of these values when executing the action. + field( + :possible_values, + Crystalline::Array.new(Models::Operations::UpdateActionPossibleValueResponse), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("possibleValues"), required: true}} + ) + # User defined key of the action. + field( + :key, + Crystalline::Nilable.new(::String), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("key")}} + ) + # The description of the action. + field( + :description, + Crystalline::Nilable.new(::String), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("description")}} + ) + # The type of the action. + field( + :type, + Crystalline::Nilable.new(Models::Operations::UpdateActionTypeResponse), + { + 'format_json': { + 'letter_case': ::ModerationApi::Utils.field_name("type"), + 'decoder': ::ModerationApi::Utils.open_enum_from_string( + Models::Operations::UpdateActionTypeResponse, + true + ) + } + } + ) + # Whether the action resolves and removes the item, unresolves and re-add it to the queue, or does not change the resolve status. + field( + :queue_behaviour, + Crystalline::Nilable.new(Models::Operations::UpdateActionQueueBehaviourResponse), + { + 'format_json': { + 'letter_case': ::ModerationApi::Utils.field_name("queueBehaviour"), + 'decoder': ::ModerationApi::Utils.open_enum_from_string( + Models::Operations::UpdateActionQueueBehaviourResponse, + true + ) + } + } + ) + # Show the action in all queues, selected queues or no queues (to use via API only). + field( + :position, + Crystalline::Nilable.new(Models::Operations::UpdateActionPositionResponse), + { + 'format_json': { + 'letter_case': ::ModerationApi::Utils.field_name("position"), + 'decoder': ::ModerationApi::Utils.open_enum_from_string( + Models::Operations::UpdateActionPositionResponse, + true + ) + } + } + ) + # Whether the action requires a value to be executed. + field( + :value_required, + Crystalline::Nilable.new(Crystalline::Boolean.new), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("valueRequired")}} + ) + # Whether the action allows any text to be entered as a value or if it must be one of the possible values. + field( + :free_text, + Crystalline::Nilable.new(Crystalline::Boolean.new), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("freeText")}} + ) + # Whether the action is a built-in action or a custom one. + field( + :built_in, + Crystalline::Nilable.new(Crystalline::Boolean.new), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("builtIn")}} + ) + + sig { + params( + id: ::String, + created_at: ::String, + name: ::String, + filter_in_queue_ids: T::Array[::String], + possible_values: T::Array[Models::Operations::UpdateActionPossibleValueResponse], + key: T.nilable(::String), + description: T.nilable(::String), + type: T.nilable(Models::Operations::UpdateActionTypeResponse), + queue_behaviour: T.nilable(Models::Operations::UpdateActionQueueBehaviourResponse), + position: T.nilable(Models::Operations::UpdateActionPositionResponse), + value_required: T.nilable(T::Boolean), + free_text: T.nilable(T::Boolean), + built_in: T.nilable(T::Boolean) + ) + .void + } + def initialize( + id:, + created_at:, + name:, + filter_in_queue_ids:, + possible_values:, + key: nil, + description: nil, + type: nil, + queue_behaviour: Models::Operations::UpdateActionQueueBehaviourResponse::NO_CHANGE, + position: Models::Operations::UpdateActionPositionResponse::ALL_QUEUES, + value_required: false, + free_text: false, + built_in: false + ) + @id = id + @created_at = created_at + @name = name + @filter_in_queue_ids = filter_in_queue_ids + @possible_values = possible_values + @key = key + @description = description + @type = type + @queue_behaviour = queue_behaviour + @position = position + @value_required = value_required + @free_text = free_text + @built_in = built_in + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @id == other.id + return false unless @created_at == other.created_at + return false unless @name == other.name + return false unless @filter_in_queue_ids == other.filter_in_queue_ids + return false unless @possible_values == other.possible_values + return false unless @key == other.key + return false unless @description == other.description + return false unless @type == other.type + return false unless @queue_behaviour == other.queue_behaviour + return false unless @position == other.position + return false unless @value_required == other.value_required + return false unless @free_text == other.free_text + return false unless @built_in == other.built_in + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/updateaction_responsebody.rbi b/lib/moderation_api/models/operations/updateaction_responsebody.rbi new file mode 100644 index 00000000..7a933471 --- /dev/null +++ b/lib/moderation_api/models/operations/updateaction_responsebody.rbi @@ -0,0 +1,86 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::UpdateActionResponseBody + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::UpdateActionResponseBody + def id + end + + def id=(str_) + end + + def created_at + end + + def created_at=(str_) + end + + def name + end + + def name=(str_) + end + + def filter_in_queue_ids + end + + def filter_in_queue_ids=(str_) + end + + def possible_values + end + + def possible_values=(str_) + end + + def key + end + + def key=(str_) + end + + def description + end + + def description=(str_) + end + + def type + end + + def type=(str_) + end + + def queue_behaviour + end + + def queue_behaviour=(str_) + end + + def position + end + + def position=(str_) + end + + def value_required + end + + def value_required=(str_) + end + + def free_text + end + + def free_text=(str_) + end + + def built_in + end + + def built_in=(str_) + end +end diff --git a/lib/moderation_api/models/operations/updateaction_type_request.rb b/lib/moderation_api/models/operations/updateaction_type_request.rb new file mode 100644 index 00000000..ebab4b90 --- /dev/null +++ b/lib/moderation_api/models/operations/updateaction_type_request.rb @@ -0,0 +1,26 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class UpdateActionTypeRequest < T::Enum + enums do + AUTHOR_BLOCK = new("AUTHOR_BLOCK") + AUTHOR_BLOCK_TEMP = new("AUTHOR_BLOCK_TEMP") + AUTHOR_UNBLOCK = new("AUTHOR_UNBLOCK") + AUTHOR_DELETE = new("AUTHOR_DELETE") + AUTHOR_REPORT = new("AUTHOR_REPORT") + AUTHOR_WARN = new("AUTHOR_WARN") + AUTHOR_CUSTOM = new("AUTHOR_CUSTOM") + ITEM_REJECT = new("ITEM_REJECT") + ITEM_ALLOW = new("ITEM_ALLOW") + ITEM_CUSTOM = new("ITEM_CUSTOM") + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/updateaction_type_request.rbi b/lib/moderation_api/models/operations/updateaction_type_request.rbi new file mode 100644 index 00000000..921a2b10 --- /dev/null +++ b/lib/moderation_api/models/operations/updateaction_type_request.rbi @@ -0,0 +1,9 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::UpdateActionTypeRequest + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::UpdateActionTypeRequest +end diff --git a/lib/moderation_api/models/operations/updateaction_type_response.rb b/lib/moderation_api/models/operations/updateaction_type_response.rb new file mode 100644 index 00000000..e2f327d4 --- /dev/null +++ b/lib/moderation_api/models/operations/updateaction_type_response.rb @@ -0,0 +1,29 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class UpdateActionTypeResponse + include ::Crystalline::Enum + enums do + AUTHOR_BLOCK = new("AUTHOR_BLOCK") + AUTHOR_BLOCK_TEMP = new("AUTHOR_BLOCK_TEMP") + AUTHOR_UNBLOCK = new("AUTHOR_UNBLOCK") + AUTHOR_DELETE = new("AUTHOR_DELETE") + AUTHOR_REPORT = new("AUTHOR_REPORT") + AUTHOR_WARN = new("AUTHOR_WARN") + AUTHOR_CUSTOM = new("AUTHOR_CUSTOM") + ITEM_REJECT = new("ITEM_REJECT") + ITEM_ALLOW = new("ITEM_ALLOW") + ITEM_CUSTOM = new("ITEM_CUSTOM") + end + + open! + end + end + end +end diff --git a/lib/moderation_api/models/operations/updateaction_type_response.rbi b/lib/moderation_api/models/operations/updateaction_type_response.rbi new file mode 100644 index 00000000..e7fe298d --- /dev/null +++ b/lib/moderation_api/models/operations/updateaction_type_response.rbi @@ -0,0 +1,9 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::UpdateActionTypeResponse + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::UpdateActionTypeResponse +end diff --git a/lib/moderation_api/models/operations/updateauthor_metadata.rb b/lib/moderation_api/models/operations/updateauthor_metadata.rb new file mode 100644 index 00000000..2c0ed306 --- /dev/null +++ b/lib/moderation_api/models/operations/updateauthor_metadata.rb @@ -0,0 +1,86 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + # Additional metadata provided by your system. We recommend including any relevant information that may assist in the moderation process. + class UpdateAuthorMetadata + extend T::Sig + include Crystalline::MetadataFields + + field( + :additional_properties, + Crystalline::Nilable.new(Crystalline::Hash.new(Symbol, ::Object)), + { + 'format_json': { + 'letter_case': ::ModerationApi::Utils.field_name("additional_properties"), + 'additional_properties': true + } + } + ) + # Whether the author's email is verified + field( + :email_verified, + Crystalline::Nilable.new(Crystalline::Boolean.new), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("email_verified")}} + ) + # Whether the author's phone number is verified + field( + :phone_verified, + Crystalline::Nilable.new(Crystalline::Boolean.new), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("phone_verified")}} + ) + # Whether the author's identity is verified + field( + :identity_verified, + Crystalline::Nilable.new(Crystalline::Boolean.new), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("identity_verified")}} + ) + # Whether the author is a paying customer + field( + :is_paying_customer, + Crystalline::Nilable.new(Crystalline::Boolean.new), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("is_paying_customer")}} + ) + + sig { + params( + additional_properties: T.nilable(T::Hash[Symbol, ::Object]), + email_verified: T.nilable(T::Boolean), + phone_verified: T.nilable(T::Boolean), + identity_verified: T.nilable(T::Boolean), + is_paying_customer: T.nilable(T::Boolean) + ) + .void + } + def initialize( + additional_properties: nil, + email_verified: nil, + phone_verified: nil, + identity_verified: nil, + is_paying_customer: nil + ) + @additional_properties = additional_properties + @email_verified = email_verified + @phone_verified = phone_verified + @identity_verified = identity_verified + @is_paying_customer = is_paying_customer + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @additional_properties == other.additional_properties + return false unless @email_verified == other.email_verified + return false unless @phone_verified == other.phone_verified + return false unless @identity_verified == other.identity_verified + return false unless @is_paying_customer == other.is_paying_customer + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/updateauthor_metadata.rbi b/lib/moderation_api/models/operations/updateauthor_metadata.rbi new file mode 100644 index 00000000..403a5ff0 --- /dev/null +++ b/lib/moderation_api/models/operations/updateauthor_metadata.rbi @@ -0,0 +1,38 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::UpdateAuthorMetadata + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::UpdateAuthorMetadata + def additional_properties + end + + def additional_properties=(str_) + end + + def email_verified + end + + def email_verified=(str_) + end + + def phone_verified + end + + def phone_verified=(str_) + end + + def identity_verified + end + + def identity_verified=(str_) + end + + def is_paying_customer + end + + def is_paying_customer=(str_) + end +end diff --git a/lib/moderation_api/models/operations/updateauthor_request.rb b/lib/moderation_api/models/operations/updateauthor_request.rb new file mode 100644 index 00000000..e4a7296d --- /dev/null +++ b/lib/moderation_api/models/operations/updateauthor_request.rb @@ -0,0 +1,35 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class UpdateAuthorRequest + extend T::Sig + include Crystalline::MetadataFields + + # Either external ID or the ID assigned by moderation API. + field :id, ::String, {'path_param': {'field_name': "id", 'style': "simple", 'explode': false}} + + field :body, Models::Operations::UpdateAuthorRequestBody, {'request': {'media_type': "application/json"}} + + sig { params(id: ::String, body: Models::Operations::UpdateAuthorRequestBody).void } + def initialize(id:, body:) + @id = id + @body = body + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @id == other.id + return false unless @body == other.body + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/updateauthor_request.rbi b/lib/moderation_api/models/operations/updateauthor_request.rbi new file mode 100644 index 00000000..15da73af --- /dev/null +++ b/lib/moderation_api/models/operations/updateauthor_request.rbi @@ -0,0 +1,20 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::UpdateAuthorRequest + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::UpdateAuthorRequest + def id + end + + def id=(str_) + end + + def body + end + + def body=(str_) + end +end diff --git a/lib/moderation_api/models/operations/updateauthor_requestbody.rb b/lib/moderation_api/models/operations/updateauthor_requestbody.rb new file mode 100644 index 00000000..77221811 --- /dev/null +++ b/lib/moderation_api/models/operations/updateauthor_requestbody.rb @@ -0,0 +1,122 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class UpdateAuthorRequestBody + extend T::Sig + include Crystalline::MetadataFields + + # Additional metadata provided by your system. We recommend including any relevant information that may assist in the moderation process. + field( + :metadata, + Crystalline::Nilable.new(Models::Operations::UpdateAuthorMetadata), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("metadata")}} + ) + # Timestamp when author first appeared + field( + :first_seen, + Crystalline::Nilable.new(::Float), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("first_seen")}} + ) + # Timestamp of last activity + field( + :last_seen, + Crystalline::Nilable.new(::Float), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("last_seen")}} + ) + # URL of the author's profile picture + field( + :profile_picture, + Crystalline::Nilable.new(::String), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("profile_picture")}} + ) + # URL of the author's external profile + field( + :external_link, + Crystalline::Nilable.new(::String), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("external_link")}} + ) + # Author name or identifier + field( + :name, + Crystalline::Nilable.new(::String), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("name")}} + ) + # Author email address + field( + :email, + Crystalline::Nilable.new(::String), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("email")}} + ) + # The author's company or organization + field( + :company, + Crystalline::Nilable.new(::String), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("company")}} + ) + + field( + :manual_trust_level, + Crystalline::Nilable.new(::Float), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("manual_trust_level")}} + ) + + sig { + params( + metadata: T.nilable(Models::Operations::UpdateAuthorMetadata), + first_seen: T.nilable(::Float), + last_seen: T.nilable(::Float), + profile_picture: T.nilable(::String), + external_link: T.nilable(::String), + name: T.nilable(::String), + email: T.nilable(::String), + company: T.nilable(::String), + manual_trust_level: T.nilable(::Float) + ) + .void + } + def initialize( + metadata: nil, + first_seen: nil, + last_seen: nil, + profile_picture: nil, + external_link: nil, + name: nil, + email: nil, + company: nil, + manual_trust_level: nil + ) + @metadata = metadata + @first_seen = first_seen + @last_seen = last_seen + @profile_picture = profile_picture + @external_link = external_link + @name = name + @email = email + @company = company + @manual_trust_level = manual_trust_level + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @metadata == other.metadata + return false unless @first_seen == other.first_seen + return false unless @last_seen == other.last_seen + return false unless @profile_picture == other.profile_picture + return false unless @external_link == other.external_link + return false unless @name == other.name + return false unless @email == other.email + return false unless @company == other.company + return false unless @manual_trust_level == other.manual_trust_level + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/updateauthor_requestbody.rbi b/lib/moderation_api/models/operations/updateauthor_requestbody.rbi new file mode 100644 index 00000000..b2ac750b --- /dev/null +++ b/lib/moderation_api/models/operations/updateauthor_requestbody.rbi @@ -0,0 +1,62 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::UpdateAuthorRequestBody + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::UpdateAuthorRequestBody + def metadata + end + + def metadata=(str_) + end + + def first_seen + end + + def first_seen=(str_) + end + + def last_seen + end + + def last_seen=(str_) + end + + def profile_picture + end + + def profile_picture=(str_) + end + + def external_link + end + + def external_link=(str_) + end + + def name + end + + def name=(str_) + end + + def email + end + + def email=(str_) + end + + def company + end + + def company=(str_) + end + + def manual_trust_level + end + + def manual_trust_level=(str_) + end +end diff --git a/lib/moderation_api/models/operations/updateauthor_response.rb b/lib/moderation_api/models/operations/updateauthor_response.rb new file mode 100644 index 00000000..4e0a9774 --- /dev/null +++ b/lib/moderation_api/models/operations/updateauthor_response.rb @@ -0,0 +1,51 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class UpdateAuthorResponse + extend T::Sig + include Crystalline::MetadataFields + + # HTTP response content type for this operation + field :content_type, ::String + # HTTP response status code for this operation + field :status_code, ::Integer + # Raw HTTP response; suitable for custom response parsing + field :raw_response, ::Faraday::Response + # Successful response + field :public_author, Crystalline::Nilable.new(Models::Components::PublicAuthor) + + sig { + params( + content_type: ::String, + status_code: ::Integer, + raw_response: ::Faraday::Response, + public_author: T.nilable(Models::Components::PublicAuthor) + ) + .void + } + def initialize(content_type:, status_code:, raw_response:, public_author: nil) + @content_type = content_type + @status_code = status_code + @raw_response = raw_response + @public_author = public_author + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @content_type == other.content_type + return false unless @status_code == other.status_code + return false unless @raw_response == other.raw_response + return false unless @public_author == other.public_author + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/updateauthor_response.rbi b/lib/moderation_api/models/operations/updateauthor_response.rbi new file mode 100644 index 00000000..6c2ee6e4 --- /dev/null +++ b/lib/moderation_api/models/operations/updateauthor_response.rbi @@ -0,0 +1,32 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::UpdateAuthorResponse + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::UpdateAuthorResponse + def content_type + end + + def content_type=(str_) + end + + def status_code + end + + def status_code=(str_) + end + + def raw_response + end + + def raw_response=(str_) + end + + def public_author + end + + def public_author=(str_) + end +end diff --git a/lib/moderation_api/models/operations/updatechannel_contenttype.rb b/lib/moderation_api/models/operations/updatechannel_contenttype.rb new file mode 100644 index 00000000..1d466177 --- /dev/null +++ b/lib/moderation_api/models/operations/updatechannel_contenttype.rb @@ -0,0 +1,25 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + # UpdateChannelContentType - The kind of content the channel moderates. + class UpdateChannelContentType < T::Enum + enums do + PROFILE = new("profile") + MESSAGE = new("message") + POST = new("post") + COMMENT = new("comment") + EVENT = new("event") + PRODUCT = new("product") + REVIEW = new("review") + VOICE = new("voice") + OTHER = new("other") + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/updatechannel_contenttype.rbi b/lib/moderation_api/models/operations/updatechannel_contenttype.rbi new file mode 100644 index 00000000..b7fb95a8 --- /dev/null +++ b/lib/moderation_api/models/operations/updatechannel_contenttype.rbi @@ -0,0 +1,9 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::UpdateChannelContentType + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::UpdateChannelContentType +end diff --git a/lib/moderation_api/models/operations/updatechannel_request.rb b/lib/moderation_api/models/operations/updatechannel_request.rb new file mode 100644 index 00000000..3c1ee9f2 --- /dev/null +++ b/lib/moderation_api/models/operations/updatechannel_request.rb @@ -0,0 +1,35 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class UpdateChannelRequest + extend T::Sig + include Crystalline::MetadataFields + + # The ID of the channel to update. + field :id, ::String, {'path_param': {'field_name': "id", 'style': "simple", 'explode': false}} + + field :body, Models::Operations::UpdateChannelRequestBody, {'request': {'media_type': "application/json"}} + + sig { params(id: ::String, body: Models::Operations::UpdateChannelRequestBody).void } + def initialize(id:, body:) + @id = id + @body = body + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @id == other.id + return false unless @body == other.body + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/updatechannel_request.rbi b/lib/moderation_api/models/operations/updatechannel_request.rbi new file mode 100644 index 00000000..f0acc25d --- /dev/null +++ b/lib/moderation_api/models/operations/updatechannel_request.rbi @@ -0,0 +1,20 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::UpdateChannelRequest + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::UpdateChannelRequest + def id + end + + def id=(str_) + end + + def body + end + + def body=(str_) + end +end diff --git a/lib/moderation_api/models/operations/updatechannel_requestbody.rb b/lib/moderation_api/models/operations/updatechannel_requestbody.rb new file mode 100644 index 00000000..090c21d6 --- /dev/null +++ b/lib/moderation_api/models/operations/updatechannel_requestbody.rb @@ -0,0 +1,207 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class UpdateChannelRequestBody + extend T::Sig + include Crystalline::MetadataFields + + # The channel's name. + field( + :name, + Crystalline::Nilable.new(::String), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("name")}} + ) + # The key you pass as `channel` when you moderate content. Changing it breaks integrations that send the old key. + field( + :key, + Crystalline::Nilable.new(::String), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("key")}} + ) + # The kind of content the channel moderates. + field( + :content_type, + Crystalline::Nilable.new(Models::Operations::UpdateChannelContentType), + { + 'format_json': { + 'letter_case': ::ModerationApi::Utils.field_name("contentType"), + 'decoder': ::ModerationApi::Utils.enum_from_string(Models::Operations::UpdateChannelContentType, true) + } + } + ) + # `ACTIVE` flags content. `DRY_RUN` evaluates content without flagging it. + field( + :flagging_mode, + Crystalline::Nilable.new(Models::Operations::FlaggingMode), + { + 'format_json': { + 'letter_case': ::ModerationApi::Utils.field_name("flaggingMode"), + 'decoder': ::ModerationApi::Utils.enum_from_string(Models::Operations::FlaggingMode, true) + } + } + ) + # Whether earlier messages in the conversation are read when moderating a message. + field( + :context_enabled, + Crystalline::Nilable.new(Crystalline::Boolean.new), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("contextEnabled")}} + ) + # Whether images are moderated. + field( + :enable_image_moderation, + Crystalline::Nilable.new(Crystalline::Boolean.new), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("enableImageModeration")}} + ) + # Whether videos are moderated. + field( + :enable_video_moderation, + Crystalline::Nilable.new(Crystalline::Boolean.new), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("enableVideoModeration")}} + ) + # Whether audio is moderated. + field( + :enable_audio_moderation, + Crystalline::Nilable.new(Crystalline::Boolean.new), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("enableAudioModeration")}} + ) + # Whether real-time voice streams are moderated. + field( + :enable_voice_moderation, + Crystalline::Nilable.new(Crystalline::Boolean.new), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("enableVoiceModeration")}} + ) + # Whether audio and video transcripts are returned in responses. + field( + :include_transcript_in_response, + Crystalline::Nilable.new(Crystalline::Boolean.new), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("includeTranscriptInResponse")}} + ) + # Trade-off between transcription speed and accuracy. + field( + :transcription_quality, + Crystalline::Nilable.new(Models::Operations::TranscriptionQuality), + { + 'format_json': { + 'letter_case': ::ModerationApi::Utils.field_name("transcriptionQuality"), + 'decoder': ::ModerationApi::Utils.enum_from_string(Models::Operations::TranscriptionQuality, true) + } + } + ) + # Whether look-alike Unicode characters are normalized before moderation. + field( + :unicode_spoof_detection_enabled, + Crystalline::Nilable.new(Crystalline::Boolean.new), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("unicodeSpoofDetectionEnabled")}} + ) + # Seconds between frames captured from a video. + field( + :frame_capture_interval, + Crystalline::Nilable.new(::Float), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("frameCaptureInterval")}} + ) + # The most frames moderated per video. + field( + :max_frames_per_video, + Crystalline::Nilable.new(::Integer), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("maxFramesPerVideo")}} + ) + # Whether frames are spread evenly across the whole video. + field( + :spread_frames, + Crystalline::Nilable.new(Crystalline::Boolean.new), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("spreadFrames")}} + ) + # The channel's description. + field( + :description, + Crystalline::Nilable.new(::String), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("description")}} + ) + + sig { + params( + name: T.nilable(::String), + key: T.nilable(::String), + content_type: T.nilable(Models::Operations::UpdateChannelContentType), + flagging_mode: T.nilable(Models::Operations::FlaggingMode), + context_enabled: T.nilable(T::Boolean), + enable_image_moderation: T.nilable(T::Boolean), + enable_video_moderation: T.nilable(T::Boolean), + enable_audio_moderation: T.nilable(T::Boolean), + enable_voice_moderation: T.nilable(T::Boolean), + include_transcript_in_response: T.nilable(T::Boolean), + transcription_quality: T.nilable(Models::Operations::TranscriptionQuality), + unicode_spoof_detection_enabled: T.nilable(T::Boolean), + frame_capture_interval: T.nilable(::Float), + max_frames_per_video: T.nilable(::Integer), + spread_frames: T.nilable(T::Boolean), + description: T.nilable(::String) + ) + .void + } + def initialize( + name: nil, + key: nil, + content_type: nil, + flagging_mode: nil, + context_enabled: nil, + enable_image_moderation: nil, + enable_video_moderation: nil, + enable_audio_moderation: nil, + enable_voice_moderation: nil, + include_transcript_in_response: nil, + transcription_quality: nil, + unicode_spoof_detection_enabled: nil, + frame_capture_interval: nil, + max_frames_per_video: nil, + spread_frames: nil, + description: nil + ) + @name = name + @key = key + @content_type = content_type + @flagging_mode = flagging_mode + @context_enabled = context_enabled + @enable_image_moderation = enable_image_moderation + @enable_video_moderation = enable_video_moderation + @enable_audio_moderation = enable_audio_moderation + @enable_voice_moderation = enable_voice_moderation + @include_transcript_in_response = include_transcript_in_response + @transcription_quality = transcription_quality + @unicode_spoof_detection_enabled = unicode_spoof_detection_enabled + @frame_capture_interval = frame_capture_interval + @max_frames_per_video = max_frames_per_video + @spread_frames = spread_frames + @description = description + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @name == other.name + return false unless @key == other.key + return false unless @content_type == other.content_type + return false unless @flagging_mode == other.flagging_mode + return false unless @context_enabled == other.context_enabled + return false unless @enable_image_moderation == other.enable_image_moderation + return false unless @enable_video_moderation == other.enable_video_moderation + return false unless @enable_audio_moderation == other.enable_audio_moderation + return false unless @enable_voice_moderation == other.enable_voice_moderation + return false unless @include_transcript_in_response == other.include_transcript_in_response + return false unless @transcription_quality == other.transcription_quality + return false unless @unicode_spoof_detection_enabled == other.unicode_spoof_detection_enabled + return false unless @frame_capture_interval == other.frame_capture_interval + return false unless @max_frames_per_video == other.max_frames_per_video + return false unless @spread_frames == other.spread_frames + return false unless @description == other.description + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/updatechannel_requestbody.rbi b/lib/moderation_api/models/operations/updatechannel_requestbody.rbi new file mode 100644 index 00000000..07a6cdcd --- /dev/null +++ b/lib/moderation_api/models/operations/updatechannel_requestbody.rbi @@ -0,0 +1,104 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::UpdateChannelRequestBody + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::UpdateChannelRequestBody + def name + end + + def name=(str_) + end + + def key + end + + def key=(str_) + end + + def content_type + end + + def content_type=(str_) + end + + def flagging_mode + end + + def flagging_mode=(str_) + end + + def context_enabled + end + + def context_enabled=(str_) + end + + def enable_image_moderation + end + + def enable_image_moderation=(str_) + end + + def enable_video_moderation + end + + def enable_video_moderation=(str_) + end + + def enable_audio_moderation + end + + def enable_audio_moderation=(str_) + end + + def enable_voice_moderation + end + + def enable_voice_moderation=(str_) + end + + def include_transcript_in_response + end + + def include_transcript_in_response=(str_) + end + + def transcription_quality + end + + def transcription_quality=(str_) + end + + def unicode_spoof_detection_enabled + end + + def unicode_spoof_detection_enabled=(str_) + end + + def frame_capture_interval + end + + def frame_capture_interval=(str_) + end + + def max_frames_per_video + end + + def max_frames_per_video=(str_) + end + + def spread_frames + end + + def spread_frames=(str_) + end + + def description + end + + def description=(str_) + end +end diff --git a/lib/moderation_api/models/operations/updatechannel_response.rb b/lib/moderation_api/models/operations/updatechannel_response.rb new file mode 100644 index 00000000..0d8f148d --- /dev/null +++ b/lib/moderation_api/models/operations/updatechannel_response.rb @@ -0,0 +1,51 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class UpdateChannelResponse + extend T::Sig + include Crystalline::MetadataFields + + # HTTP response content type for this operation + field :content_type, ::String + # HTTP response status code for this operation + field :status_code, ::Integer + # Raw HTTP response; suitable for custom response parsing + field :raw_response, ::Faraday::Response + # Channel updated successfully + field :channel, Crystalline::Nilable.new(Models::Components::Channel) + + sig { + params( + content_type: ::String, + status_code: ::Integer, + raw_response: ::Faraday::Response, + channel: T.nilable(Models::Components::Channel) + ) + .void + } + def initialize(content_type:, status_code:, raw_response:, channel: nil) + @content_type = content_type + @status_code = status_code + @raw_response = raw_response + @channel = channel + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @content_type == other.content_type + return false unless @status_code == other.status_code + return false unless @raw_response == other.raw_response + return false unless @channel == other.channel + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/updatechannel_response.rbi b/lib/moderation_api/models/operations/updatechannel_response.rbi new file mode 100644 index 00000000..c14fbd93 --- /dev/null +++ b/lib/moderation_api/models/operations/updatechannel_response.rbi @@ -0,0 +1,32 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::UpdateChannelResponse + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::UpdateChannelResponse + def content_type + end + + def content_type=(str_) + end + + def status_code + end + + def status_code=(str_) + end + + def raw_response + end + + def raw_response=(str_) + end + + def channel + end + + def channel=(str_) + end +end diff --git a/lib/moderation_api/models/operations/updateproject_request.rb b/lib/moderation_api/models/operations/updateproject_request.rb new file mode 100644 index 00000000..09074184 --- /dev/null +++ b/lib/moderation_api/models/operations/updateproject_request.rb @@ -0,0 +1,35 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class UpdateProjectRequest + extend T::Sig + include Crystalline::MetadataFields + + # The ID of the project to update. + field :id, ::String, {'path_param': {'field_name': "id", 'style': "simple", 'explode': false}} + + field :body, Models::Operations::UpdateProjectRequestBody, {'request': {'media_type': "application/json"}} + + sig { params(id: ::String, body: Models::Operations::UpdateProjectRequestBody).void } + def initialize(id:, body:) + @id = id + @body = body + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @id == other.id + return false unless @body == other.body + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/updateproject_request.rbi b/lib/moderation_api/models/operations/updateproject_request.rbi new file mode 100644 index 00000000..285dd571 --- /dev/null +++ b/lib/moderation_api/models/operations/updateproject_request.rbi @@ -0,0 +1,20 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::UpdateProjectRequest + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::UpdateProjectRequest + def id + end + + def id=(str_) + end + + def body + end + + def body=(str_) + end +end diff --git a/lib/moderation_api/models/operations/updateproject_requestbody.rb b/lib/moderation_api/models/operations/updateproject_requestbody.rb new file mode 100644 index 00000000..55c7dd43 --- /dev/null +++ b/lib/moderation_api/models/operations/updateproject_requestbody.rb @@ -0,0 +1,107 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class UpdateProjectRequestBody + extend T::Sig + include Crystalline::MetadataFields + + # The project's name. + field( + :name, + Crystalline::Nilable.new(::String), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("name")}} + ) + # `ACTIVE` flags content. `DRY_RUN` evaluates without flagging. + field( + :global_flagging_mode, + Crystalline::Nilable.new(Models::Operations::GlobalFlaggingMode), + { + 'format_json': { + 'letter_case': ::ModerationApi::Utils.field_name("globalFlaggingMode"), + 'decoder': ::ModerationApi::Utils.enum_from_string(Models::Operations::GlobalFlaggingMode, true) + } + } + ) + # Whether moderated content is stored and shown in the dashboard. + field( + :enable_request_logging, + Crystalline::Nilable.new(Crystalline::Boolean.new), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("enableRequestLogging")}} + ) + # Whether review queue decisions are recorded in the casebook. + field( + :casebook_enabled, + Crystalline::Nilable.new(Crystalline::Boolean.new), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("casebookEnabled")}} + ) + # The project's description. + field( + :description, + Crystalline::Nilable.new(::String), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("description")}} + ) + # The website or app the project moderates content for. Setting it on a project without context writes one. + field( + :domain, + Crystalline::Nilable.new(::String), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("domain")}} + ) + # What the platform is and who uses it. + field( + :context, + Crystalline::Nilable.new(::String), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("context")}} + ) + + sig { + params( + name: T.nilable(::String), + global_flagging_mode: T.nilable(Models::Operations::GlobalFlaggingMode), + enable_request_logging: T.nilable(T::Boolean), + casebook_enabled: T.nilable(T::Boolean), + description: T.nilable(::String), + domain: T.nilable(::String), + context: T.nilable(::String) + ) + .void + } + def initialize( + name: nil, + global_flagging_mode: nil, + enable_request_logging: nil, + casebook_enabled: nil, + description: nil, + domain: nil, + context: nil + ) + @name = name + @global_flagging_mode = global_flagging_mode + @enable_request_logging = enable_request_logging + @casebook_enabled = casebook_enabled + @description = description + @domain = domain + @context = context + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @name == other.name + return false unless @global_flagging_mode == other.global_flagging_mode + return false unless @enable_request_logging == other.enable_request_logging + return false unless @casebook_enabled == other.casebook_enabled + return false unless @description == other.description + return false unless @domain == other.domain + return false unless @context == other.context + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/updateproject_requestbody.rbi b/lib/moderation_api/models/operations/updateproject_requestbody.rbi new file mode 100644 index 00000000..13007a59 --- /dev/null +++ b/lib/moderation_api/models/operations/updateproject_requestbody.rbi @@ -0,0 +1,50 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::UpdateProjectRequestBody + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::UpdateProjectRequestBody + def name + end + + def name=(str_) + end + + def global_flagging_mode + end + + def global_flagging_mode=(str_) + end + + def enable_request_logging + end + + def enable_request_logging=(str_) + end + + def casebook_enabled + end + + def casebook_enabled=(str_) + end + + def description + end + + def description=(str_) + end + + def domain + end + + def domain=(str_) + end + + def context + end + + def context=(str_) + end +end diff --git a/lib/moderation_api/models/operations/updateproject_response.rb b/lib/moderation_api/models/operations/updateproject_response.rb new file mode 100644 index 00000000..2150d85a --- /dev/null +++ b/lib/moderation_api/models/operations/updateproject_response.rb @@ -0,0 +1,51 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class UpdateProjectResponse + extend T::Sig + include Crystalline::MetadataFields + + # HTTP response content type for this operation + field :content_type, ::String + # HTTP response status code for this operation + field :status_code, ::Integer + # Raw HTTP response; suitable for custom response parsing + field :raw_response, ::Faraday::Response + # Project updated successfully + field :project, Crystalline::Nilable.new(Models::Components::Project) + + sig { + params( + content_type: ::String, + status_code: ::Integer, + raw_response: ::Faraday::Response, + project: T.nilable(Models::Components::Project) + ) + .void + } + def initialize(content_type:, status_code:, raw_response:, project: nil) + @content_type = content_type + @status_code = status_code + @raw_response = raw_response + @project = project + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @content_type == other.content_type + return false unless @status_code == other.status_code + return false unless @raw_response == other.raw_response + return false unless @project == other.project + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/updateproject_response.rbi b/lib/moderation_api/models/operations/updateproject_response.rbi new file mode 100644 index 00000000..d06c16f2 --- /dev/null +++ b/lib/moderation_api/models/operations/updateproject_response.rbi @@ -0,0 +1,32 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::UpdateProjectResponse + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::UpdateProjectResponse + def content_type + end + + def content_type=(str_) + end + + def status_code + end + + def status_code=(str_) + end + + def raw_response + end + + def raw_response=(str_) + end + + def project + end + + def project=(str_) + end +end diff --git a/lib/moderation_api/models/operations/updatewebhook_eventtype_request.rb b/lib/moderation_api/models/operations/updatewebhook_eventtype_request.rb new file mode 100644 index 00000000..df40c05d --- /dev/null +++ b/lib/moderation_api/models/operations/updatewebhook_eventtype_request.rb @@ -0,0 +1,27 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class UpdateWebhookEventTypeRequest < T::Enum + enums do + QUEUE_ITEM_NEW = new("QUEUE_ITEM_NEW") + QUEUE_ITEM_COMPLETED = new("QUEUE_ITEM_COMPLETED") + QUEUE_ITEM_ACTION = new("QUEUE_ITEM_ACTION") + QUEUE_ITEM_REJECTED = new("QUEUE_ITEM_REJECTED") + QUEUE_ITEM_ALLOWED = new("QUEUE_ITEM_ALLOWED") + AUTHOR_BLOCKED = new("AUTHOR_BLOCKED") + AUTHOR_UNBLOCKED = new("AUTHOR_UNBLOCKED") + AUTHOR_SUSPENDED = new("AUTHOR_SUSPENDED") + AUTHOR_UPDATED = new("AUTHOR_UPDATED") + AUTHOR_TRUST_LEVEL_CHANGED = new("AUTHOR_TRUST_LEVEL_CHANGED") + AUTHOR_ACTION = new("AUTHOR_ACTION") + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/updatewebhook_eventtype_request.rbi b/lib/moderation_api/models/operations/updatewebhook_eventtype_request.rbi new file mode 100644 index 00000000..1d9919f7 --- /dev/null +++ b/lib/moderation_api/models/operations/updatewebhook_eventtype_request.rbi @@ -0,0 +1,9 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::UpdateWebhookEventTypeRequest + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::UpdateWebhookEventTypeRequest +end diff --git a/lib/moderation_api/models/operations/updatewebhook_eventtype_response.rb b/lib/moderation_api/models/operations/updatewebhook_eventtype_response.rb new file mode 100644 index 00000000..802e692a --- /dev/null +++ b/lib/moderation_api/models/operations/updatewebhook_eventtype_response.rb @@ -0,0 +1,30 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class UpdateWebhookEventTypeResponse + include ::Crystalline::Enum + enums do + QUEUE_ITEM_NEW = new("QUEUE_ITEM_NEW") + QUEUE_ITEM_COMPLETED = new("QUEUE_ITEM_COMPLETED") + QUEUE_ITEM_ACTION = new("QUEUE_ITEM_ACTION") + QUEUE_ITEM_REJECTED = new("QUEUE_ITEM_REJECTED") + QUEUE_ITEM_ALLOWED = new("QUEUE_ITEM_ALLOWED") + AUTHOR_BLOCKED = new("AUTHOR_BLOCKED") + AUTHOR_UNBLOCKED = new("AUTHOR_UNBLOCKED") + AUTHOR_SUSPENDED = new("AUTHOR_SUSPENDED") + AUTHOR_UPDATED = new("AUTHOR_UPDATED") + AUTHOR_TRUST_LEVEL_CHANGED = new("AUTHOR_TRUST_LEVEL_CHANGED") + AUTHOR_ACTION = new("AUTHOR_ACTION") + end + + open! + end + end + end +end diff --git a/lib/moderation_api/models/operations/updatewebhook_eventtype_response.rbi b/lib/moderation_api/models/operations/updatewebhook_eventtype_response.rbi new file mode 100644 index 00000000..6be928c4 --- /dev/null +++ b/lib/moderation_api/models/operations/updatewebhook_eventtype_response.rbi @@ -0,0 +1,9 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::UpdateWebhookEventTypeResponse + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::UpdateWebhookEventTypeResponse +end diff --git a/lib/moderation_api/models/operations/updatewebhook_payloadversion.rb b/lib/moderation_api/models/operations/updatewebhook_payloadversion.rb new file mode 100644 index 00000000..eab7a8c7 --- /dev/null +++ b/lib/moderation_api/models/operations/updatewebhook_payloadversion.rb @@ -0,0 +1,21 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + # UpdateWebhookPayloadVersion - Payload envelope version. V2 is the Stripe-style envelope; V1 is the legacy flat shape and is read-only via this API. + class UpdateWebhookPayloadVersion + include ::Crystalline::Enum + enums do + V1 = new("V1") + V2 = new("V2") + end + + open! + end + end + end +end diff --git a/lib/moderation_api/models/operations/updatewebhook_payloadversion.rbi b/lib/moderation_api/models/operations/updatewebhook_payloadversion.rbi new file mode 100644 index 00000000..32f8ca8c --- /dev/null +++ b/lib/moderation_api/models/operations/updatewebhook_payloadversion.rbi @@ -0,0 +1,9 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::UpdateWebhookPayloadVersion + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::UpdateWebhookPayloadVersion +end diff --git a/lib/moderation_api/models/operations/updatewebhook_request.rb b/lib/moderation_api/models/operations/updatewebhook_request.rb new file mode 100644 index 00000000..b201f9a4 --- /dev/null +++ b/lib/moderation_api/models/operations/updatewebhook_request.rb @@ -0,0 +1,35 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class UpdateWebhookRequest + extend T::Sig + include Crystalline::MetadataFields + + # The ID of the webhook to update. + field :id, ::String, {'path_param': {'field_name': "id", 'style': "simple", 'explode': false}} + + field :body, Models::Operations::UpdateWebhookRequestBody, {'request': {'media_type': "application/json"}} + + sig { params(id: ::String, body: Models::Operations::UpdateWebhookRequestBody).void } + def initialize(id:, body:) + @id = id + @body = body + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @id == other.id + return false unless @body == other.body + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/updatewebhook_request.rbi b/lib/moderation_api/models/operations/updatewebhook_request.rbi new file mode 100644 index 00000000..8827d1b0 --- /dev/null +++ b/lib/moderation_api/models/operations/updatewebhook_request.rbi @@ -0,0 +1,20 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::UpdateWebhookRequest + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::UpdateWebhookRequest + def id + end + + def id=(str_) + end + + def body + end + + def body=(str_) + end +end diff --git a/lib/moderation_api/models/operations/updatewebhook_requestbody.rb b/lib/moderation_api/models/operations/updatewebhook_requestbody.rb new file mode 100644 index 00000000..93c57e01 --- /dev/null +++ b/lib/moderation_api/models/operations/updatewebhook_requestbody.rb @@ -0,0 +1,67 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class UpdateWebhookRequestBody + extend T::Sig + include Crystalline::MetadataFields + + # The webhook's name, used to identify it in the dashboard + field( + :name, + Crystalline::Nilable.new(::String), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("name")}} + ) + # The webhook's URL. We'll call this URL when an event occurs. + field( + :url, + Crystalline::Nilable.new(::String), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("url")}} + ) + # Event types this webhook subscribes to. One webhook URL receives all events you list here. + field( + :event_types, + Crystalline::Nilable.new(Crystalline::Array.new(Models::Operations::UpdateWebhookEventTypeRequest)), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("eventTypes")}} + ) + # The webhook's description + field( + :description, + Crystalline::Nilable.new(::String), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("description")}} + ) + + sig { + params( + name: T.nilable(::String), + url: T.nilable(::String), + event_types: T.nilable(T::Array[Models::Operations::UpdateWebhookEventTypeRequest]), + description: T.nilable(::String) + ) + .void + } + def initialize(name: nil, url: nil, event_types: nil, description: nil) + @name = name + @url = url + @event_types = event_types + @description = description + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @name == other.name + return false unless @url == other.url + return false unless @event_types == other.event_types + return false unless @description == other.description + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/updatewebhook_requestbody.rbi b/lib/moderation_api/models/operations/updatewebhook_requestbody.rbi new file mode 100644 index 00000000..8f2e332c --- /dev/null +++ b/lib/moderation_api/models/operations/updatewebhook_requestbody.rbi @@ -0,0 +1,32 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::UpdateWebhookRequestBody + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::UpdateWebhookRequestBody + def name + end + + def name=(str_) + end + + def url + end + + def url=(str_) + end + + def event_types + end + + def event_types=(str_) + end + + def description + end + + def description=(str_) + end +end diff --git a/lib/moderation_api/models/operations/updatewebhook_response.rb b/lib/moderation_api/models/operations/updatewebhook_response.rb new file mode 100644 index 00000000..7f13ec7c --- /dev/null +++ b/lib/moderation_api/models/operations/updatewebhook_response.rb @@ -0,0 +1,51 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class UpdateWebhookResponse + extend T::Sig + include Crystalline::MetadataFields + + # HTTP response content type for this operation + field :content_type, ::String + # HTTP response status code for this operation + field :status_code, ::Integer + # Raw HTTP response; suitable for custom response parsing + field :raw_response, ::Faraday::Response + # Webhook updated successfully + field :object, Crystalline::Nilable.new(Models::Operations::UpdateWebhookResponseBody) + + sig { + params( + content_type: ::String, + status_code: ::Integer, + raw_response: ::Faraday::Response, + object: T.nilable(Models::Operations::UpdateWebhookResponseBody) + ) + .void + } + def initialize(content_type:, status_code:, raw_response:, object: nil) + @content_type = content_type + @status_code = status_code + @raw_response = raw_response + @object = object + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @content_type == other.content_type + return false unless @status_code == other.status_code + return false unless @raw_response == other.raw_response + return false unless @object == other.object + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/updatewebhook_response.rbi b/lib/moderation_api/models/operations/updatewebhook_response.rbi new file mode 100644 index 00000000..88114fcc --- /dev/null +++ b/lib/moderation_api/models/operations/updatewebhook_response.rbi @@ -0,0 +1,32 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::UpdateWebhookResponse + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::UpdateWebhookResponse + def content_type + end + + def content_type=(str_) + end + + def status_code + end + + def status_code=(str_) + end + + def raw_response + end + + def raw_response=(str_) + end + + def object + end + + def object=(str_) + end +end diff --git a/lib/moderation_api/models/operations/updatewebhook_responsebody.rb b/lib/moderation_api/models/operations/updatewebhook_responsebody.rb new file mode 100644 index 00000000..2d5096a6 --- /dev/null +++ b/lib/moderation_api/models/operations/updatewebhook_responsebody.rb @@ -0,0 +1,95 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + # Webhook updated successfully + class UpdateWebhookResponseBody + extend T::Sig + include Crystalline::MetadataFields + + # The ID of the webhook. + field :id, ::String, {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("id"), required: true}} + # The webhook's name. + field( + :name, + ::String, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("name"), required: true}} + ) + # The URL we call when a subscribed event occurs. + field :url, ::String, {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("url"), required: true}} + # Event types this webhook subscribes to. Empty for legacy v1 webhooks, which subscribe via their single deprecated `type` instead. + field( + :event_types, + Crystalline::Array.new(Models::Operations::UpdateWebhookEventTypeResponse), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("eventTypes"), required: true}} + ) + # Payload envelope version. V2 is the Stripe-style envelope; V1 is the legacy flat shape and is read-only via this API. + field( + :payload_version, + Models::Operations::UpdateWebhookPayloadVersion, + { + 'format_json': { + 'letter_case': ::ModerationApi::Utils.field_name("payloadVersion"), + required: true, + 'decoder': ::ModerationApi::Utils.open_enum_from_string( + Models::Operations::UpdateWebhookPayloadVersion, + false + ) + } + } + ) + # The date the webhook was created. + field( + :created_at, + ::String, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("createdAt"), required: true}} + ) + # The webhook's description. + field( + :description, + Crystalline::Nilable.new(::String), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("description")}} + ) + + sig { + params( + id: ::String, + name: ::String, + url: ::String, + event_types: T::Array[Models::Operations::UpdateWebhookEventTypeResponse], + payload_version: Models::Operations::UpdateWebhookPayloadVersion, + created_at: ::String, + description: T.nilable(::String) + ) + .void + } + def initialize(id:, name:, url:, event_types:, payload_version:, created_at:, description: nil) + @id = id + @name = name + @url = url + @event_types = event_types + @payload_version = payload_version + @created_at = created_at + @description = description + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @id == other.id + return false unless @name == other.name + return false unless @url == other.url + return false unless @event_types == other.event_types + return false unless @payload_version == other.payload_version + return false unless @created_at == other.created_at + return false unless @description == other.description + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/updatewebhook_responsebody.rbi b/lib/moderation_api/models/operations/updatewebhook_responsebody.rbi new file mode 100644 index 00000000..75bbda49 --- /dev/null +++ b/lib/moderation_api/models/operations/updatewebhook_responsebody.rbi @@ -0,0 +1,50 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::UpdateWebhookResponseBody + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::UpdateWebhookResponseBody + def id + end + + def id=(str_) + end + + def name + end + + def name=(str_) + end + + def url + end + + def url=(str_) + end + + def event_types + end + + def event_types=(str_) + end + + def payload_version + end + + def payload_version=(str_) + end + + def created_at + end + + def created_at=(str_) + end + + def description + end + + def description=(str_) + end +end diff --git a/lib/moderation_api/models/operations/updatewordlist_request.rb b/lib/moderation_api/models/operations/updatewordlist_request.rb new file mode 100644 index 00000000..c29f57da --- /dev/null +++ b/lib/moderation_api/models/operations/updatewordlist_request.rb @@ -0,0 +1,35 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class UpdateWordlistRequest + extend T::Sig + include Crystalline::MetadataFields + + # ID of the wordlist to update + field :id, ::String, {'path_param': {'field_name': "id", 'style': "simple", 'explode': false}} + + field :body, Models::Operations::UpdateWordlistRequestBody, {'request': {'media_type': "application/json"}} + + sig { params(id: ::String, body: Models::Operations::UpdateWordlistRequestBody).void } + def initialize(id:, body:) + @id = id + @body = body + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @id == other.id + return false unless @body == other.body + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/updatewordlist_request.rbi b/lib/moderation_api/models/operations/updatewordlist_request.rbi new file mode 100644 index 00000000..17d85741 --- /dev/null +++ b/lib/moderation_api/models/operations/updatewordlist_request.rbi @@ -0,0 +1,20 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::UpdateWordlistRequest + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::UpdateWordlistRequest + def id + end + + def id=(str_) + end + + def body + end + + def body=(str_) + end +end diff --git a/lib/moderation_api/models/operations/updatewordlist_requestbody.rb b/lib/moderation_api/models/operations/updatewordlist_requestbody.rb new file mode 100644 index 00000000..665e148d --- /dev/null +++ b/lib/moderation_api/models/operations/updatewordlist_requestbody.rb @@ -0,0 +1,76 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class UpdateWordlistRequestBody + extend T::Sig + include Crystalline::MetadataFields + + # New name for the wordlist + field( + :name, + Crystalline::Nilable.new(::String), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("name")}} + ) + # New key for the wordlist + field( + :key, + Crystalline::Nilable.new(::String), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("key")}} + ) + # New description for the wordlist + field( + :description, + Crystalline::Nilable.new(::String), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("description")}} + ) + # New words for the wordlist. Replace the existing words with these new ones. Duplicate words will be ignored. + field( + :words, + Crystalline::Nilable.new(Crystalline::Array.new(::String)), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("words")}} + ) + # Deprecated. Now using threshold in project settings. + field( + :strict, + Crystalline::Nilable.new(Crystalline::Boolean.new), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("strict")}} + ) + + sig { + params( + name: T.nilable(::String), + key: T.nilable(::String), + description: T.nilable(::String), + words: T.nilable(T::Array[::String]), + strict: T.nilable(T::Boolean) + ) + .void + } + def initialize(name: nil, key: nil, description: nil, words: nil, strict: nil) + @name = name + @key = key + @description = description + @words = words + @strict = strict + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @name == other.name + return false unless @key == other.key + return false unless @description == other.description + return false unless @words == other.words + return false unless @strict == other.strict + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/updatewordlist_requestbody.rbi b/lib/moderation_api/models/operations/updatewordlist_requestbody.rbi new file mode 100644 index 00000000..1c9ddcd2 --- /dev/null +++ b/lib/moderation_api/models/operations/updatewordlist_requestbody.rbi @@ -0,0 +1,38 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::UpdateWordlistRequestBody + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::UpdateWordlistRequestBody + def name + end + + def name=(str_) + end + + def key + end + + def key=(str_) + end + + def description + end + + def description=(str_) + end + + def words + end + + def words=(str_) + end + + def strict + end + + def strict=(str_) + end +end diff --git a/lib/moderation_api/models/operations/updatewordlist_response.rb b/lib/moderation_api/models/operations/updatewordlist_response.rb new file mode 100644 index 00000000..03f840af --- /dev/null +++ b/lib/moderation_api/models/operations/updatewordlist_response.rb @@ -0,0 +1,51 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class UpdateWordlistResponse + extend T::Sig + include Crystalline::MetadataFields + + # HTTP response content type for this operation + field :content_type, ::String + # HTTP response status code for this operation + field :status_code, ::Integer + # Raw HTTP response; suitable for custom response parsing + field :raw_response, ::Faraday::Response + # Wordlist updated successfully + field :object, Crystalline::Nilable.new(Models::Operations::UpdateWordlistResponseBody) + + sig { + params( + content_type: ::String, + status_code: ::Integer, + raw_response: ::Faraday::Response, + object: T.nilable(Models::Operations::UpdateWordlistResponseBody) + ) + .void + } + def initialize(content_type:, status_code:, raw_response:, object: nil) + @content_type = content_type + @status_code = status_code + @raw_response = raw_response + @object = object + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @content_type == other.content_type + return false unless @status_code == other.status_code + return false unless @raw_response == other.raw_response + return false unless @object == other.object + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/updatewordlist_response.rbi b/lib/moderation_api/models/operations/updatewordlist_response.rbi new file mode 100644 index 00000000..d79ffc5e --- /dev/null +++ b/lib/moderation_api/models/operations/updatewordlist_response.rbi @@ -0,0 +1,32 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::UpdateWordlistResponse + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::UpdateWordlistResponse + def content_type + end + + def content_type=(str_) + end + + def status_code + end + + def status_code=(str_) + end + + def raw_response + end + + def raw_response=(str_) + end + + def object + end + + def object=(str_) + end +end diff --git a/lib/moderation_api/models/operations/updatewordlist_responsebody.rb b/lib/moderation_api/models/operations/updatewordlist_responsebody.rb new file mode 100644 index 00000000..799e303a --- /dev/null +++ b/lib/moderation_api/models/operations/updatewordlist_responsebody.rb @@ -0,0 +1,90 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + # Wordlist updated successfully + class UpdateWordlistResponseBody + extend T::Sig + include Crystalline::MetadataFields + + # ID of the wordlist + field :id, ::String, {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("id"), required: true}} + # Words in the wordlist + field( + :words, + Crystalline::Array.new(::String), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("words"), required: true}} + ) + # Creation date of the wordlist + field( + :created_at, + ::String, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("createdAt"), required: true}} + ) + # ID of the organization + field( + :organization_id, + ::String, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("organizationId"), required: true}} + ) + # Strict mode + field( + :strict, + Crystalline::Boolean.new, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("strict"), required: true}} + ) + + field( + :name, + Crystalline::Nilable.new(::String), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("name"), required: true}} + ) + + field( + :user_id, + Crystalline::Nilable.new(::String), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("userId"), required: true}} + ) + + sig { + params( + id: ::String, + words: T::Array[::String], + created_at: ::String, + organization_id: ::String, + strict: T::Boolean, + name: T.nilable(::String), + user_id: T.nilable(::String) + ) + .void + } + def initialize(id:, words:, created_at:, organization_id:, strict:, name: nil, user_id: nil) + @id = id + @words = words + @created_at = created_at + @organization_id = organization_id + @strict = strict + @name = name + @user_id = user_id + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @id == other.id + return false unless @words == other.words + return false unless @created_at == other.created_at + return false unless @organization_id == other.organization_id + return false unless @strict == other.strict + return false unless @name == other.name + return false unless @user_id == other.user_id + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/updatewordlist_responsebody.rbi b/lib/moderation_api/models/operations/updatewordlist_responsebody.rbi new file mode 100644 index 00000000..b456edec --- /dev/null +++ b/lib/moderation_api/models/operations/updatewordlist_responsebody.rbi @@ -0,0 +1,50 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::UpdateWordlistResponseBody + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::UpdateWordlistResponseBody + def id + end + + def id=(str_) + end + + def words + end + + def words=(str_) + end + + def created_at + end + + def created_at=(str_) + end + + def organization_id + end + + def organization_id=(str_) + end + + def strict + end + + def strict=(str_) + end + + def name + end + + def name=(str_) + end + + def user_id + end + + def user_id=(str_) + end +end diff --git a/lib/moderation_api/models/operations/url_masking.rb b/lib/moderation_api/models/operations/url_masking.rb new file mode 100644 index 00000000..928f8f1e --- /dev/null +++ b/lib/moderation_api/models/operations/url_masking.rb @@ -0,0 +1,42 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class URLMasking + extend T::Sig + include Crystalline::MetadataFields + + field( + :entities, + Crystalline::Hash.new(Symbol, Models::Operations::Entities2), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("entities"), required: true}} + ) + + field :id, ::String, {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("id"), required: true}} + + sig { params(entities: T::Hash[Symbol, Models::Operations::Entities2], id: ::String).void } + def initialize(entities:, id: "url") + @entities = entities + unless id == "url" + raise ArgumentError, "Invalid value for id" + end + + @id = "url" + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @entities == other.entities + return false unless @id == other.id + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/url_masking.rbi b/lib/moderation_api/models/operations/url_masking.rbi new file mode 100644 index 00000000..f3613381 --- /dev/null +++ b/lib/moderation_api/models/operations/url_masking.rbi @@ -0,0 +1,20 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::URLMasking + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::URLMasking + def entities + end + + def entities=(str_) + end + + def id + end + + def id=(str_) + end +end diff --git a/lib/moderation_api/models/operations/url_risk.rb b/lib/moderation_api/models/operations/url_risk.rb new file mode 100644 index 00000000..d9c433b6 --- /dev/null +++ b/lib/moderation_api/models/operations/url_risk.rb @@ -0,0 +1,91 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class URLRisk + extend T::Sig + include Crystalline::MetadataFields + + field( + :flag, + Crystalline::Boolean.new, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("flag"), required: true}} + ) + + field( + :threshold, + Crystalline::Nilable.new(::Float), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("threshold")}} + ) + + field :id, ::String, {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("id"), required: true}} + # IDs of wordlists whose entries are treated as allowed URL domains. Matches short-circuit the risk model and are never flagged. + field( + :allowlist_wordlist_ids, + Crystalline::Nilable.new(Crystalline::Array.new(::String)), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("allowlistWordlistIds")}} + ) + # IDs of wordlists whose entries are treated as blocked URL domains. Matches short-circuit the risk model and are always flagged. Blocklists take precedence over allowlists. + field( + :blocklist_wordlist_ids, + Crystalline::Nilable.new(Crystalline::Array.new(::String)), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("blocklistWordlistIds")}} + ) + # When true, any URL detected as a free link shortener (bit.ly, t.co, tinyurl, etc.) is always flagged regardless of risk score. Allowlist matches still win. + field( + :flag_link_shorteners, + Crystalline::Nilable.new(Crystalline::Boolean.new), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("flagLinkShorteners")}} + ) + + sig { + params( + flag: T::Boolean, + threshold: T.nilable(::Float), + id: ::String, + allowlist_wordlist_ids: T.nilable(T::Array[::String]), + blocklist_wordlist_ids: T.nilable(T::Array[::String]), + flag_link_shorteners: T.nilable(T::Boolean) + ) + .void + } + def initialize( + flag:, + threshold: nil, + id: "url_risk", + allowlist_wordlist_ids: nil, + blocklist_wordlist_ids: nil, + flag_link_shorteners: nil + ) + @flag = flag + @threshold = threshold + unless id == "url_risk" + raise ArgumentError, "Invalid value for id" + end + + @id = "url_risk" + @allowlist_wordlist_ids = allowlist_wordlist_ids + @blocklist_wordlist_ids = blocklist_wordlist_ids + @flag_link_shorteners = flag_link_shorteners + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @flag == other.flag + return false unless @threshold == other.threshold + return false unless @id == other.id + return false unless @allowlist_wordlist_ids == other.allowlist_wordlist_ids + return false unless @blocklist_wordlist_ids == other.blocklist_wordlist_ids + return false unless @flag_link_shorteners == other.flag_link_shorteners + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/url_risk.rbi b/lib/moderation_api/models/operations/url_risk.rbi new file mode 100644 index 00000000..c7ba1b39 --- /dev/null +++ b/lib/moderation_api/models/operations/url_risk.rbi @@ -0,0 +1,44 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::URLRisk + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::URLRisk + def flag + end + + def flag=(str_) + end + + def threshold + end + + def threshold=(str_) + end + + def id + end + + def id=(str_) + end + + def allowlist_wordlist_ids + end + + def allowlist_wordlist_ids=(str_) + end + + def blocklist_wordlist_ids + end + + def blocklist_wordlist_ids=(str_) + end + + def flag_link_shorteners + end + + def flag_link_shorteners=(str_) + end +end diff --git a/lib/moderation_api/models/operations/value.rb b/lib/moderation_api/models/operations/value.rb new file mode 100644 index 00000000..007de3f4 --- /dev/null +++ b/lib/moderation_api/models/operations/value.rb @@ -0,0 +1,22 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class Value + include ::Crystalline::Enum + enums do + POSITIVE = new("positive") + NEUTRAL = new("neutral") + NEGATIVE = new("negative") + end + + open! + end + end + end +end diff --git a/lib/moderation_api/models/operations/value.rbi b/lib/moderation_api/models/operations/value.rbi new file mode 100644 index 00000000..8a3eb34e --- /dev/null +++ b/lib/moderation_api/models/operations/value.rbi @@ -0,0 +1,9 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::Value + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::Value +end diff --git a/lib/moderation_api/models/operations/verdict.rb b/lib/moderation_api/models/operations/verdict.rb new file mode 100644 index 00000000..a5392374 --- /dev/null +++ b/lib/moderation_api/models/operations/verdict.rb @@ -0,0 +1,21 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + # Verdict - The ruling your past decisions point to for this content. + class Verdict + include ::Crystalline::Enum + enums do + ALLOW = new("allow") + REJECT = new("reject") + end + + open! + end + end + end +end diff --git a/lib/moderation_api/models/operations/verdict.rbi b/lib/moderation_api/models/operations/verdict.rbi new file mode 100644 index 00000000..dff26521 --- /dev/null +++ b/lib/moderation_api/models/operations/verdict.rbi @@ -0,0 +1,9 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::Verdict + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::Verdict +end diff --git a/lib/moderation_api/models/operations/video_request.rb b/lib/moderation_api/models/operations/video_request.rb new file mode 100644 index 00000000..dde126b8 --- /dev/null +++ b/lib/moderation_api/models/operations/video_request.rb @@ -0,0 +1,43 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + # Video + class VideoRequest + extend T::Sig + include Crystalline::MetadataFields + + # A public URL of the video content + field :url, ::String, {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("url"), required: true}} + + field( + :type, + ::String, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("type"), required: true}} + ) + + sig { params(url: ::String, type: ::String).void } + def initialize(url:, type: "video") + @url = url + unless type == "video" + raise ArgumentError, "Invalid value for type" + end + + @type = "video" + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @url == other.url + return false unless @type == other.type + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/video_request.rbi b/lib/moderation_api/models/operations/video_request.rbi new file mode 100644 index 00000000..d4e70bb6 --- /dev/null +++ b/lib/moderation_api/models/operations/video_request.rbi @@ -0,0 +1,20 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::VideoRequest + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::VideoRequest + def url + end + + def url=(str_) + end + + def type + end + + def type=(str_) + end +end diff --git a/lib/moderation_api/models/operations/video_response.rb b/lib/moderation_api/models/operations/video_response.rb new file mode 100644 index 00000000..da0e2bc3 --- /dev/null +++ b/lib/moderation_api/models/operations/video_response.rb @@ -0,0 +1,43 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + # Video + class VideoResponse + extend T::Sig + include Crystalline::MetadataFields + + # A public URL of the video content + field :url, ::String, {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("url"), required: true}} + + field( + :type, + ::String, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("type"), required: true}} + ) + + sig { params(url: ::String, type: ::String).void } + def initialize(url:, type: "video") + @url = url + unless type == "video" + raise ArgumentError, "Invalid value for type" + end + + @type = "video" + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @url == other.url + return false unless @type == other.type + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/video_response.rbi b/lib/moderation_api/models/operations/video_response.rbi new file mode 100644 index 00000000..60a4c22e --- /dev/null +++ b/lib/moderation_api/models/operations/video_response.rbi @@ -0,0 +1,20 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::VideoResponse + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::VideoResponse + def url + end + + def url=(str_) + end + + def type + end + + def type=(str_) + end +end diff --git a/lib/moderation_api/models/operations/violence.rb b/lib/moderation_api/models/operations/violence.rb new file mode 100644 index 00000000..a033abbc --- /dev/null +++ b/lib/moderation_api/models/operations/violence.rb @@ -0,0 +1,50 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class Violence + extend T::Sig + include Crystalline::MetadataFields + + field( + :flag, + Crystalline::Boolean.new, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("flag"), required: true}} + ) + + field( + :threshold, + Crystalline::Nilable.new(::Float), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("threshold")}} + ) + + field :id, ::String, {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("id"), required: true}} + + sig { params(flag: T::Boolean, threshold: T.nilable(::Float), id: ::String).void } + def initialize(flag:, threshold: nil, id: "violence") + @flag = flag + @threshold = threshold + unless id == "violence" + raise ArgumentError, "Invalid value for id" + end + + @id = "violence" + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @flag == other.flag + return false unless @threshold == other.threshold + return false unless @id == other.id + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/violence.rbi b/lib/moderation_api/models/operations/violence.rbi new file mode 100644 index 00000000..589b56a1 --- /dev/null +++ b/lib/moderation_api/models/operations/violence.rbi @@ -0,0 +1,26 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::Violence + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::Violence + def flag + end + + def flag=(str_) + end + + def threshold + end + + def threshold=(str_) + end + + def id + end + + def id=(str_) + end +end diff --git a/lib/moderation_api/models/operations/weapons.rb b/lib/moderation_api/models/operations/weapons.rb new file mode 100644 index 00000000..2f3cd429 --- /dev/null +++ b/lib/moderation_api/models/operations/weapons.rb @@ -0,0 +1,50 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class Weapons + extend T::Sig + include Crystalline::MetadataFields + + field( + :flag, + Crystalline::Boolean.new, + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("flag"), required: true}} + ) + + field( + :threshold, + Crystalline::Nilable.new(::Float), + {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("threshold")}} + ) + + field :id, ::String, {'format_json': {'letter_case': ::ModerationApi::Utils.field_name("id"), required: true}} + + sig { params(flag: T::Boolean, threshold: T.nilable(::Float), id: ::String).void } + def initialize(flag:, threshold: nil, id: "weapons") + @flag = flag + @threshold = threshold + unless id == "weapons" + raise ArgumentError, "Invalid value for id" + end + + @id = "weapons" + end + + sig { params(other: T.untyped).returns(T::Boolean) } + def ==(other) + return false unless other.is_a?(self.class) + return false unless @flag == other.flag + return false unless @threshold == other.threshold + return false unless @id == other.id + true + end + end + end + end +end diff --git a/lib/moderation_api/models/operations/weapons.rbi b/lib/moderation_api/models/operations/weapons.rbi new file mode 100644 index 00000000..863e7d23 --- /dev/null +++ b/lib/moderation_api/models/operations/weapons.rbi @@ -0,0 +1,26 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::Weapons + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::Weapons + def flag + end + + def flag=(str_) + end + + def threshold + end + + def threshold=(str_) + end + + def id + end + + def id=(str_) + end +end diff --git a/lib/moderation_api/models/operations/withinunit.rb b/lib/moderation_api/models/operations/withinunit.rb new file mode 100644 index 00000000..b097ee3a --- /dev/null +++ b/lib/moderation_api/models/operations/withinunit.rb @@ -0,0 +1,25 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +module ModerationApi + module Models + module Operations + + class WithinUnit + include ::Crystalline::Enum + enums do + MINUTES = new("MINUTES") + HOURS = new("HOURS") + DAYS = new("DAYS") + WEEKS = new("WEEKS") + MONTHS = new("MONTHS") + YEARS = new("YEARS") + end + + open! + end + end + end +end diff --git a/lib/moderation_api/models/operations/withinunit.rbi b/lib/moderation_api/models/operations/withinunit.rbi new file mode 100644 index 00000000..5412fc9f --- /dev/null +++ b/lib/moderation_api/models/operations/withinunit.rbi @@ -0,0 +1,9 @@ +# typed: true +# frozen_string_literal: true + +class ModerationApi::Models::Operations::WithinUnit + extend ::Crystalline::MetadataFields::ClassMethods +end + +class ModerationApi::Models::Operations::WithinUnit +end diff --git a/lib/moderation_api/models/queue/item_list_params.rb b/lib/moderation_api/models/queue/item_list_params.rb deleted file mode 100644 index 0d8806a7..00000000 --- a/lib/moderation_api/models/queue/item_list_params.rb +++ /dev/null @@ -1,126 +0,0 @@ -# frozen_string_literal: true - -module ModerationAPI - module Models - module Queue - # @see ModerationAPI::Resources::Queue::Items#list - class ItemListParams < ModerationAPI::Internal::Type::BaseModel - extend ModerationAPI::Internal::Type::RequestParameters::Converter - include ModerationAPI::Internal::Type::RequestParameters - - # @!attribute id - # The queue ID - # - # @return [String] - required :id, String - - # @!attribute after_date - # - # @return [String, nil] - optional :after_date, String - - # @!attribute author_id - # - # @return [String, nil] - optional :author_id, String - - # @!attribute before_date - # - # @return [String, nil] - optional :before_date, String - - # @!attribute conversation_ids - # - # @return [String, nil] - optional :conversation_ids, String - - # @!attribute filtered_action_ids - # - # @return [String, nil] - optional :filtered_action_ids, String - - # @!attribute include_resolved - # - # @return [String, nil] - optional :include_resolved, String - - # @!attribute labels - # - # @return [String, nil] - optional :labels, String - - # @!attribute page_number - # Page number to fetch - # - # @return [Float, nil] - optional :page_number, Float - - # @!attribute page_size - # Number of items per page - # - # @return [Float, nil] - optional :page_size, Float - - # @!attribute sort_direction - # Sort direction - # - # @return [Symbol, ModerationAPI::Models::Queue::ItemListParams::SortDirection, nil] - optional :sort_direction, enum: -> { ModerationAPI::Queue::ItemListParams::SortDirection } - - # @!attribute sort_field - # - # @return [Symbol, ModerationAPI::Models::Queue::ItemListParams::SortField, nil] - optional :sort_field, enum: -> { ModerationAPI::Queue::ItemListParams::SortField } - - # @!method initialize(id:, after_date: nil, author_id: nil, before_date: nil, conversation_ids: nil, filtered_action_ids: nil, include_resolved: nil, labels: nil, page_number: nil, page_size: nil, sort_direction: nil, sort_field: nil, request_options: {}) - # @param id [String] The queue ID - # - # @param after_date [String] - # - # @param author_id [String] - # - # @param before_date [String] - # - # @param conversation_ids [String] - # - # @param filtered_action_ids [String] - # - # @param include_resolved [String] - # - # @param labels [String] - # - # @param page_number [Float] Page number to fetch - # - # @param page_size [Float] Number of items per page - # - # @param sort_direction [Symbol, ModerationAPI::Models::Queue::ItemListParams::SortDirection] Sort direction - # - # @param sort_field [Symbol, ModerationAPI::Models::Queue::ItemListParams::SortField] - # - # @param request_options [ModerationAPI::RequestOptions, Hash{Symbol=>Object}] - - # Sort direction - module SortDirection - extend ModerationAPI::Internal::Type::Enum - - ASC = :asc - DESC = :desc - - # @!method self.values - # @return [Array] - end - - module SortField - extend ModerationAPI::Internal::Type::Enum - - CREATED_AT = :createdAt - SEVERITY = :severity - REVIEWED_AT = :reviewedAt - - # @!method self.values - # @return [Array] - end - end - end - end -end diff --git a/lib/moderation_api/models/queue/item_list_response.rb b/lib/moderation_api/models/queue/item_list_response.rb deleted file mode 100644 index 6be84f84..00000000 --- a/lib/moderation_api/models/queue/item_list_response.rb +++ /dev/null @@ -1,235 +0,0 @@ -# frozen_string_literal: true - -module ModerationAPI - module Models - module Queue - # @see ModerationAPI::Resources::Queue::Items#list - class ItemListResponse < ModerationAPI::Internal::Type::BaseModel - # @!attribute items - # - # @return [Array] - required :items, - -> { ModerationAPI::Internal::Type::ArrayOf[ModerationAPI::Models::Queue::ItemListResponse::Item] } - - # @!attribute pagination - # - # @return [ModerationAPI::Models::Queue::ItemListResponse::Pagination] - required :pagination, -> { ModerationAPI::Models::Queue::ItemListResponse::Pagination } - - # @!method initialize(items:, pagination:) - # @param items [Array] - # @param pagination [ModerationAPI::Models::Queue::ItemListResponse::Pagination] - - class Item < ModerationAPI::Internal::Type::BaseModel - # @!attribute id - # Content ID - # - # @return [String] - required :id, String - - # @!attribute content - # The content to be moderated - # - # @return [String] - required :content, String - - # @!attribute flagged - # Whether the item is flagged by any label - # - # @return [Boolean] - required :flagged, ModerationAPI::Internal::Type::Boolean - - # @!attribute labels - # - # @return [Array] - required :labels, - -> { ModerationAPI::Internal::Type::ArrayOf[ModerationAPI::Models::Queue::ItemListResponse::Item::Label] } - - # @!attribute status - # Status of the item - # - # @return [Symbol, ModerationAPI::Models::Queue::ItemListResponse::Item::Status] - required :status, enum: -> { ModerationAPI::Models::Queue::ItemListResponse::Item::Status } - - # @!attribute timestamp - # Unix timestamp of when the item was created - # - # @return [Float] - required :timestamp, Float - - # @!attribute actions - # Action IDs taken on this item - # - # @return [Array, nil] - optional :actions, - -> { ModerationAPI::Internal::Type::ArrayOf[ModerationAPI::Models::Queue::ItemListResponse::Item::Action] } - - # @!attribute author_id - # Author ID - # - # @return [String, nil] - optional :author_id, String, api_name: :authorId - - # @!attribute content_type - # Type of the content object - # - # @return [String, nil] - optional :content_type, String, api_name: :contentType - - # @!attribute conversation_id - # Conversation ID - # - # @return [String, nil] - optional :conversation_id, String, api_name: :conversationId - - # @!attribute language - # Content language - # - # @return [String, nil] - optional :language, String - - # @!method initialize(id:, content:, flagged:, labels:, status:, timestamp:, actions: nil, author_id: nil, content_type: nil, conversation_id: nil, language: nil) - # @param id [String] Content ID - # - # @param content [String] The content to be moderated - # - # @param flagged [Boolean] Whether the item is flagged by any label - # - # @param labels [Array] - # - # @param status [Symbol, ModerationAPI::Models::Queue::ItemListResponse::Item::Status] Status of the item - # - # @param timestamp [Float] Unix timestamp of when the item was created - # - # @param actions [Array] Action IDs taken on this item - # - # @param author_id [String] Author ID - # - # @param content_type [String] Type of the content object - # - # @param conversation_id [String] Conversation ID - # - # @param language [String] Content language - - class Label < ModerationAPI::Internal::Type::BaseModel - # @!attribute flagged - # Whether this label caused a flag - # - # @return [Boolean] - required :flagged, ModerationAPI::Internal::Type::Boolean - - # @!attribute label - # Label name - # - # @return [String] - required :label, String - - # @!attribute score - # Confidence score of the label - # - # @return [Float] - required :score, Float - - # @!method initialize(flagged:, label:, score:) - # @param flagged [Boolean] Whether this label caused a flag - # - # @param label [String] Label name - # - # @param score [Float] Confidence score of the label - end - - # Status of the item - # - # @see ModerationAPI::Models::Queue::ItemListResponse::Item#status - module Status - extend ModerationAPI::Internal::Type::Enum - - PENDING = :pending - RESOLVED = :resolved - - # @!method self.values - # @return [Array] - end - - class Action < ModerationAPI::Internal::Type::BaseModel - # @!attribute id - # Action ID - # - # @return [String] - required :id, String - - # @!attribute name - # Action name - # - # @return [String] - required :name, String - - # @!attribute timestamp - # Unix timestamp of when the action was taken - # - # @return [Float] - required :timestamp, Float - - # @!attribute comment - # Action comment - # - # @return [String, nil] - optional :comment, String - - # @!attribute reviewer - # Moderator userID - # - # @return [String, nil] - optional :reviewer, String - - # @!method initialize(id:, name:, timestamp:, comment: nil, reviewer: nil) - # @param id [String] Action ID - # - # @param name [String] Action name - # - # @param timestamp [Float] Unix timestamp of when the action was taken - # - # @param comment [String] Action comment - # - # @param reviewer [String] Moderator userID - end - end - - # @see ModerationAPI::Models::Queue::ItemListResponse#pagination - class Pagination < ModerationAPI::Internal::Type::BaseModel - # @!attribute current_page - # - # @return [Float] - required :current_page, Float, api_name: :currentPage - - # @!attribute has_next_page - # - # @return [Boolean] - required :has_next_page, ModerationAPI::Internal::Type::Boolean, api_name: :hasNextPage - - # @!attribute has_previous_page - # - # @return [Boolean] - required :has_previous_page, ModerationAPI::Internal::Type::Boolean, api_name: :hasPreviousPage - - # @!attribute total_items - # - # @return [Float] - required :total_items, Float, api_name: :totalItems - - # @!attribute total_pages - # - # @return [Float] - required :total_pages, Float, api_name: :totalPages - - # @!method initialize(current_page:, has_next_page:, has_previous_page:, total_items:, total_pages:) - # @param current_page [Float] - # @param has_next_page [Boolean] - # @param has_previous_page [Boolean] - # @param total_items [Float] - # @param total_pages [Float] - end - end - end - end -end diff --git a/lib/moderation_api/models/queue/item_resolve_params.rb b/lib/moderation_api/models/queue/item_resolve_params.rb deleted file mode 100644 index cc5511eb..00000000 --- a/lib/moderation_api/models/queue/item_resolve_params.rb +++ /dev/null @@ -1,40 +0,0 @@ -# frozen_string_literal: true - -module ModerationAPI - module Models - module Queue - # @see ModerationAPI::Resources::Queue::Items#resolve - class ItemResolveParams < ModerationAPI::Internal::Type::BaseModel - extend ModerationAPI::Internal::Type::RequestParameters::Converter - include ModerationAPI::Internal::Type::RequestParameters - - # @!attribute id - # The queue ID - # - # @return [String] - required :id, String - - # @!attribute item_id - # The item ID to resolve - # - # @return [String] - required :item_id, String - - # @!attribute comment - # Optional comment - # - # @return [String, nil] - optional :comment, String - - # @!method initialize(id:, item_id:, comment: nil, request_options: {}) - # @param id [String] The queue ID - # - # @param item_id [String] The item ID to resolve - # - # @param comment [String] Optional comment - # - # @param request_options [ModerationAPI::RequestOptions, Hash{Symbol=>Object}] - end - end - end -end diff --git a/lib/moderation_api/models/queue/item_resolve_response.rb b/lib/moderation_api/models/queue/item_resolve_response.rb deleted file mode 100644 index 9caa9214..00000000 --- a/lib/moderation_api/models/queue/item_resolve_response.rb +++ /dev/null @@ -1,34 +0,0 @@ -# frozen_string_literal: true - -module ModerationAPI - module Models - module Queue - # @see ModerationAPI::Resources::Queue::Items#resolve - class ItemResolveResponse < ModerationAPI::Internal::Type::BaseModel - # @!attribute resolved_at - # Timestamp when the item was resolved - # - # @return [String] - required :resolved_at, String, api_name: :resolvedAt - - # @!attribute success - # - # @return [Boolean] - required :success, ModerationAPI::Internal::Type::Boolean - - # @!attribute comment - # Optional comment - # - # @return [String, nil] - optional :comment, String - - # @!method initialize(resolved_at:, success:, comment: nil) - # @param resolved_at [String] Timestamp when the item was resolved - # - # @param success [Boolean] - # - # @param comment [String] Optional comment - end - end - end -end diff --git a/lib/moderation_api/models/queue/item_unresolve_params.rb b/lib/moderation_api/models/queue/item_unresolve_params.rb deleted file mode 100644 index 1a460ede..00000000 --- a/lib/moderation_api/models/queue/item_unresolve_params.rb +++ /dev/null @@ -1,40 +0,0 @@ -# frozen_string_literal: true - -module ModerationAPI - module Models - module Queue - # @see ModerationAPI::Resources::Queue::Items#unresolve - class ItemUnresolveParams < ModerationAPI::Internal::Type::BaseModel - extend ModerationAPI::Internal::Type::RequestParameters::Converter - include ModerationAPI::Internal::Type::RequestParameters - - # @!attribute id - # The queue ID - # - # @return [String] - required :id, String - - # @!attribute item_id - # The item ID to unresolve - # - # @return [String] - required :item_id, String - - # @!attribute comment - # Optional reason for unresolving the item - # - # @return [String, nil] - optional :comment, String - - # @!method initialize(id:, item_id:, comment: nil, request_options: {}) - # @param id [String] The queue ID - # - # @param item_id [String] The item ID to unresolve - # - # @param comment [String] Optional reason for unresolving the item - # - # @param request_options [ModerationAPI::RequestOptions, Hash{Symbol=>Object}] - end - end - end -end diff --git a/lib/moderation_api/models/queue/item_unresolve_response.rb b/lib/moderation_api/models/queue/item_unresolve_response.rb deleted file mode 100644 index ec310430..00000000 --- a/lib/moderation_api/models/queue/item_unresolve_response.rb +++ /dev/null @@ -1,34 +0,0 @@ -# frozen_string_literal: true - -module ModerationAPI - module Models - module Queue - # @see ModerationAPI::Resources::Queue::Items#unresolve - class ItemUnresolveResponse < ModerationAPI::Internal::Type::BaseModel - # @!attribute status - # New status of the item - # - # @return [String] - required :status, String - - # @!attribute success - # - # @return [Boolean] - required :success, ModerationAPI::Internal::Type::Boolean - - # @!attribute unresolved_at - # Timestamp when the item was unresolved - # - # @return [String] - required :unresolved_at, String, api_name: :unresolvedAt - - # @!method initialize(status:, success:, unresolved_at:) - # @param status [String] New status of the item - # - # @param success [Boolean] - # - # @param unresolved_at [String] Timestamp when the item was unresolved - end - end - end -end diff --git a/lib/moderation_api/models/queue_get_stats_params.rb b/lib/moderation_api/models/queue_get_stats_params.rb deleted file mode 100644 index 712190d2..00000000 --- a/lib/moderation_api/models/queue_get_stats_params.rb +++ /dev/null @@ -1,30 +0,0 @@ -# frozen_string_literal: true - -module ModerationAPI - module Models - # @see ModerationAPI::Resources::Queue#get_stats - class QueueGetStatsParams < ModerationAPI::Internal::Type::BaseModel - extend ModerationAPI::Internal::Type::RequestParameters::Converter - include ModerationAPI::Internal::Type::RequestParameters - - # @!attribute id - # The queue ID - # - # @return [String] - required :id, String - - # @!attribute within_days - # Number of days to analyze statistics for - # - # @return [String, nil] - optional :within_days, String - - # @!method initialize(id:, within_days: nil, request_options: {}) - # @param id [String] The queue ID - # - # @param within_days [String] Number of days to analyze statistics for - # - # @param request_options [ModerationAPI::RequestOptions, Hash{Symbol=>Object}] - end - end -end diff --git a/lib/moderation_api/models/queue_get_stats_response.rb b/lib/moderation_api/models/queue_get_stats_response.rb deleted file mode 100644 index dcd3f3be..00000000 --- a/lib/moderation_api/models/queue_get_stats_response.rb +++ /dev/null @@ -1,251 +0,0 @@ -# frozen_string_literal: true - -module ModerationAPI - module Models - # @see ModerationAPI::Resources::Queue#get_stats - class QueueGetStatsResponse < ModerationAPI::Internal::Type::BaseModel - # @!attribute action_stats - # - # @return [Array] - required :action_stats, - -> { ModerationAPI::Internal::Type::ArrayOf[ModerationAPI::Models::QueueGetStatsResponse::ActionStat] }, - api_name: :actionStats - - # @!attribute review_stats - # - # @return [ModerationAPI::Models::QueueGetStatsResponse::ReviewStats] - required :review_stats, - -> { ModerationAPI::Models::QueueGetStatsResponse::ReviewStats }, - api_name: :reviewStats - - # @!attribute top_reviewers - # List of top reviewers and their statistics - # - # @return [Array] - required :top_reviewers, - -> { ModerationAPI::Internal::Type::ArrayOf[ModerationAPI::Models::QueueGetStatsResponse::TopReviewer] }, - api_name: :topReviewers - - # @!attribute trends - # - # @return [ModerationAPI::Models::QueueGetStatsResponse::Trends] - required :trends, -> { ModerationAPI::Models::QueueGetStatsResponse::Trends } - - # @!method initialize(action_stats:, review_stats:, top_reviewers:, trends:) - # @param action_stats [Array] - # - # @param review_stats [ModerationAPI::Models::QueueGetStatsResponse::ReviewStats] - # - # @param top_reviewers [Array] List of top reviewers and their statistics - # - # @param trends [ModerationAPI::Models::QueueGetStatsResponse::Trends] - - class ActionStat < ModerationAPI::Internal::Type::BaseModel - # @!attribute action_id - # ID of the moderation action - # - # @return [String] - required :action_id, String, api_name: :actionId - - # @!attribute action_name - # Name of the moderation action - # - # @return [String] - required :action_name, String, api_name: :actionName - - # @!attribute count - # Number of times this action was taken - # - # @return [Float] - required :count, Float - - # @!attribute percentage_of_total - # Percentage this action represents of all actions - # - # @return [Float] - required :percentage_of_total, Float, api_name: :percentageOfTotal - - # @!method initialize(action_id:, action_name:, count:, percentage_of_total:) - # @param action_id [String] ID of the moderation action - # - # @param action_name [String] Name of the moderation action - # - # @param count [Float] Number of times this action was taken - # - # @param percentage_of_total [Float] Percentage this action represents of all actions - end - - # @see ModerationAPI::Models::QueueGetStatsResponse#review_stats - class ReviewStats < ModerationAPI::Internal::Type::BaseModel - # @!attribute average_time_to_review - # Average time in milliseconds to review an item - # - # @return [Float] - required :average_time_to_review, Float, api_name: :averageTimeToReview - - # @!attribute total_pending - # Total number of items pending review - # - # @return [Float] - required :total_pending, Float, api_name: :totalPending - - # @!attribute total_reviewed - # Total number of items reviewed - # - # @return [Float] - required :total_reviewed, Float, api_name: :totalReviewed - - # @!method initialize(average_time_to_review:, total_pending:, total_reviewed:) - # @param average_time_to_review [Float] Average time in milliseconds to review an item - # - # @param total_pending [Float] Total number of items pending review - # - # @param total_reviewed [Float] Total number of items reviewed - end - - class TopReviewer < ModerationAPI::Internal::Type::BaseModel - # @!attribute average_time_per_review - # Average review time in milliseconds - # - # @return [Float] - required :average_time_per_review, Float, api_name: :averageTimePerReview - - # @!attribute name - # Name of the reviewer - # - # @return [String] - required :name, String - - # @!attribute review_count - # Number of items reviewed - # - # @return [Float] - required :review_count, Float, api_name: :reviewCount - - # @!attribute top_actions - # Most common actions taken by this reviewer - # - # @return [Array] - required :top_actions, - -> { ModerationAPI::Internal::Type::ArrayOf[ModerationAPI::Models::QueueGetStatsResponse::TopReviewer::TopAction] }, - api_name: :topActions - - # @!attribute user_id - # ID of the reviewer - # - # @return [String] - required :user_id, String, api_name: :userId - - # @!attribute accuracy_score - # Optional accuracy score based on review quality metrics - # - # @return [Float, nil] - optional :accuracy_score, Float, api_name: :accuracyScore - - # @!method initialize(average_time_per_review:, name:, review_count:, top_actions:, user_id:, accuracy_score: nil) - # @param average_time_per_review [Float] Average review time in milliseconds - # - # @param name [String] Name of the reviewer - # - # @param review_count [Float] Number of items reviewed - # - # @param top_actions [Array] Most common actions taken by this reviewer - # - # @param user_id [String] ID of the reviewer - # - # @param accuracy_score [Float] Optional accuracy score based on review quality metrics - - class TopAction < ModerationAPI::Internal::Type::BaseModel - # @!attribute action_id - # Most used action by this reviewer - # - # @return [String] - required :action_id, String, api_name: :actionId - - # @!attribute action_name - # Name of the most used action - # - # @return [String] - required :action_name, String, api_name: :actionName - - # @!attribute count - # Number of times this action was used - # - # @return [Float] - required :count, Float - - # @!method initialize(action_id:, action_name:, count:) - # @param action_id [String] Most used action by this reviewer - # - # @param action_name [String] Name of the most used action - # - # @param count [Float] Number of times this action was used - end - end - - # @see ModerationAPI::Models::QueueGetStatsResponse#trends - class Trends < ModerationAPI::Internal::Type::BaseModel - # @!attribute daily_review_counts - # - # @return [Array] - required :daily_review_counts, - -> { ModerationAPI::Internal::Type::ArrayOf[ModerationAPI::Models::QueueGetStatsResponse::Trends::DailyReviewCount] }, - api_name: :dailyReviewCounts - - # @!attribute flagged_content_trends - # - # @return [Array] - required :flagged_content_trends, - -> { ModerationAPI::Internal::Type::ArrayOf[ModerationAPI::Models::QueueGetStatsResponse::Trends::FlaggedContentTrend] }, - api_name: :flaggedContentTrends - - # @!method initialize(daily_review_counts:, flagged_content_trends:) - # @param daily_review_counts [Array] - # @param flagged_content_trends [Array] - - class DailyReviewCount < ModerationAPI::Internal::Type::BaseModel - # @!attribute count - # Number of reviews on this date - # - # @return [Float] - required :count, Float - - # @!attribute date - # Date in YYYY-MM-DD format - # - # @return [String] - required :date, String - - # @!method initialize(count:, date:) - # @param count [Float] Number of reviews on this date - # - # @param date [String] Date in YYYY-MM-DD format - end - - class FlaggedContentTrend < ModerationAPI::Internal::Type::BaseModel - # @!attribute label - # Content flag/label - # - # @return [String] - required :label, String - - # @!attribute trend - # Trend indicator (-1 to 1) showing if this type of flagged content is increasing - # or decreasing - # - # @return [Float] - required :trend, Float - - # @!method initialize(label:, trend:) - # Some parameter documentations has been truncated, see - # {ModerationAPI::Models::QueueGetStatsResponse::Trends::FlaggedContentTrend} for - # more details. - # - # @param label [String] Content flag/label - # - # @param trend [Float] Trend indicator (-1 to 1) showing if this type of flagged content is increasing - end - end - end - end -end diff --git a/lib/moderation_api/models/queue_retrieve_params.rb b/lib/moderation_api/models/queue_retrieve_params.rb deleted file mode 100644 index 9cccddde..00000000 --- a/lib/moderation_api/models/queue_retrieve_params.rb +++ /dev/null @@ -1,22 +0,0 @@ -# frozen_string_literal: true - -module ModerationAPI - module Models - # @see ModerationAPI::Resources::Queue#retrieve - class QueueRetrieveParams < ModerationAPI::Internal::Type::BaseModel - extend ModerationAPI::Internal::Type::RequestParameters::Converter - include ModerationAPI::Internal::Type::RequestParameters - - # @!attribute id - # The queue ID - # - # @return [String] - required :id, String - - # @!method initialize(id:, request_options: {}) - # @param id [String] The queue ID - # - # @param request_options [ModerationAPI::RequestOptions, Hash{Symbol=>Object}] - end - end -end diff --git a/lib/moderation_api/models/queue_retrieve_response.rb b/lib/moderation_api/models/queue_retrieve_response.rb deleted file mode 100644 index 38c336c6..00000000 --- a/lib/moderation_api/models/queue_retrieve_response.rb +++ /dev/null @@ -1,411 +0,0 @@ -# frozen_string_literal: true - -module ModerationAPI - module Models - # @see ModerationAPI::Resources::Queue#retrieve - class QueueRetrieveResponse < ModerationAPI::Internal::Type::BaseModel - # @!attribute queue - # - # @return [ModerationAPI::Models::QueueRetrieveResponse::Queue] - required :queue, -> { ModerationAPI::Models::QueueRetrieveResponse::Queue } - - # @!method initialize(queue:) - # @param queue [ModerationAPI::Models::QueueRetrieveResponse::Queue] - - # @see ModerationAPI::Models::QueueRetrieveResponse#queue - class Queue < ModerationAPI::Internal::Type::BaseModel - # @!attribute id - # - # @return [String] - required :id, String - - # @!attribute description - # - # @return [String] - required :description, String - - # @!attribute filter - # - # @return [ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter] - required :filter, -> { ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter } - - # @!attribute name - # - # @return [String] - required :name, String - - # @!attribute resolved_items_count - # - # @return [Float] - required :resolved_items_count, Float, api_name: :resolvedItemsCount - - # @!attribute total_items_count - # - # @return [Float] - required :total_items_count, Float, api_name: :totalItemsCount - - # @!attribute unresolved_items_count - # - # @return [Float] - required :unresolved_items_count, Float, api_name: :unresolvedItemsCount - - # @!method initialize(id:, description:, filter:, name:, resolved_items_count:, total_items_count:, unresolved_items_count:) - # @param id [String] - # @param description [String] - # @param filter [ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter] - # @param name [String] - # @param resolved_items_count [Float] - # @param total_items_count [Float] - # @param unresolved_items_count [Float] - - # @see ModerationAPI::Models::QueueRetrieveResponse::Queue#filter - class Filter < ModerationAPI::Internal::Type::BaseModel - # @!attribute after_date - # - # @return [String, nil] - optional :after_date, String, api_name: :afterDate - - # @!attribute author_id - # - # @return [String, nil] - optional :author_id, String, api_name: :authorID - - # @!attribute author_trust_levels - # - # @return [Array, nil] - optional :author_trust_levels, - ModerationAPI::Internal::Type::ArrayOf[Integer], - api_name: :authorTrustLevels - - # @!attribute before_date - # - # @return [String, nil] - optional :before_date, String, api_name: :beforeDate - - # @!attribute casebook_agreement - # - # @return [Symbol, ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::CasebookAgreement, nil] - optional :casebook_agreement, - enum: -> { ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::CasebookAgreement }, - api_name: :casebookAgreement - - # @!attribute casebook_answer - # - # @return [Symbol, ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::CasebookAnswer, nil] - optional :casebook_answer, - enum: -> { ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::CasebookAnswer }, - api_name: :casebookAnswer - - # @!attribute check_status - # - # @return [Symbol, ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::CheckStatus, nil] - optional :check_status, - enum: -> { ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::CheckStatus }, - api_name: :checkStatus, - nil?: true - - # @!attribute clear_date_window - # - # @return [Boolean, nil] - optional :clear_date_window, ModerationAPI::Internal::Type::Boolean, api_name: :clearDateWindow - - # @!attribute content_id - # - # @return [String, nil] - optional :content_id, String, api_name: :contentID - - # @!attribute content_types - # - # @return [Array, nil] - optional :content_types, - -> { ModerationAPI::Internal::Type::ArrayOf[enum: ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::ContentType] }, - api_name: :contentTypes - - # @!attribute conversation_ids - # - # @return [Array, nil] - optional :conversation_ids, - ModerationAPI::Internal::Type::ArrayOf[String, nil?: true], - api_name: :conversationIds - - # @!attribute filtered_action_ids - # - # @return [Array, nil] - optional :filtered_action_ids, - ModerationAPI::Internal::Type::ArrayOf[String], - api_name: :filteredActionIds - - # @!attribute filtered_channel_ids - # - # @return [Array, nil] - optional :filtered_channel_ids, - ModerationAPI::Internal::Type::ArrayOf[String], - api_name: :filteredChannelIds - - # @!attribute filter_labels - # - # @return [Array, nil] - optional :filter_labels, - -> { ModerationAPI::Internal::Type::ArrayOf[ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::FilterLabel] }, - api_name: :filterLabels - - # @!attribute is_flagged - # - # @return [Symbol, ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::IsFlagged, nil] - optional :is_flagged, - enum: -> { ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::IsFlagged }, - api_name: :isFlagged - - # @!attribute labels - # - # @return [Array, nil] - optional :labels, ModerationAPI::Internal::Type::ArrayOf[String] - - # @!attribute languages - # - # @return [Array, nil] - optional :languages, ModerationAPI::Internal::Type::ArrayOf[String] - - # @!attribute max_severity - # - # @return [Integer, nil] - optional :max_severity, Integer, api_name: :maxSeverity - - # @!attribute media_types - # - # @return [Array, nil] - optional :media_types, - -> { ModerationAPI::Internal::Type::ArrayOf[enum: ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::MediaType] }, - api_name: :mediaTypes - - # @!attribute metadata_filters - # - # @return [Array, nil] - optional :metadata_filters, - -> { ModerationAPI::Internal::Type::ArrayOf[ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::MetadataFilter] }, - api_name: :metadataFilters - - # @!attribute min_severity - # - # @return [Integer, nil] - optional :min_severity, Integer, api_name: :minSeverity - - # @!attribute recommendation_actions - # - # @return [Array, nil] - optional :recommendation_actions, - -> { ModerationAPI::Internal::Type::ArrayOf[enum: ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::RecommendationAction] }, - api_name: :recommendationActions - - # @!attribute search - # - # @return [Array, nil] - optional :search, ModerationAPI::Internal::Type::ArrayOf[String] - - # @!attribute within - # - # @return [Float, nil] - optional :within, Float - - # @!attribute within_unit - # - # @return [Symbol, ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::WithinUnit, nil] - optional :within_unit, - enum: -> { ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::WithinUnit }, - api_name: :withinUnit - - # @!method initialize(after_date: nil, author_id: nil, author_trust_levels: nil, before_date: nil, casebook_agreement: nil, casebook_answer: nil, check_status: nil, clear_date_window: nil, content_id: nil, content_types: nil, conversation_ids: nil, filtered_action_ids: nil, filtered_channel_ids: nil, filter_labels: nil, is_flagged: nil, labels: nil, languages: nil, max_severity: nil, media_types: nil, metadata_filters: nil, min_severity: nil, recommendation_actions: nil, search: nil, within: nil, within_unit: nil) - # @param after_date [String] - # @param author_id [String] - # @param author_trust_levels [Array] - # @param before_date [String] - # @param casebook_agreement [Symbol, ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::CasebookAgreement] - # @param casebook_answer [Symbol, ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::CasebookAnswer] - # @param check_status [Symbol, ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::CheckStatus, nil] - # @param clear_date_window [Boolean] - # @param content_id [String] - # @param content_types [Array] - # @param conversation_ids [Array] - # @param filtered_action_ids [Array] - # @param filtered_channel_ids [Array] - # @param filter_labels [Array] - # @param is_flagged [Symbol, ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::IsFlagged] - # @param labels [Array] - # @param languages [Array] - # @param max_severity [Integer] - # @param media_types [Array] - # @param metadata_filters [Array] - # @param min_severity [Integer] - # @param recommendation_actions [Array] - # @param search [Array] - # @param within [Float] - # @param within_unit [Symbol, ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::WithinUnit] - - # @see ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter#casebook_agreement - module CasebookAgreement - extend ModerationAPI::Internal::Type::Enum - - ALL = :ALL - OVERRULED = :OVERRULED - AGREED = :AGREED - - # @!method self.values - # @return [Array] - end - - # @see ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter#casebook_answer - module CasebookAnswer - extend ModerationAPI::Internal::Type::Enum - - ALL = :ALL - ALLOWED = :ALLOWED - REJECTED = :REJECTED - NO_ANSWER = :NO_ANSWER - - # @!method self.values - # @return [Array] - end - - # @see ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter#check_status - module CheckStatus - extend ModerationAPI::Internal::Type::Enum - - ALL = :all - CHECKED = :checked - UNCHECKED = :unchecked - - # @!method self.values - # @return [Array] - end - - module ContentType - extend ModerationAPI::Internal::Type::Enum - - PROFILE = :profile - MESSAGE = :message - POST = :post - COMMENT = :comment - EVENT = :event - PRODUCT = :product - REVIEW = :review - VOICE = :voice - OTHER = :other - - # @!method self.values - # @return [Array] - end - - class FilterLabel < ModerationAPI::Internal::Type::BaseModel - # @!attribute label - # - # @return [String] - required :label, String - - # @!attribute type - # - # @return [Symbol, ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::FilterLabel::Type] - required :type, - enum: -> { ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::FilterLabel::Type } - - # @!attribute max_threshold - # - # @return [Float, nil] - optional :max_threshold, Float, api_name: :maxThreshold, nil?: true - - # @!attribute min_threshold - # - # @return [Float, nil] - optional :min_threshold, Float, api_name: :minThreshold, nil?: true - - # @!method initialize(label:, type:, max_threshold: nil, min_threshold: nil) - # @param label [String] - # @param type [Symbol, ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::FilterLabel::Type] - # @param max_threshold [Float, nil] - # @param min_threshold [Float, nil] - - # @see ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::FilterLabel#type - module Type - extend ModerationAPI::Internal::Type::Enum - - FLAGGED = :FLAGGED - NOT_FLAGGED = :NOT_FLAGGED - THRESHOLDS = :THRESHOLDS - MATCHED = :MATCHED - - # @!method self.values - # @return [Array] - end - end - - # @see ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter#is_flagged - module IsFlagged - extend ModerationAPI::Internal::Type::Enum - - ALL = :ALL - FLAGGED = :FLAGGED - NOT_FLAGGED = :NOT_FLAGGED - SHADOW_FLAGGED = :SHADOW_FLAGGED - - # @!method self.values - # @return [Array] - end - - module MediaType - extend ModerationAPI::Internal::Type::Enum - - TEXT = :text - IMAGE = :image - VIDEO = :video - OBJECT = :object - AUDIO = :audio - - # @!method self.values - # @return [Array] - end - - class MetadataFilter < ModerationAPI::Internal::Type::BaseModel - # @!attribute key - # - # @return [String] - required :key, String - - # @!attribute value - # - # @return [String] - required :value, String - - # @!method initialize(key:, value:) - # @param key [String] - # @param value [String] - end - - module RecommendationAction - extend ModerationAPI::Internal::Type::Enum - - REVIEW = :review - ALLOW = :allow - REJECT = :reject - - # @!method self.values - # @return [Array] - end - - # @see ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter#within_unit - module WithinUnit - extend ModerationAPI::Internal::Type::Enum - - MINUTES = :MINUTES - HOURS = :HOURS - DAYS = :DAYS - WEEKS = :WEEKS - MONTHS = :MONTHS - YEARS = :YEARS - - # @!method self.values - # @return [Array] - end - end - end - end - end -end diff --git a/lib/moderation_api/models/webhook_create_params.rb b/lib/moderation_api/models/webhook_create_params.rb deleted file mode 100644 index d6a4eaa7..00000000 --- a/lib/moderation_api/models/webhook_create_params.rb +++ /dev/null @@ -1,73 +0,0 @@ -# frozen_string_literal: true - -module ModerationAPI - module Models - # @see ModerationAPI::Resources::Webhooks#create - class WebhookCreateParams < ModerationAPI::Internal::Type::BaseModel - extend ModerationAPI::Internal::Type::RequestParameters::Converter - include ModerationAPI::Internal::Type::RequestParameters - - # @!attribute event_types - # Event types this webhook subscribes to. One webhook URL receives all events you - # list here. - # - # @return [Array] - required :event_types, - -> { - ModerationAPI::Internal::Type::ArrayOf[enum: ModerationAPI::WebhookCreateParams::EventType] - }, - api_name: :eventTypes - - # @!attribute name - # The webhook's name, used to identify it in the dashboard - # - # @return [String] - required :name, String - - # @!attribute url - # The webhook's URL. We'll call this URL when an event occurs. - # - # @return [String] - required :url, String - - # @!attribute description - # The webhook's description - # - # @return [String, nil] - optional :description, String, nil?: true - - # @!method initialize(event_types:, name:, url:, description: nil, request_options: {}) - # Some parameter documentations has been truncated, see - # {ModerationAPI::Models::WebhookCreateParams} for more details. - # - # @param event_types [Array] Event types this webhook subscribes to. One webhook URL receives all events you - # - # @param name [String] The webhook's name, used to identify it in the dashboard - # - # @param url [String] The webhook's URL. We'll call this URL when an event occurs. - # - # @param description [String, nil] The webhook's description - # - # @param request_options [ModerationAPI::RequestOptions, Hash{Symbol=>Object}] - - module EventType - extend ModerationAPI::Internal::Type::Enum - - QUEUE_ITEM_NEW = :QUEUE_ITEM_NEW - QUEUE_ITEM_COMPLETED = :QUEUE_ITEM_COMPLETED - QUEUE_ITEM_ACTION = :QUEUE_ITEM_ACTION - QUEUE_ITEM_REJECTED = :QUEUE_ITEM_REJECTED - QUEUE_ITEM_ALLOWED = :QUEUE_ITEM_ALLOWED - AUTHOR_BLOCKED = :AUTHOR_BLOCKED - AUTHOR_UNBLOCKED = :AUTHOR_UNBLOCKED - AUTHOR_SUSPENDED = :AUTHOR_SUSPENDED - AUTHOR_UPDATED = :AUTHOR_UPDATED - AUTHOR_TRUST_LEVEL_CHANGED = :AUTHOR_TRUST_LEVEL_CHANGED - AUTHOR_ACTION = :AUTHOR_ACTION - - # @!method self.values - # @return [Array] - end - end - end -end diff --git a/lib/moderation_api/models/webhook_create_response.rb b/lib/moderation_api/models/webhook_create_response.rb deleted file mode 100644 index d4e7a68b..00000000 --- a/lib/moderation_api/models/webhook_create_response.rb +++ /dev/null @@ -1,107 +0,0 @@ -# frozen_string_literal: true - -module ModerationAPI - module Models - # @see ModerationAPI::Resources::Webhooks#create - class WebhookCreateResponse < ModerationAPI::Internal::Type::BaseModel - # @!attribute id - # The ID of the webhook. - # - # @return [String] - required :id, String - - # @!attribute created_at - # The date the webhook was created. - # - # @return [String] - required :created_at, String, api_name: :createdAt - - # @!attribute event_types - # Event types this webhook subscribes to. Empty for legacy v1 webhooks, which - # subscribe via their single deprecated `type` instead. - # - # @return [Array] - required :event_types, - -> { ModerationAPI::Internal::Type::ArrayOf[enum: ModerationAPI::Models::WebhookCreateResponse::EventType] }, - api_name: :eventTypes - - # @!attribute name - # The webhook's name. - # - # @return [String] - required :name, String - - # @!attribute payload_version - # Payload envelope version. V2 is the Stripe-style envelope; V1 is the legacy flat - # shape and is read-only via this API. - # - # @return [Symbol, ModerationAPI::Models::WebhookCreateResponse::PayloadVersion] - required :payload_version, - enum: -> { ModerationAPI::Models::WebhookCreateResponse::PayloadVersion }, - api_name: :payloadVersion - - # @!attribute url - # The URL we call when a subscribed event occurs. - # - # @return [String] - required :url, String - - # @!attribute description - # The webhook's description. - # - # @return [String, nil] - optional :description, String, nil?: true - - # @!method initialize(id:, created_at:, event_types:, name:, payload_version:, url:, description: nil) - # Some parameter documentations has been truncated, see - # {ModerationAPI::Models::WebhookCreateResponse} for more details. - # - # @param id [String] The ID of the webhook. - # - # @param created_at [String] The date the webhook was created. - # - # @param event_types [Array] Event types this webhook subscribes to. Empty for legacy v1 webhooks, which subs - # - # @param name [String] The webhook's name. - # - # @param payload_version [Symbol, ModerationAPI::Models::WebhookCreateResponse::PayloadVersion] Payload envelope version. V2 is the Stripe-style envelope; V1 is the legacy flat - # - # @param url [String] The URL we call when a subscribed event occurs. - # - # @param description [String, nil] The webhook's description. - - module EventType - extend ModerationAPI::Internal::Type::Enum - - QUEUE_ITEM_NEW = :QUEUE_ITEM_NEW - QUEUE_ITEM_COMPLETED = :QUEUE_ITEM_COMPLETED - QUEUE_ITEM_ACTION = :QUEUE_ITEM_ACTION - QUEUE_ITEM_REJECTED = :QUEUE_ITEM_REJECTED - QUEUE_ITEM_ALLOWED = :QUEUE_ITEM_ALLOWED - AUTHOR_BLOCKED = :AUTHOR_BLOCKED - AUTHOR_UNBLOCKED = :AUTHOR_UNBLOCKED - AUTHOR_SUSPENDED = :AUTHOR_SUSPENDED - AUTHOR_UPDATED = :AUTHOR_UPDATED - AUTHOR_TRUST_LEVEL_CHANGED = :AUTHOR_TRUST_LEVEL_CHANGED - AUTHOR_ACTION = :AUTHOR_ACTION - - # @!method self.values - # @return [Array] - end - - # Payload envelope version. V2 is the Stripe-style envelope; V1 is the legacy flat - # shape and is read-only via this API. - # - # @see ModerationAPI::Models::WebhookCreateResponse#payload_version - module PayloadVersion - extend ModerationAPI::Internal::Type::Enum - - V1 = :V1 - V2 = :V2 - - # @!method self.values - # @return [Array] - end - end - end -end diff --git a/lib/moderation_api/models/webhook_delete_params.rb b/lib/moderation_api/models/webhook_delete_params.rb deleted file mode 100644 index 087ecf98..00000000 --- a/lib/moderation_api/models/webhook_delete_params.rb +++ /dev/null @@ -1,22 +0,0 @@ -# frozen_string_literal: true - -module ModerationAPI - module Models - # @see ModerationAPI::Resources::Webhooks#delete - class WebhookDeleteParams < ModerationAPI::Internal::Type::BaseModel - extend ModerationAPI::Internal::Type::RequestParameters::Converter - include ModerationAPI::Internal::Type::RequestParameters - - # @!attribute id - # The ID of the webhook to delete. - # - # @return [String] - required :id, String - - # @!method initialize(id:, request_options: {}) - # @param id [String] The ID of the webhook to delete. - # - # @param request_options [ModerationAPI::RequestOptions, Hash{Symbol=>Object}] - end - end -end diff --git a/lib/moderation_api/models/webhook_delete_response.rb b/lib/moderation_api/models/webhook_delete_response.rb deleted file mode 100644 index 611811e6..00000000 --- a/lib/moderation_api/models/webhook_delete_response.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true - -module ModerationAPI - module Models - # @see ModerationAPI::Resources::Webhooks#delete - class WebhookDeleteResponse < ModerationAPI::Internal::Type::BaseModel - # @!attribute id - # The ID of the webhook. - # - # @return [String] - required :id, String - - # @!attribute deleted - # Whether the webhook was deleted. - # - # @return [Boolean] - required :deleted, ModerationAPI::Internal::Type::Boolean - - # @!method initialize(id:, deleted:) - # @param id [String] The ID of the webhook. - # - # @param deleted [Boolean] Whether the webhook was deleted. - end - end -end diff --git a/lib/moderation_api/models/webhook_event.rb b/lib/moderation_api/models/webhook_event.rb deleted file mode 100644 index b8dc4647..00000000 --- a/lib/moderation_api/models/webhook_event.rb +++ /dev/null @@ -1,6715 +0,0 @@ -# frozen_string_literal: true - -module ModerationAPI - module Models - # Discriminated union of every v2 webhook event. Switch on `type` to narrow to a - # specific event shape. - module WebhookEvent - extend ModerationAPI::Internal::Type::Union - - discriminator :type - - variant :"author.blocked", -> { ModerationAPI::WebhookEvent::AuthorBlocked } - - variant :"author.unblocked", -> { ModerationAPI::WebhookEvent::AuthorUnblocked } - - variant :"author.suspended", -> { ModerationAPI::WebhookEvent::AuthorSuspended } - - variant :"author.updated", -> { ModerationAPI::WebhookEvent::AuthorUpdated } - - variant :"author.trust_level_changed", -> { ModerationAPI::WebhookEvent::AuthorTrustLevelChanged } - - variant :"author.action", -> { ModerationAPI::WebhookEvent::AuthorAction } - - variant :"queue_item.resolved", -> { ModerationAPI::WebhookEvent::QueueItemResolved } - - variant :"queue_item.action", -> { ModerationAPI::WebhookEvent::QueueItemAction } - - variant :"queue_item.rejected", -> { ModerationAPI::WebhookEvent::QueueItemRejected } - - variant :"queue_item.allowed", -> { ModerationAPI::WebhookEvent::QueueItemAllowed } - - class AuthorBlocked < ModerationAPI::Internal::Type::BaseModel - # @!attribute id - # Stable event ID. Use this to dedupe retries. - # - # @return [String] - required :id, String - - # @!attribute api_version - # - # @return [Symbol, :v2] - required :api_version, const: :v2 - - # @!attribute created - # ISO 8601 timestamp of when the event was emitted. - # - # @return [Time] - required :created, Time - - # @!attribute data - # - # @return [ModerationAPI::Models::WebhookEvent::AuthorBlocked::Data] - required :data, -> { ModerationAPI::WebhookEvent::AuthorBlocked::Data } - - # @!attribute type - # The event type. - # - # @return [Symbol, :"author.blocked"] - required :type, const: :"author.blocked" - - # @!method initialize(id:, created:, data:, api_version: :v2, type: :"author.blocked") - # @param id [String] Stable event ID. Use this to dedupe retries. - # - # @param created [Time] ISO 8601 timestamp of when the event was emitted. - # - # @param data [ModerationAPI::Models::WebhookEvent::AuthorBlocked::Data] - # - # @param api_version [Symbol, :v2] - # - # @param type [Symbol, :"author.blocked"] The event type. - - # @see ModerationAPI::Models::WebhookEvent::AuthorBlocked#data - class Data < ModerationAPI::Internal::Type::BaseModel - # @!attribute object - # - # @return [ModerationAPI::Models::WebhookEvent::AuthorBlocked::Data::Object] - required :object, -> { ModerationAPI::WebhookEvent::AuthorBlocked::Data::Object } - - # @!method initialize(object:) - # @param object [ModerationAPI::Models::WebhookEvent::AuthorBlocked::Data::Object] - - # @see ModerationAPI::Models::WebhookEvent::AuthorBlocked::Data#object - class Object < ModerationAPI::Internal::Type::BaseModel - # @!attribute id - # Moderation action ID - # - # @return [String] - required :id, String - - # @!attribute author - # The author the action was performed on - # - # @return [ModerationAPI::Models::WebhookEvent::AuthorBlocked::Data::Object::Author] - required :author, -> { ModerationAPI::WebhookEvent::AuthorBlocked::Data::Object::Author } - - # @!attribute created_at - # ISO 8601 timestamp of when the action was performed - # - # @return [Time] - required :created_at, Time - - # @!attribute key - # Customer-defined key identifying this action - # - # @return [String, nil] - required :key, String, nil?: true - - # @!attribute name - # Display name of the action - # - # @return [String, nil] - required :name, String, nil?: true - - # @!attribute value - # The value passed to the action when it ran - # - # @return [String, nil] - required :value, String, nil?: true - - # @!attribute queue - # The queue the item belongs to, if any - # - # @return [ModerationAPI::Models::WebhookEvent::AuthorBlocked::Data::Object::Queue, nil] - optional :queue, -> { ModerationAPI::WebhookEvent::AuthorBlocked::Data::Object::Queue } - - # @!method initialize(id:, author:, created_at:, key:, name:, value:, queue: nil) - # @param id [String] Moderation action ID - # - # @param author [ModerationAPI::Models::WebhookEvent::AuthorBlocked::Data::Object::Author] The author the action was performed on - # - # @param created_at [Time] ISO 8601 timestamp of when the action was performed - # - # @param key [String, nil] Customer-defined key identifying this action - # - # @param name [String, nil] Display name of the action - # - # @param value [String, nil] The value passed to the action when it ran - # - # @param queue [ModerationAPI::Models::WebhookEvent::AuthorBlocked::Data::Object::Queue] The queue the item belongs to, if any - - # @see ModerationAPI::Models::WebhookEvent::AuthorBlocked::Data::Object#author - class Author < ModerationAPI::Internal::Type::BaseModel - # @!attribute id - # Author ID in Moderation API - # - # @return [String] - required :id, String - - # @!attribute block - # Block or suspension details, if applicable. Null if the author is enabled. - # - # @return [ModerationAPI::Models::WebhookEvent::AuthorBlocked::Data::Object::Author::Block, nil] - required :block, - -> { ModerationAPI::WebhookEvent::AuthorBlocked::Data::Object::Author::Block }, - nil?: true - - # @!attribute first_seen - # Timestamp when author first appeared - # - # @return [Float] - required :first_seen, Float - - # @!attribute last_seen - # Timestamp of last activity - # - # @return [Float] - required :last_seen, Float - - # @!attribute metadata - # Additional metadata provided by your system. We recommend including any relevant - # information that may assist in the moderation process. - # - # @return [ModerationAPI::Models::WebhookEvent::AuthorBlocked::Data::Object::Author::Metadata] - required :metadata, -> { ModerationAPI::WebhookEvent::AuthorBlocked::Data::Object::Author::Metadata } - - # @!attribute metrics - # - # @return [ModerationAPI::Models::WebhookEvent::AuthorBlocked::Data::Object::Author::Metrics] - required :metrics, -> { ModerationAPI::WebhookEvent::AuthorBlocked::Data::Object::Author::Metrics } - - # @!attribute risk_evaluation - # Risk assessment details, if available. - # - # @return [ModerationAPI::Models::WebhookEvent::AuthorBlocked::Data::Object::Author::RiskEvaluation, nil] - required :risk_evaluation, - -> { - ModerationAPI::WebhookEvent::AuthorBlocked::Data::Object::Author::RiskEvaluation - }, - nil?: true - - # @!attribute status - # Current author status - # - # @return [Symbol, ModerationAPI::Models::WebhookEvent::AuthorBlocked::Data::Object::Author::Status] - required :status, enum: -> { ModerationAPI::WebhookEvent::AuthorBlocked::Data::Object::Author::Status } - - # @!attribute trust_level - # - # @return [ModerationAPI::Models::WebhookEvent::AuthorBlocked::Data::Object::Author::TrustLevel] - required :trust_level, -> { ModerationAPI::WebhookEvent::AuthorBlocked::Data::Object::Author::TrustLevel } - - # @!attribute company - # The author's company or organization - # - # @return [String, nil] - optional :company, String, nil?: true - - # @!attribute email - # Author email address - # - # @return [String, nil] - optional :email, String, nil?: true - - # @!attribute external_id - # The author's ID from your system - # - # @return [String, nil] - optional :external_id, String, nil?: true - - # @!attribute external_link - # URL of the author's external profile - # - # @return [String, nil] - optional :external_link, String, nil?: true - - # @!attribute last_incident - # Timestamp of last incident - # - # @return [Float, nil] - optional :last_incident, Float, nil?: true - - # @!attribute name - # Author name or identifier - # - # @return [String, nil] - optional :name, String, nil?: true - - # @!attribute profile_picture - # URL of the author's profile picture - # - # @return [String, nil] - optional :profile_picture, String, nil?: true - - # @!method initialize(id:, block:, first_seen:, last_seen:, metadata:, metrics:, risk_evaluation:, status:, trust_level:, company: nil, email: nil, external_id: nil, external_link: nil, last_incident: nil, name: nil, profile_picture: nil) - # Some parameter documentations has been truncated, see - # {ModerationAPI::Models::WebhookEvent::AuthorBlocked::Data::Object::Author} for - # more details. - # - # The author the action was performed on - # - # @param id [String] Author ID in Moderation API - # - # @param block [ModerationAPI::Models::WebhookEvent::AuthorBlocked::Data::Object::Author::Block, nil] Block or suspension details, if applicable. Null if the author is enabled. - # - # @param first_seen [Float] Timestamp when author first appeared - # - # @param last_seen [Float] Timestamp of last activity - # - # @param metadata [ModerationAPI::Models::WebhookEvent::AuthorBlocked::Data::Object::Author::Metadata] Additional metadata provided by your system. We recommend including any relevant - # - # @param metrics [ModerationAPI::Models::WebhookEvent::AuthorBlocked::Data::Object::Author::Metrics] - # - # @param risk_evaluation [ModerationAPI::Models::WebhookEvent::AuthorBlocked::Data::Object::Author::RiskEvaluation, nil] Risk assessment details, if available. - # - # @param status [Symbol, ModerationAPI::Models::WebhookEvent::AuthorBlocked::Data::Object::Author::Status] Current author status - # - # @param trust_level [ModerationAPI::Models::WebhookEvent::AuthorBlocked::Data::Object::Author::TrustLevel] - # - # @param company [String, nil] The author's company or organization - # - # @param email [String, nil] Author email address - # - # @param external_id [String, nil] The author's ID from your system - # - # @param external_link [String, nil] URL of the author's external profile - # - # @param last_incident [Float, nil] Timestamp of last incident - # - # @param name [String, nil] Author name or identifier - # - # @param profile_picture [String, nil] URL of the author's profile picture - - # @see ModerationAPI::Models::WebhookEvent::AuthorBlocked::Data::Object::Author#block - class Block < ModerationAPI::Internal::Type::BaseModel - # @!attribute reason - # The moderators reason why the author was blocked or suspended. - # - # @return [String, nil] - optional :reason, String, nil?: true - - # @!attribute until_ - # The timestamp until which they are blocked if the author is suspended. - # - # @return [Float, nil] - optional :until_, Float, api_name: :until, nil?: true - - # @!method initialize(reason: nil, until_: nil) - # Block or suspension details, if applicable. Null if the author is enabled. - # - # @param reason [String, nil] The moderators reason why the author was blocked or suspended. - # - # @param until_ [Float, nil] The timestamp until which they are blocked if the author is suspended. - end - - # @see ModerationAPI::Models::WebhookEvent::AuthorBlocked::Data::Object::Author#metadata - class Metadata < ModerationAPI::Internal::Type::BaseModel - # @!attribute email_verified - # Whether the author's email is verified - # - # @return [Boolean, nil] - optional :email_verified, ModerationAPI::Internal::Type::Boolean, nil?: true - - # @!attribute identity_verified - # Whether the author's identity is verified - # - # @return [Boolean, nil] - optional :identity_verified, ModerationAPI::Internal::Type::Boolean, nil?: true - - # @!attribute is_paying_customer - # Whether the author is a paying customer - # - # @return [Boolean, nil] - optional :is_paying_customer, ModerationAPI::Internal::Type::Boolean, nil?: true - - # @!attribute phone_verified - # Whether the author's phone number is verified - # - # @return [Boolean, nil] - optional :phone_verified, ModerationAPI::Internal::Type::Boolean, nil?: true - - # @!method initialize(email_verified: nil, identity_verified: nil, is_paying_customer: nil, phone_verified: nil) - # Additional metadata provided by your system. We recommend including any relevant - # information that may assist in the moderation process. - # - # @param email_verified [Boolean, nil] Whether the author's email is verified - # - # @param identity_verified [Boolean, nil] Whether the author's identity is verified - # - # @param is_paying_customer [Boolean, nil] Whether the author is a paying customer - # - # @param phone_verified [Boolean, nil] Whether the author's phone number is verified - end - - # @see ModerationAPI::Models::WebhookEvent::AuthorBlocked::Data::Object::Author#metrics - class Metrics < ModerationAPI::Internal::Type::BaseModel - # @!attribute flagged_content - # Number of flagged content pieces - # - # @return [Float] - required :flagged_content, Float - - # @!attribute total_content - # Total pieces of content - # - # @return [Float] - required :total_content, Float - - # @!attribute average_sentiment - # Average sentiment score of content (-1 to 1). Requires a sentiment model in your - # project. - # - # @return [Float, nil] - optional :average_sentiment, Float, nil?: true - - # @!method initialize(flagged_content:, total_content:, average_sentiment: nil) - # Some parameter documentations has been truncated, see - # {ModerationAPI::Models::WebhookEvent::AuthorBlocked::Data::Object::Author::Metrics} - # for more details. - # - # @param flagged_content [Float] Number of flagged content pieces - # - # @param total_content [Float] Total pieces of content - # - # @param average_sentiment [Float, nil] Average sentiment score of content (-1 to 1). Requires a sentiment model in your - end - - # @see ModerationAPI::Models::WebhookEvent::AuthorBlocked::Data::Object::Author#risk_evaluation - class RiskEvaluation < ModerationAPI::Internal::Type::BaseModel - # @!attribute risk_level - # Calculated risk level based on more than 10 behavioral signals. - # - # @return [Float, nil] - optional :risk_level, Float, nil?: true - - # @!method initialize(risk_level: nil) - # Risk assessment details, if available. - # - # @param risk_level [Float, nil] Calculated risk level based on more than 10 behavioral signals. - end - - # Current author status - # - # @see ModerationAPI::Models::WebhookEvent::AuthorBlocked::Data::Object::Author#status - module Status - extend ModerationAPI::Internal::Type::Enum - - ENABLED = :enabled - SUSPENDED = :suspended - BLOCKED = :blocked - - # @!method self.values - # @return [Array] - end - - # @see ModerationAPI::Models::WebhookEvent::AuthorBlocked::Data::Object::Author#trust_level - class TrustLevel < ModerationAPI::Internal::Type::BaseModel - # @!attribute level - # Author trust level (-1, 0, 1, 2, 3, or 4) - # - # @return [Float] - required :level, Float - - # @!attribute manual - # True if the trust level was set manually by a moderator - # - # @return [Boolean] - required :manual, ModerationAPI::Internal::Type::Boolean - - # @!method initialize(level:, manual:) - # @param level [Float] Author trust level (-1, 0, 1, 2, 3, or 4) - # - # @param manual [Boolean] True if the trust level was set manually by a moderator - end - end - - # @see ModerationAPI::Models::WebhookEvent::AuthorBlocked::Data::Object#queue - class Queue < ModerationAPI::Internal::Type::BaseModel - # @!attribute id - # - # @return [String] - required :id, String - - # @!method initialize(id:) - # The queue the item belongs to, if any - # - # @param id [String] - end - end - end - end - - class AuthorUnblocked < ModerationAPI::Internal::Type::BaseModel - # @!attribute id - # Stable event ID. Use this to dedupe retries. - # - # @return [String] - required :id, String - - # @!attribute api_version - # - # @return [Symbol, :v2] - required :api_version, const: :v2 - - # @!attribute created - # ISO 8601 timestamp of when the event was emitted. - # - # @return [Time] - required :created, Time - - # @!attribute data - # - # @return [ModerationAPI::Models::WebhookEvent::AuthorUnblocked::Data] - required :data, -> { ModerationAPI::WebhookEvent::AuthorUnblocked::Data } - - # @!attribute type - # The event type. - # - # @return [Symbol, :"author.unblocked"] - required :type, const: :"author.unblocked" - - # @!method initialize(id:, created:, data:, api_version: :v2, type: :"author.unblocked") - # @param id [String] Stable event ID. Use this to dedupe retries. - # - # @param created [Time] ISO 8601 timestamp of when the event was emitted. - # - # @param data [ModerationAPI::Models::WebhookEvent::AuthorUnblocked::Data] - # - # @param api_version [Symbol, :v2] - # - # @param type [Symbol, :"author.unblocked"] The event type. - - # @see ModerationAPI::Models::WebhookEvent::AuthorUnblocked#data - class Data < ModerationAPI::Internal::Type::BaseModel - # @!attribute object - # - # @return [ModerationAPI::Models::WebhookEvent::AuthorUnblocked::Data::Object] - required :object, -> { ModerationAPI::WebhookEvent::AuthorUnblocked::Data::Object } - - # @!method initialize(object:) - # @param object [ModerationAPI::Models::WebhookEvent::AuthorUnblocked::Data::Object] - - # @see ModerationAPI::Models::WebhookEvent::AuthorUnblocked::Data#object - class Object < ModerationAPI::Internal::Type::BaseModel - # @!attribute id - # Moderation action ID - # - # @return [String] - required :id, String - - # @!attribute author - # The author the action was performed on - # - # @return [ModerationAPI::Models::WebhookEvent::AuthorUnblocked::Data::Object::Author] - required :author, -> { ModerationAPI::WebhookEvent::AuthorUnblocked::Data::Object::Author } - - # @!attribute created_at - # ISO 8601 timestamp of when the action was performed - # - # @return [Time] - required :created_at, Time - - # @!attribute key - # Customer-defined key identifying this action - # - # @return [String, nil] - required :key, String, nil?: true - - # @!attribute name - # Display name of the action - # - # @return [String, nil] - required :name, String, nil?: true - - # @!attribute value - # The value passed to the action when it ran - # - # @return [String, nil] - required :value, String, nil?: true - - # @!attribute queue - # The queue the item belongs to, if any - # - # @return [ModerationAPI::Models::WebhookEvent::AuthorUnblocked::Data::Object::Queue, nil] - optional :queue, -> { ModerationAPI::WebhookEvent::AuthorUnblocked::Data::Object::Queue } - - # @!method initialize(id:, author:, created_at:, key:, name:, value:, queue: nil) - # @param id [String] Moderation action ID - # - # @param author [ModerationAPI::Models::WebhookEvent::AuthorUnblocked::Data::Object::Author] The author the action was performed on - # - # @param created_at [Time] ISO 8601 timestamp of when the action was performed - # - # @param key [String, nil] Customer-defined key identifying this action - # - # @param name [String, nil] Display name of the action - # - # @param value [String, nil] The value passed to the action when it ran - # - # @param queue [ModerationAPI::Models::WebhookEvent::AuthorUnblocked::Data::Object::Queue] The queue the item belongs to, if any - - # @see ModerationAPI::Models::WebhookEvent::AuthorUnblocked::Data::Object#author - class Author < ModerationAPI::Internal::Type::BaseModel - # @!attribute id - # Author ID in Moderation API - # - # @return [String] - required :id, String - - # @!attribute block - # Block or suspension details, if applicable. Null if the author is enabled. - # - # @return [ModerationAPI::Models::WebhookEvent::AuthorUnblocked::Data::Object::Author::Block, nil] - required :block, - -> { ModerationAPI::WebhookEvent::AuthorUnblocked::Data::Object::Author::Block }, - nil?: true - - # @!attribute first_seen - # Timestamp when author first appeared - # - # @return [Float] - required :first_seen, Float - - # @!attribute last_seen - # Timestamp of last activity - # - # @return [Float] - required :last_seen, Float - - # @!attribute metadata - # Additional metadata provided by your system. We recommend including any relevant - # information that may assist in the moderation process. - # - # @return [ModerationAPI::Models::WebhookEvent::AuthorUnblocked::Data::Object::Author::Metadata] - required :metadata, -> { ModerationAPI::WebhookEvent::AuthorUnblocked::Data::Object::Author::Metadata } - - # @!attribute metrics - # - # @return [ModerationAPI::Models::WebhookEvent::AuthorUnblocked::Data::Object::Author::Metrics] - required :metrics, -> { ModerationAPI::WebhookEvent::AuthorUnblocked::Data::Object::Author::Metrics } - - # @!attribute risk_evaluation - # Risk assessment details, if available. - # - # @return [ModerationAPI::Models::WebhookEvent::AuthorUnblocked::Data::Object::Author::RiskEvaluation, nil] - required :risk_evaluation, - -> { - ModerationAPI::WebhookEvent::AuthorUnblocked::Data::Object::Author::RiskEvaluation - }, - nil?: true - - # @!attribute status - # Current author status - # - # @return [Symbol, ModerationAPI::Models::WebhookEvent::AuthorUnblocked::Data::Object::Author::Status] - required :status, enum: -> { ModerationAPI::WebhookEvent::AuthorUnblocked::Data::Object::Author::Status } - - # @!attribute trust_level - # - # @return [ModerationAPI::Models::WebhookEvent::AuthorUnblocked::Data::Object::Author::TrustLevel] - required :trust_level, - -> { ModerationAPI::WebhookEvent::AuthorUnblocked::Data::Object::Author::TrustLevel } - - # @!attribute company - # The author's company or organization - # - # @return [String, nil] - optional :company, String, nil?: true - - # @!attribute email - # Author email address - # - # @return [String, nil] - optional :email, String, nil?: true - - # @!attribute external_id - # The author's ID from your system - # - # @return [String, nil] - optional :external_id, String, nil?: true - - # @!attribute external_link - # URL of the author's external profile - # - # @return [String, nil] - optional :external_link, String, nil?: true - - # @!attribute last_incident - # Timestamp of last incident - # - # @return [Float, nil] - optional :last_incident, Float, nil?: true - - # @!attribute name - # Author name or identifier - # - # @return [String, nil] - optional :name, String, nil?: true - - # @!attribute profile_picture - # URL of the author's profile picture - # - # @return [String, nil] - optional :profile_picture, String, nil?: true - - # @!method initialize(id:, block:, first_seen:, last_seen:, metadata:, metrics:, risk_evaluation:, status:, trust_level:, company: nil, email: nil, external_id: nil, external_link: nil, last_incident: nil, name: nil, profile_picture: nil) - # Some parameter documentations has been truncated, see - # {ModerationAPI::Models::WebhookEvent::AuthorUnblocked::Data::Object::Author} for - # more details. - # - # The author the action was performed on - # - # @param id [String] Author ID in Moderation API - # - # @param block [ModerationAPI::Models::WebhookEvent::AuthorUnblocked::Data::Object::Author::Block, nil] Block or suspension details, if applicable. Null if the author is enabled. - # - # @param first_seen [Float] Timestamp when author first appeared - # - # @param last_seen [Float] Timestamp of last activity - # - # @param metadata [ModerationAPI::Models::WebhookEvent::AuthorUnblocked::Data::Object::Author::Metadata] Additional metadata provided by your system. We recommend including any relevant - # - # @param metrics [ModerationAPI::Models::WebhookEvent::AuthorUnblocked::Data::Object::Author::Metrics] - # - # @param risk_evaluation [ModerationAPI::Models::WebhookEvent::AuthorUnblocked::Data::Object::Author::RiskEvaluation, nil] Risk assessment details, if available. - # - # @param status [Symbol, ModerationAPI::Models::WebhookEvent::AuthorUnblocked::Data::Object::Author::Status] Current author status - # - # @param trust_level [ModerationAPI::Models::WebhookEvent::AuthorUnblocked::Data::Object::Author::TrustLevel] - # - # @param company [String, nil] The author's company or organization - # - # @param email [String, nil] Author email address - # - # @param external_id [String, nil] The author's ID from your system - # - # @param external_link [String, nil] URL of the author's external profile - # - # @param last_incident [Float, nil] Timestamp of last incident - # - # @param name [String, nil] Author name or identifier - # - # @param profile_picture [String, nil] URL of the author's profile picture - - # @see ModerationAPI::Models::WebhookEvent::AuthorUnblocked::Data::Object::Author#block - class Block < ModerationAPI::Internal::Type::BaseModel - # @!attribute reason - # The moderators reason why the author was blocked or suspended. - # - # @return [String, nil] - optional :reason, String, nil?: true - - # @!attribute until_ - # The timestamp until which they are blocked if the author is suspended. - # - # @return [Float, nil] - optional :until_, Float, api_name: :until, nil?: true - - # @!method initialize(reason: nil, until_: nil) - # Block or suspension details, if applicable. Null if the author is enabled. - # - # @param reason [String, nil] The moderators reason why the author was blocked or suspended. - # - # @param until_ [Float, nil] The timestamp until which they are blocked if the author is suspended. - end - - # @see ModerationAPI::Models::WebhookEvent::AuthorUnblocked::Data::Object::Author#metadata - class Metadata < ModerationAPI::Internal::Type::BaseModel - # @!attribute email_verified - # Whether the author's email is verified - # - # @return [Boolean, nil] - optional :email_verified, ModerationAPI::Internal::Type::Boolean, nil?: true - - # @!attribute identity_verified - # Whether the author's identity is verified - # - # @return [Boolean, nil] - optional :identity_verified, ModerationAPI::Internal::Type::Boolean, nil?: true - - # @!attribute is_paying_customer - # Whether the author is a paying customer - # - # @return [Boolean, nil] - optional :is_paying_customer, ModerationAPI::Internal::Type::Boolean, nil?: true - - # @!attribute phone_verified - # Whether the author's phone number is verified - # - # @return [Boolean, nil] - optional :phone_verified, ModerationAPI::Internal::Type::Boolean, nil?: true - - # @!method initialize(email_verified: nil, identity_verified: nil, is_paying_customer: nil, phone_verified: nil) - # Additional metadata provided by your system. We recommend including any relevant - # information that may assist in the moderation process. - # - # @param email_verified [Boolean, nil] Whether the author's email is verified - # - # @param identity_verified [Boolean, nil] Whether the author's identity is verified - # - # @param is_paying_customer [Boolean, nil] Whether the author is a paying customer - # - # @param phone_verified [Boolean, nil] Whether the author's phone number is verified - end - - # @see ModerationAPI::Models::WebhookEvent::AuthorUnblocked::Data::Object::Author#metrics - class Metrics < ModerationAPI::Internal::Type::BaseModel - # @!attribute flagged_content - # Number of flagged content pieces - # - # @return [Float] - required :flagged_content, Float - - # @!attribute total_content - # Total pieces of content - # - # @return [Float] - required :total_content, Float - - # @!attribute average_sentiment - # Average sentiment score of content (-1 to 1). Requires a sentiment model in your - # project. - # - # @return [Float, nil] - optional :average_sentiment, Float, nil?: true - - # @!method initialize(flagged_content:, total_content:, average_sentiment: nil) - # Some parameter documentations has been truncated, see - # {ModerationAPI::Models::WebhookEvent::AuthorUnblocked::Data::Object::Author::Metrics} - # for more details. - # - # @param flagged_content [Float] Number of flagged content pieces - # - # @param total_content [Float] Total pieces of content - # - # @param average_sentiment [Float, nil] Average sentiment score of content (-1 to 1). Requires a sentiment model in your - end - - # @see ModerationAPI::Models::WebhookEvent::AuthorUnblocked::Data::Object::Author#risk_evaluation - class RiskEvaluation < ModerationAPI::Internal::Type::BaseModel - # @!attribute risk_level - # Calculated risk level based on more than 10 behavioral signals. - # - # @return [Float, nil] - optional :risk_level, Float, nil?: true - - # @!method initialize(risk_level: nil) - # Risk assessment details, if available. - # - # @param risk_level [Float, nil] Calculated risk level based on more than 10 behavioral signals. - end - - # Current author status - # - # @see ModerationAPI::Models::WebhookEvent::AuthorUnblocked::Data::Object::Author#status - module Status - extend ModerationAPI::Internal::Type::Enum - - ENABLED = :enabled - SUSPENDED = :suspended - BLOCKED = :blocked - - # @!method self.values - # @return [Array] - end - - # @see ModerationAPI::Models::WebhookEvent::AuthorUnblocked::Data::Object::Author#trust_level - class TrustLevel < ModerationAPI::Internal::Type::BaseModel - # @!attribute level - # Author trust level (-1, 0, 1, 2, 3, or 4) - # - # @return [Float] - required :level, Float - - # @!attribute manual - # True if the trust level was set manually by a moderator - # - # @return [Boolean] - required :manual, ModerationAPI::Internal::Type::Boolean - - # @!method initialize(level:, manual:) - # @param level [Float] Author trust level (-1, 0, 1, 2, 3, or 4) - # - # @param manual [Boolean] True if the trust level was set manually by a moderator - end - end - - # @see ModerationAPI::Models::WebhookEvent::AuthorUnblocked::Data::Object#queue - class Queue < ModerationAPI::Internal::Type::BaseModel - # @!attribute id - # - # @return [String] - required :id, String - - # @!method initialize(id:) - # The queue the item belongs to, if any - # - # @param id [String] - end - end - end - end - - class AuthorSuspended < ModerationAPI::Internal::Type::BaseModel - # @!attribute id - # Stable event ID. Use this to dedupe retries. - # - # @return [String] - required :id, String - - # @!attribute api_version - # - # @return [Symbol, :v2] - required :api_version, const: :v2 - - # @!attribute created - # ISO 8601 timestamp of when the event was emitted. - # - # @return [Time] - required :created, Time - - # @!attribute data - # - # @return [ModerationAPI::Models::WebhookEvent::AuthorSuspended::Data] - required :data, -> { ModerationAPI::WebhookEvent::AuthorSuspended::Data } - - # @!attribute type - # The event type. - # - # @return [Symbol, :"author.suspended"] - required :type, const: :"author.suspended" - - # @!method initialize(id:, created:, data:, api_version: :v2, type: :"author.suspended") - # @param id [String] Stable event ID. Use this to dedupe retries. - # - # @param created [Time] ISO 8601 timestamp of when the event was emitted. - # - # @param data [ModerationAPI::Models::WebhookEvent::AuthorSuspended::Data] - # - # @param api_version [Symbol, :v2] - # - # @param type [Symbol, :"author.suspended"] The event type. - - # @see ModerationAPI::Models::WebhookEvent::AuthorSuspended#data - class Data < ModerationAPI::Internal::Type::BaseModel - # @!attribute object - # - # @return [ModerationAPI::Models::WebhookEvent::AuthorSuspended::Data::Object] - required :object, -> { ModerationAPI::WebhookEvent::AuthorSuspended::Data::Object } - - # @!method initialize(object:) - # @param object [ModerationAPI::Models::WebhookEvent::AuthorSuspended::Data::Object] - - # @see ModerationAPI::Models::WebhookEvent::AuthorSuspended::Data#object - class Object < ModerationAPI::Internal::Type::BaseModel - # @!attribute id - # Moderation action ID - # - # @return [String] - required :id, String - - # @!attribute author - # The author the action was performed on - # - # @return [ModerationAPI::Models::WebhookEvent::AuthorSuspended::Data::Object::Author] - required :author, -> { ModerationAPI::WebhookEvent::AuthorSuspended::Data::Object::Author } - - # @!attribute created_at - # ISO 8601 timestamp of when the action was performed - # - # @return [Time] - required :created_at, Time - - # @!attribute key - # Customer-defined key identifying this action - # - # @return [String, nil] - required :key, String, nil?: true - - # @!attribute name - # Display name of the action - # - # @return [String, nil] - required :name, String, nil?: true - - # @!attribute value - # The value passed to the action when it ran - # - # @return [String, nil] - required :value, String, nil?: true - - # @!attribute queue - # The queue the item belongs to, if any - # - # @return [ModerationAPI::Models::WebhookEvent::AuthorSuspended::Data::Object::Queue, nil] - optional :queue, -> { ModerationAPI::WebhookEvent::AuthorSuspended::Data::Object::Queue } - - # @!method initialize(id:, author:, created_at:, key:, name:, value:, queue: nil) - # @param id [String] Moderation action ID - # - # @param author [ModerationAPI::Models::WebhookEvent::AuthorSuspended::Data::Object::Author] The author the action was performed on - # - # @param created_at [Time] ISO 8601 timestamp of when the action was performed - # - # @param key [String, nil] Customer-defined key identifying this action - # - # @param name [String, nil] Display name of the action - # - # @param value [String, nil] The value passed to the action when it ran - # - # @param queue [ModerationAPI::Models::WebhookEvent::AuthorSuspended::Data::Object::Queue] The queue the item belongs to, if any - - # @see ModerationAPI::Models::WebhookEvent::AuthorSuspended::Data::Object#author - class Author < ModerationAPI::Internal::Type::BaseModel - # @!attribute id - # Author ID in Moderation API - # - # @return [String] - required :id, String - - # @!attribute block - # Block or suspension details, if applicable. Null if the author is enabled. - # - # @return [ModerationAPI::Models::WebhookEvent::AuthorSuspended::Data::Object::Author::Block, nil] - required :block, - -> { ModerationAPI::WebhookEvent::AuthorSuspended::Data::Object::Author::Block }, - nil?: true - - # @!attribute first_seen - # Timestamp when author first appeared - # - # @return [Float] - required :first_seen, Float - - # @!attribute last_seen - # Timestamp of last activity - # - # @return [Float] - required :last_seen, Float - - # @!attribute metadata - # Additional metadata provided by your system. We recommend including any relevant - # information that may assist in the moderation process. - # - # @return [ModerationAPI::Models::WebhookEvent::AuthorSuspended::Data::Object::Author::Metadata] - required :metadata, -> { ModerationAPI::WebhookEvent::AuthorSuspended::Data::Object::Author::Metadata } - - # @!attribute metrics - # - # @return [ModerationAPI::Models::WebhookEvent::AuthorSuspended::Data::Object::Author::Metrics] - required :metrics, -> { ModerationAPI::WebhookEvent::AuthorSuspended::Data::Object::Author::Metrics } - - # @!attribute risk_evaluation - # Risk assessment details, if available. - # - # @return [ModerationAPI::Models::WebhookEvent::AuthorSuspended::Data::Object::Author::RiskEvaluation, nil] - required :risk_evaluation, - -> { - ModerationAPI::WebhookEvent::AuthorSuspended::Data::Object::Author::RiskEvaluation - }, - nil?: true - - # @!attribute status - # Current author status - # - # @return [Symbol, ModerationAPI::Models::WebhookEvent::AuthorSuspended::Data::Object::Author::Status] - required :status, enum: -> { ModerationAPI::WebhookEvent::AuthorSuspended::Data::Object::Author::Status } - - # @!attribute trust_level - # - # @return [ModerationAPI::Models::WebhookEvent::AuthorSuspended::Data::Object::Author::TrustLevel] - required :trust_level, - -> { ModerationAPI::WebhookEvent::AuthorSuspended::Data::Object::Author::TrustLevel } - - # @!attribute company - # The author's company or organization - # - # @return [String, nil] - optional :company, String, nil?: true - - # @!attribute email - # Author email address - # - # @return [String, nil] - optional :email, String, nil?: true - - # @!attribute external_id - # The author's ID from your system - # - # @return [String, nil] - optional :external_id, String, nil?: true - - # @!attribute external_link - # URL of the author's external profile - # - # @return [String, nil] - optional :external_link, String, nil?: true - - # @!attribute last_incident - # Timestamp of last incident - # - # @return [Float, nil] - optional :last_incident, Float, nil?: true - - # @!attribute name - # Author name or identifier - # - # @return [String, nil] - optional :name, String, nil?: true - - # @!attribute profile_picture - # URL of the author's profile picture - # - # @return [String, nil] - optional :profile_picture, String, nil?: true - - # @!method initialize(id:, block:, first_seen:, last_seen:, metadata:, metrics:, risk_evaluation:, status:, trust_level:, company: nil, email: nil, external_id: nil, external_link: nil, last_incident: nil, name: nil, profile_picture: nil) - # Some parameter documentations has been truncated, see - # {ModerationAPI::Models::WebhookEvent::AuthorSuspended::Data::Object::Author} for - # more details. - # - # The author the action was performed on - # - # @param id [String] Author ID in Moderation API - # - # @param block [ModerationAPI::Models::WebhookEvent::AuthorSuspended::Data::Object::Author::Block, nil] Block or suspension details, if applicable. Null if the author is enabled. - # - # @param first_seen [Float] Timestamp when author first appeared - # - # @param last_seen [Float] Timestamp of last activity - # - # @param metadata [ModerationAPI::Models::WebhookEvent::AuthorSuspended::Data::Object::Author::Metadata] Additional metadata provided by your system. We recommend including any relevant - # - # @param metrics [ModerationAPI::Models::WebhookEvent::AuthorSuspended::Data::Object::Author::Metrics] - # - # @param risk_evaluation [ModerationAPI::Models::WebhookEvent::AuthorSuspended::Data::Object::Author::RiskEvaluation, nil] Risk assessment details, if available. - # - # @param status [Symbol, ModerationAPI::Models::WebhookEvent::AuthorSuspended::Data::Object::Author::Status] Current author status - # - # @param trust_level [ModerationAPI::Models::WebhookEvent::AuthorSuspended::Data::Object::Author::TrustLevel] - # - # @param company [String, nil] The author's company or organization - # - # @param email [String, nil] Author email address - # - # @param external_id [String, nil] The author's ID from your system - # - # @param external_link [String, nil] URL of the author's external profile - # - # @param last_incident [Float, nil] Timestamp of last incident - # - # @param name [String, nil] Author name or identifier - # - # @param profile_picture [String, nil] URL of the author's profile picture - - # @see ModerationAPI::Models::WebhookEvent::AuthorSuspended::Data::Object::Author#block - class Block < ModerationAPI::Internal::Type::BaseModel - # @!attribute reason - # The moderators reason why the author was blocked or suspended. - # - # @return [String, nil] - optional :reason, String, nil?: true - - # @!attribute until_ - # The timestamp until which they are blocked if the author is suspended. - # - # @return [Float, nil] - optional :until_, Float, api_name: :until, nil?: true - - # @!method initialize(reason: nil, until_: nil) - # Block or suspension details, if applicable. Null if the author is enabled. - # - # @param reason [String, nil] The moderators reason why the author was blocked or suspended. - # - # @param until_ [Float, nil] The timestamp until which they are blocked if the author is suspended. - end - - # @see ModerationAPI::Models::WebhookEvent::AuthorSuspended::Data::Object::Author#metadata - class Metadata < ModerationAPI::Internal::Type::BaseModel - # @!attribute email_verified - # Whether the author's email is verified - # - # @return [Boolean, nil] - optional :email_verified, ModerationAPI::Internal::Type::Boolean, nil?: true - - # @!attribute identity_verified - # Whether the author's identity is verified - # - # @return [Boolean, nil] - optional :identity_verified, ModerationAPI::Internal::Type::Boolean, nil?: true - - # @!attribute is_paying_customer - # Whether the author is a paying customer - # - # @return [Boolean, nil] - optional :is_paying_customer, ModerationAPI::Internal::Type::Boolean, nil?: true - - # @!attribute phone_verified - # Whether the author's phone number is verified - # - # @return [Boolean, nil] - optional :phone_verified, ModerationAPI::Internal::Type::Boolean, nil?: true - - # @!method initialize(email_verified: nil, identity_verified: nil, is_paying_customer: nil, phone_verified: nil) - # Additional metadata provided by your system. We recommend including any relevant - # information that may assist in the moderation process. - # - # @param email_verified [Boolean, nil] Whether the author's email is verified - # - # @param identity_verified [Boolean, nil] Whether the author's identity is verified - # - # @param is_paying_customer [Boolean, nil] Whether the author is a paying customer - # - # @param phone_verified [Boolean, nil] Whether the author's phone number is verified - end - - # @see ModerationAPI::Models::WebhookEvent::AuthorSuspended::Data::Object::Author#metrics - class Metrics < ModerationAPI::Internal::Type::BaseModel - # @!attribute flagged_content - # Number of flagged content pieces - # - # @return [Float] - required :flagged_content, Float - - # @!attribute total_content - # Total pieces of content - # - # @return [Float] - required :total_content, Float - - # @!attribute average_sentiment - # Average sentiment score of content (-1 to 1). Requires a sentiment model in your - # project. - # - # @return [Float, nil] - optional :average_sentiment, Float, nil?: true - - # @!method initialize(flagged_content:, total_content:, average_sentiment: nil) - # Some parameter documentations has been truncated, see - # {ModerationAPI::Models::WebhookEvent::AuthorSuspended::Data::Object::Author::Metrics} - # for more details. - # - # @param flagged_content [Float] Number of flagged content pieces - # - # @param total_content [Float] Total pieces of content - # - # @param average_sentiment [Float, nil] Average sentiment score of content (-1 to 1). Requires a sentiment model in your - end - - # @see ModerationAPI::Models::WebhookEvent::AuthorSuspended::Data::Object::Author#risk_evaluation - class RiskEvaluation < ModerationAPI::Internal::Type::BaseModel - # @!attribute risk_level - # Calculated risk level based on more than 10 behavioral signals. - # - # @return [Float, nil] - optional :risk_level, Float, nil?: true - - # @!method initialize(risk_level: nil) - # Risk assessment details, if available. - # - # @param risk_level [Float, nil] Calculated risk level based on more than 10 behavioral signals. - end - - # Current author status - # - # @see ModerationAPI::Models::WebhookEvent::AuthorSuspended::Data::Object::Author#status - module Status - extend ModerationAPI::Internal::Type::Enum - - ENABLED = :enabled - SUSPENDED = :suspended - BLOCKED = :blocked - - # @!method self.values - # @return [Array] - end - - # @see ModerationAPI::Models::WebhookEvent::AuthorSuspended::Data::Object::Author#trust_level - class TrustLevel < ModerationAPI::Internal::Type::BaseModel - # @!attribute level - # Author trust level (-1, 0, 1, 2, 3, or 4) - # - # @return [Float] - required :level, Float - - # @!attribute manual - # True if the trust level was set manually by a moderator - # - # @return [Boolean] - required :manual, ModerationAPI::Internal::Type::Boolean - - # @!method initialize(level:, manual:) - # @param level [Float] Author trust level (-1, 0, 1, 2, 3, or 4) - # - # @param manual [Boolean] True if the trust level was set manually by a moderator - end - end - - # @see ModerationAPI::Models::WebhookEvent::AuthorSuspended::Data::Object#queue - class Queue < ModerationAPI::Internal::Type::BaseModel - # @!attribute id - # - # @return [String] - required :id, String - - # @!method initialize(id:) - # The queue the item belongs to, if any - # - # @param id [String] - end - end - end - end - - class AuthorUpdated < ModerationAPI::Internal::Type::BaseModel - # @!attribute id - # Stable event ID. Use this to dedupe retries. - # - # @return [String] - required :id, String - - # @!attribute api_version - # - # @return [Symbol, :v2] - required :api_version, const: :v2 - - # @!attribute created - # ISO 8601 timestamp of when the event was emitted. - # - # @return [Time] - required :created, Time - - # @!attribute data - # - # @return [ModerationAPI::Models::WebhookEvent::AuthorUpdated::Data] - required :data, -> { ModerationAPI::WebhookEvent::AuthorUpdated::Data } - - # @!attribute type - # The event type. - # - # @return [Symbol, :"author.updated"] - required :type, const: :"author.updated" - - # @!method initialize(id:, created:, data:, api_version: :v2, type: :"author.updated") - # @param id [String] Stable event ID. Use this to dedupe retries. - # - # @param created [Time] ISO 8601 timestamp of when the event was emitted. - # - # @param data [ModerationAPI::Models::WebhookEvent::AuthorUpdated::Data] - # - # @param api_version [Symbol, :v2] - # - # @param type [Symbol, :"author.updated"] The event type. - - # @see ModerationAPI::Models::WebhookEvent::AuthorUpdated#data - class Data < ModerationAPI::Internal::Type::BaseModel - # @!attribute object - # - # @return [ModerationAPI::Models::WebhookEvent::AuthorUpdated::Data::Object] - required :object, -> { ModerationAPI::WebhookEvent::AuthorUpdated::Data::Object } - - # @!method initialize(object:) - # @param object [ModerationAPI::Models::WebhookEvent::AuthorUpdated::Data::Object] - - # @see ModerationAPI::Models::WebhookEvent::AuthorUpdated::Data#object - class Object < ModerationAPI::Internal::Type::BaseModel - # @!attribute id - # Author ID in Moderation API - # - # @return [String] - required :id, String - - # @!attribute block - # Block or suspension details, if applicable. Null if the author is enabled. - # - # @return [ModerationAPI::Models::WebhookEvent::AuthorUpdated::Data::Object::Block, nil] - required :block, - -> { - ModerationAPI::WebhookEvent::AuthorUpdated::Data::Object::Block - }, - nil?: true - - # @!attribute first_seen - # Timestamp when author first appeared - # - # @return [Float] - required :first_seen, Float - - # @!attribute last_seen - # Timestamp of last activity - # - # @return [Float] - required :last_seen, Float - - # @!attribute metadata - # Additional metadata provided by your system. We recommend including any relevant - # information that may assist in the moderation process. - # - # @return [ModerationAPI::Models::WebhookEvent::AuthorUpdated::Data::Object::Metadata] - required :metadata, -> { ModerationAPI::WebhookEvent::AuthorUpdated::Data::Object::Metadata } - - # @!attribute metrics - # - # @return [ModerationAPI::Models::WebhookEvent::AuthorUpdated::Data::Object::Metrics] - required :metrics, -> { ModerationAPI::WebhookEvent::AuthorUpdated::Data::Object::Metrics } - - # @!attribute risk_evaluation - # Risk assessment details, if available. - # - # @return [ModerationAPI::Models::WebhookEvent::AuthorUpdated::Data::Object::RiskEvaluation, nil] - required :risk_evaluation, - -> { ModerationAPI::WebhookEvent::AuthorUpdated::Data::Object::RiskEvaluation }, - nil?: true - - # @!attribute status - # Current author status - # - # @return [Symbol, ModerationAPI::Models::WebhookEvent::AuthorUpdated::Data::Object::Status] - required :status, enum: -> { ModerationAPI::WebhookEvent::AuthorUpdated::Data::Object::Status } - - # @!attribute trust_level - # - # @return [ModerationAPI::Models::WebhookEvent::AuthorUpdated::Data::Object::TrustLevel] - required :trust_level, -> { ModerationAPI::WebhookEvent::AuthorUpdated::Data::Object::TrustLevel } - - # @!attribute company - # The author's company or organization - # - # @return [String, nil] - optional :company, String, nil?: true - - # @!attribute email - # Author email address - # - # @return [String, nil] - optional :email, String, nil?: true - - # @!attribute external_id - # The author's ID from your system - # - # @return [String, nil] - optional :external_id, String, nil?: true - - # @!attribute external_link - # URL of the author's external profile - # - # @return [String, nil] - optional :external_link, String, nil?: true - - # @!attribute last_incident - # Timestamp of last incident - # - # @return [Float, nil] - optional :last_incident, Float, nil?: true - - # @!attribute name - # Author name or identifier - # - # @return [String, nil] - optional :name, String, nil?: true - - # @!attribute profile_picture - # URL of the author's profile picture - # - # @return [String, nil] - optional :profile_picture, String, nil?: true - - # @!method initialize(id:, block:, first_seen:, last_seen:, metadata:, metrics:, risk_evaluation:, status:, trust_level:, company: nil, email: nil, external_id: nil, external_link: nil, last_incident: nil, name: nil, profile_picture: nil) - # Some parameter documentations has been truncated, see - # {ModerationAPI::Models::WebhookEvent::AuthorUpdated::Data::Object} for more - # details. - # - # @param id [String] Author ID in Moderation API - # - # @param block [ModerationAPI::Models::WebhookEvent::AuthorUpdated::Data::Object::Block, nil] Block or suspension details, if applicable. Null if the author is enabled. - # - # @param first_seen [Float] Timestamp when author first appeared - # - # @param last_seen [Float] Timestamp of last activity - # - # @param metadata [ModerationAPI::Models::WebhookEvent::AuthorUpdated::Data::Object::Metadata] Additional metadata provided by your system. We recommend including any relevant - # - # @param metrics [ModerationAPI::Models::WebhookEvent::AuthorUpdated::Data::Object::Metrics] - # - # @param risk_evaluation [ModerationAPI::Models::WebhookEvent::AuthorUpdated::Data::Object::RiskEvaluation, nil] Risk assessment details, if available. - # - # @param status [Symbol, ModerationAPI::Models::WebhookEvent::AuthorUpdated::Data::Object::Status] Current author status - # - # @param trust_level [ModerationAPI::Models::WebhookEvent::AuthorUpdated::Data::Object::TrustLevel] - # - # @param company [String, nil] The author's company or organization - # - # @param email [String, nil] Author email address - # - # @param external_id [String, nil] The author's ID from your system - # - # @param external_link [String, nil] URL of the author's external profile - # - # @param last_incident [Float, nil] Timestamp of last incident - # - # @param name [String, nil] Author name or identifier - # - # @param profile_picture [String, nil] URL of the author's profile picture - - # @see ModerationAPI::Models::WebhookEvent::AuthorUpdated::Data::Object#block - class Block < ModerationAPI::Internal::Type::BaseModel - # @!attribute reason - # The moderators reason why the author was blocked or suspended. - # - # @return [String, nil] - optional :reason, String, nil?: true - - # @!attribute until_ - # The timestamp until which they are blocked if the author is suspended. - # - # @return [Float, nil] - optional :until_, Float, api_name: :until, nil?: true - - # @!method initialize(reason: nil, until_: nil) - # Block or suspension details, if applicable. Null if the author is enabled. - # - # @param reason [String, nil] The moderators reason why the author was blocked or suspended. - # - # @param until_ [Float, nil] The timestamp until which they are blocked if the author is suspended. - end - - # @see ModerationAPI::Models::WebhookEvent::AuthorUpdated::Data::Object#metadata - class Metadata < ModerationAPI::Internal::Type::BaseModel - # @!attribute email_verified - # Whether the author's email is verified - # - # @return [Boolean, nil] - optional :email_verified, ModerationAPI::Internal::Type::Boolean, nil?: true - - # @!attribute identity_verified - # Whether the author's identity is verified - # - # @return [Boolean, nil] - optional :identity_verified, ModerationAPI::Internal::Type::Boolean, nil?: true - - # @!attribute is_paying_customer - # Whether the author is a paying customer - # - # @return [Boolean, nil] - optional :is_paying_customer, ModerationAPI::Internal::Type::Boolean, nil?: true - - # @!attribute phone_verified - # Whether the author's phone number is verified - # - # @return [Boolean, nil] - optional :phone_verified, ModerationAPI::Internal::Type::Boolean, nil?: true - - # @!method initialize(email_verified: nil, identity_verified: nil, is_paying_customer: nil, phone_verified: nil) - # Additional metadata provided by your system. We recommend including any relevant - # information that may assist in the moderation process. - # - # @param email_verified [Boolean, nil] Whether the author's email is verified - # - # @param identity_verified [Boolean, nil] Whether the author's identity is verified - # - # @param is_paying_customer [Boolean, nil] Whether the author is a paying customer - # - # @param phone_verified [Boolean, nil] Whether the author's phone number is verified - end - - # @see ModerationAPI::Models::WebhookEvent::AuthorUpdated::Data::Object#metrics - class Metrics < ModerationAPI::Internal::Type::BaseModel - # @!attribute flagged_content - # Number of flagged content pieces - # - # @return [Float] - required :flagged_content, Float - - # @!attribute total_content - # Total pieces of content - # - # @return [Float] - required :total_content, Float - - # @!attribute average_sentiment - # Average sentiment score of content (-1 to 1). Requires a sentiment model in your - # project. - # - # @return [Float, nil] - optional :average_sentiment, Float, nil?: true - - # @!method initialize(flagged_content:, total_content:, average_sentiment: nil) - # Some parameter documentations has been truncated, see - # {ModerationAPI::Models::WebhookEvent::AuthorUpdated::Data::Object::Metrics} for - # more details. - # - # @param flagged_content [Float] Number of flagged content pieces - # - # @param total_content [Float] Total pieces of content - # - # @param average_sentiment [Float, nil] Average sentiment score of content (-1 to 1). Requires a sentiment model in your - end - - # @see ModerationAPI::Models::WebhookEvent::AuthorUpdated::Data::Object#risk_evaluation - class RiskEvaluation < ModerationAPI::Internal::Type::BaseModel - # @!attribute risk_level - # Calculated risk level based on more than 10 behavioral signals. - # - # @return [Float, nil] - optional :risk_level, Float, nil?: true - - # @!method initialize(risk_level: nil) - # Risk assessment details, if available. - # - # @param risk_level [Float, nil] Calculated risk level based on more than 10 behavioral signals. - end - - # Current author status - # - # @see ModerationAPI::Models::WebhookEvent::AuthorUpdated::Data::Object#status - module Status - extend ModerationAPI::Internal::Type::Enum - - ENABLED = :enabled - SUSPENDED = :suspended - BLOCKED = :blocked - - # @!method self.values - # @return [Array] - end - - # @see ModerationAPI::Models::WebhookEvent::AuthorUpdated::Data::Object#trust_level - class TrustLevel < ModerationAPI::Internal::Type::BaseModel - # @!attribute level - # Author trust level (-1, 0, 1, 2, 3, or 4) - # - # @return [Float] - required :level, Float - - # @!attribute manual - # True if the trust level was set manually by a moderator - # - # @return [Boolean] - required :manual, ModerationAPI::Internal::Type::Boolean - - # @!method initialize(level:, manual:) - # @param level [Float] Author trust level (-1, 0, 1, 2, 3, or 4) - # - # @param manual [Boolean] True if the trust level was set manually by a moderator - end - end - end - end - - class AuthorTrustLevelChanged < ModerationAPI::Internal::Type::BaseModel - # @!attribute id - # Stable event ID. Use this to dedupe retries. - # - # @return [String] - required :id, String - - # @!attribute api_version - # - # @return [Symbol, :v2] - required :api_version, const: :v2 - - # @!attribute created - # ISO 8601 timestamp of when the event was emitted. - # - # @return [Time] - required :created, Time - - # @!attribute data - # - # @return [ModerationAPI::Models::WebhookEvent::AuthorTrustLevelChanged::Data] - required :data, -> { ModerationAPI::WebhookEvent::AuthorTrustLevelChanged::Data } - - # @!attribute type - # The event type. - # - # @return [Symbol, :"author.trust_level_changed"] - required :type, const: :"author.trust_level_changed" - - # @!method initialize(id:, created:, data:, api_version: :v2, type: :"author.trust_level_changed") - # @param id [String] Stable event ID. Use this to dedupe retries. - # - # @param created [Time] ISO 8601 timestamp of when the event was emitted. - # - # @param data [ModerationAPI::Models::WebhookEvent::AuthorTrustLevelChanged::Data] - # - # @param api_version [Symbol, :v2] - # - # @param type [Symbol, :"author.trust_level_changed"] The event type. - - # @see ModerationAPI::Models::WebhookEvent::AuthorTrustLevelChanged#data - class Data < ModerationAPI::Internal::Type::BaseModel - # @!attribute object - # - # @return [ModerationAPI::Models::WebhookEvent::AuthorTrustLevelChanged::Data::Object] - required :object, -> { ModerationAPI::WebhookEvent::AuthorTrustLevelChanged::Data::Object } - - # @!method initialize(object:) - # @param object [ModerationAPI::Models::WebhookEvent::AuthorTrustLevelChanged::Data::Object] - - # @see ModerationAPI::Models::WebhookEvent::AuthorTrustLevelChanged::Data#object - class Object < ModerationAPI::Internal::Type::BaseModel - # @!attribute id - # Author ID in Moderation API - # - # @return [String] - required :id, String - - # @!attribute block - # Block or suspension details, if applicable. Null if the author is enabled. - # - # @return [ModerationAPI::Models::WebhookEvent::AuthorTrustLevelChanged::Data::Object::Block, nil] - required :block, - -> { ModerationAPI::WebhookEvent::AuthorTrustLevelChanged::Data::Object::Block }, - nil?: true - - # @!attribute first_seen - # Timestamp when author first appeared - # - # @return [Float] - required :first_seen, Float - - # @!attribute last_seen - # Timestamp of last activity - # - # @return [Float] - required :last_seen, Float - - # @!attribute metadata - # Additional metadata provided by your system. We recommend including any relevant - # information that may assist in the moderation process. - # - # @return [ModerationAPI::Models::WebhookEvent::AuthorTrustLevelChanged::Data::Object::Metadata] - required :metadata, -> { ModerationAPI::WebhookEvent::AuthorTrustLevelChanged::Data::Object::Metadata } - - # @!attribute metrics - # - # @return [ModerationAPI::Models::WebhookEvent::AuthorTrustLevelChanged::Data::Object::Metrics] - required :metrics, -> { ModerationAPI::WebhookEvent::AuthorTrustLevelChanged::Data::Object::Metrics } - - # @!attribute risk_evaluation - # Risk assessment details, if available. - # - # @return [ModerationAPI::Models::WebhookEvent::AuthorTrustLevelChanged::Data::Object::RiskEvaluation, nil] - required :risk_evaluation, - -> { - ModerationAPI::WebhookEvent::AuthorTrustLevelChanged::Data::Object::RiskEvaluation - }, - nil?: true - - # @!attribute status - # Current author status - # - # @return [Symbol, ModerationAPI::Models::WebhookEvent::AuthorTrustLevelChanged::Data::Object::Status] - required :status, enum: -> { ModerationAPI::WebhookEvent::AuthorTrustLevelChanged::Data::Object::Status } - - # @!attribute trust_level - # - # @return [ModerationAPI::Models::WebhookEvent::AuthorTrustLevelChanged::Data::Object::TrustLevel] - required :trust_level, - -> { ModerationAPI::WebhookEvent::AuthorTrustLevelChanged::Data::Object::TrustLevel } - - # @!attribute company - # The author's company or organization - # - # @return [String, nil] - optional :company, String, nil?: true - - # @!attribute email - # Author email address - # - # @return [String, nil] - optional :email, String, nil?: true - - # @!attribute external_id - # The author's ID from your system - # - # @return [String, nil] - optional :external_id, String, nil?: true - - # @!attribute external_link - # URL of the author's external profile - # - # @return [String, nil] - optional :external_link, String, nil?: true - - # @!attribute last_incident - # Timestamp of last incident - # - # @return [Float, nil] - optional :last_incident, Float, nil?: true - - # @!attribute name - # Author name or identifier - # - # @return [String, nil] - optional :name, String, nil?: true - - # @!attribute profile_picture - # URL of the author's profile picture - # - # @return [String, nil] - optional :profile_picture, String, nil?: true - - # @!method initialize(id:, block:, first_seen:, last_seen:, metadata:, metrics:, risk_evaluation:, status:, trust_level:, company: nil, email: nil, external_id: nil, external_link: nil, last_incident: nil, name: nil, profile_picture: nil) - # Some parameter documentations has been truncated, see - # {ModerationAPI::Models::WebhookEvent::AuthorTrustLevelChanged::Data::Object} for - # more details. - # - # @param id [String] Author ID in Moderation API - # - # @param block [ModerationAPI::Models::WebhookEvent::AuthorTrustLevelChanged::Data::Object::Block, nil] Block or suspension details, if applicable. Null if the author is enabled. - # - # @param first_seen [Float] Timestamp when author first appeared - # - # @param last_seen [Float] Timestamp of last activity - # - # @param metadata [ModerationAPI::Models::WebhookEvent::AuthorTrustLevelChanged::Data::Object::Metadata] Additional metadata provided by your system. We recommend including any relevant - # - # @param metrics [ModerationAPI::Models::WebhookEvent::AuthorTrustLevelChanged::Data::Object::Metrics] - # - # @param risk_evaluation [ModerationAPI::Models::WebhookEvent::AuthorTrustLevelChanged::Data::Object::RiskEvaluation, nil] Risk assessment details, if available. - # - # @param status [Symbol, ModerationAPI::Models::WebhookEvent::AuthorTrustLevelChanged::Data::Object::Status] Current author status - # - # @param trust_level [ModerationAPI::Models::WebhookEvent::AuthorTrustLevelChanged::Data::Object::TrustLevel] - # - # @param company [String, nil] The author's company or organization - # - # @param email [String, nil] Author email address - # - # @param external_id [String, nil] The author's ID from your system - # - # @param external_link [String, nil] URL of the author's external profile - # - # @param last_incident [Float, nil] Timestamp of last incident - # - # @param name [String, nil] Author name or identifier - # - # @param profile_picture [String, nil] URL of the author's profile picture - - # @see ModerationAPI::Models::WebhookEvent::AuthorTrustLevelChanged::Data::Object#block - class Block < ModerationAPI::Internal::Type::BaseModel - # @!attribute reason - # The moderators reason why the author was blocked or suspended. - # - # @return [String, nil] - optional :reason, String, nil?: true - - # @!attribute until_ - # The timestamp until which they are blocked if the author is suspended. - # - # @return [Float, nil] - optional :until_, Float, api_name: :until, nil?: true - - # @!method initialize(reason: nil, until_: nil) - # Block or suspension details, if applicable. Null if the author is enabled. - # - # @param reason [String, nil] The moderators reason why the author was blocked or suspended. - # - # @param until_ [Float, nil] The timestamp until which they are blocked if the author is suspended. - end - - # @see ModerationAPI::Models::WebhookEvent::AuthorTrustLevelChanged::Data::Object#metadata - class Metadata < ModerationAPI::Internal::Type::BaseModel - # @!attribute email_verified - # Whether the author's email is verified - # - # @return [Boolean, nil] - optional :email_verified, ModerationAPI::Internal::Type::Boolean, nil?: true - - # @!attribute identity_verified - # Whether the author's identity is verified - # - # @return [Boolean, nil] - optional :identity_verified, ModerationAPI::Internal::Type::Boolean, nil?: true - - # @!attribute is_paying_customer - # Whether the author is a paying customer - # - # @return [Boolean, nil] - optional :is_paying_customer, ModerationAPI::Internal::Type::Boolean, nil?: true - - # @!attribute phone_verified - # Whether the author's phone number is verified - # - # @return [Boolean, nil] - optional :phone_verified, ModerationAPI::Internal::Type::Boolean, nil?: true - - # @!method initialize(email_verified: nil, identity_verified: nil, is_paying_customer: nil, phone_verified: nil) - # Additional metadata provided by your system. We recommend including any relevant - # information that may assist in the moderation process. - # - # @param email_verified [Boolean, nil] Whether the author's email is verified - # - # @param identity_verified [Boolean, nil] Whether the author's identity is verified - # - # @param is_paying_customer [Boolean, nil] Whether the author is a paying customer - # - # @param phone_verified [Boolean, nil] Whether the author's phone number is verified - end - - # @see ModerationAPI::Models::WebhookEvent::AuthorTrustLevelChanged::Data::Object#metrics - class Metrics < ModerationAPI::Internal::Type::BaseModel - # @!attribute flagged_content - # Number of flagged content pieces - # - # @return [Float] - required :flagged_content, Float - - # @!attribute total_content - # Total pieces of content - # - # @return [Float] - required :total_content, Float - - # @!attribute average_sentiment - # Average sentiment score of content (-1 to 1). Requires a sentiment model in your - # project. - # - # @return [Float, nil] - optional :average_sentiment, Float, nil?: true - - # @!method initialize(flagged_content:, total_content:, average_sentiment: nil) - # Some parameter documentations has been truncated, see - # {ModerationAPI::Models::WebhookEvent::AuthorTrustLevelChanged::Data::Object::Metrics} - # for more details. - # - # @param flagged_content [Float] Number of flagged content pieces - # - # @param total_content [Float] Total pieces of content - # - # @param average_sentiment [Float, nil] Average sentiment score of content (-1 to 1). Requires a sentiment model in your - end - - # @see ModerationAPI::Models::WebhookEvent::AuthorTrustLevelChanged::Data::Object#risk_evaluation - class RiskEvaluation < ModerationAPI::Internal::Type::BaseModel - # @!attribute risk_level - # Calculated risk level based on more than 10 behavioral signals. - # - # @return [Float, nil] - optional :risk_level, Float, nil?: true - - # @!method initialize(risk_level: nil) - # Risk assessment details, if available. - # - # @param risk_level [Float, nil] Calculated risk level based on more than 10 behavioral signals. - end - - # Current author status - # - # @see ModerationAPI::Models::WebhookEvent::AuthorTrustLevelChanged::Data::Object#status - module Status - extend ModerationAPI::Internal::Type::Enum - - ENABLED = :enabled - SUSPENDED = :suspended - BLOCKED = :blocked - - # @!method self.values - # @return [Array] - end - - # @see ModerationAPI::Models::WebhookEvent::AuthorTrustLevelChanged::Data::Object#trust_level - class TrustLevel < ModerationAPI::Internal::Type::BaseModel - # @!attribute level - # Author trust level (-1, 0, 1, 2, 3, or 4) - # - # @return [Float] - required :level, Float - - # @!attribute manual - # True if the trust level was set manually by a moderator - # - # @return [Boolean] - required :manual, ModerationAPI::Internal::Type::Boolean - - # @!method initialize(level:, manual:) - # @param level [Float] Author trust level (-1, 0, 1, 2, 3, or 4) - # - # @param manual [Boolean] True if the trust level was set manually by a moderator - end - end - end - end - - class AuthorAction < ModerationAPI::Internal::Type::BaseModel - # @!attribute id - # Stable event ID. Use this to dedupe retries. - # - # @return [String] - required :id, String - - # @!attribute api_version - # - # @return [Symbol, :v2] - required :api_version, const: :v2 - - # @!attribute created - # ISO 8601 timestamp of when the event was emitted. - # - # @return [Time] - required :created, Time - - # @!attribute data - # - # @return [ModerationAPI::Models::WebhookEvent::AuthorAction::Data] - required :data, -> { ModerationAPI::WebhookEvent::AuthorAction::Data } - - # @!attribute type - # The event type. - # - # @return [Symbol, :"author.action"] - required :type, const: :"author.action" - - # @!method initialize(id:, created:, data:, api_version: :v2, type: :"author.action") - # @param id [String] Stable event ID. Use this to dedupe retries. - # - # @param created [Time] ISO 8601 timestamp of when the event was emitted. - # - # @param data [ModerationAPI::Models::WebhookEvent::AuthorAction::Data] - # - # @param api_version [Symbol, :v2] - # - # @param type [Symbol, :"author.action"] The event type. - - # @see ModerationAPI::Models::WebhookEvent::AuthorAction#data - class Data < ModerationAPI::Internal::Type::BaseModel - # @!attribute object - # - # @return [ModerationAPI::Models::WebhookEvent::AuthorAction::Data::Object] - required :object, -> { ModerationAPI::WebhookEvent::AuthorAction::Data::Object } - - # @!method initialize(object:) - # @param object [ModerationAPI::Models::WebhookEvent::AuthorAction::Data::Object] - - # @see ModerationAPI::Models::WebhookEvent::AuthorAction::Data#object - class Object < ModerationAPI::Internal::Type::BaseModel - # @!attribute id - # Moderation action ID - # - # @return [String] - required :id, String - - # @!attribute author - # The author the action was performed on - # - # @return [ModerationAPI::Models::WebhookEvent::AuthorAction::Data::Object::Author] - required :author, -> { ModerationAPI::WebhookEvent::AuthorAction::Data::Object::Author } - - # @!attribute created_at - # ISO 8601 timestamp of when the action was performed - # - # @return [Time] - required :created_at, Time - - # @!attribute key - # Customer-defined key identifying this action - # - # @return [String, nil] - required :key, String, nil?: true - - # @!attribute name - # Display name of the action - # - # @return [String, nil] - required :name, String, nil?: true - - # @!attribute value - # The value passed to the action when it ran - # - # @return [String, nil] - required :value, String, nil?: true - - # @!attribute queue - # The queue the item belongs to, if any - # - # @return [ModerationAPI::Models::WebhookEvent::AuthorAction::Data::Object::Queue, nil] - optional :queue, -> { ModerationAPI::WebhookEvent::AuthorAction::Data::Object::Queue } - - # @!method initialize(id:, author:, created_at:, key:, name:, value:, queue: nil) - # @param id [String] Moderation action ID - # - # @param author [ModerationAPI::Models::WebhookEvent::AuthorAction::Data::Object::Author] The author the action was performed on - # - # @param created_at [Time] ISO 8601 timestamp of when the action was performed - # - # @param key [String, nil] Customer-defined key identifying this action - # - # @param name [String, nil] Display name of the action - # - # @param value [String, nil] The value passed to the action when it ran - # - # @param queue [ModerationAPI::Models::WebhookEvent::AuthorAction::Data::Object::Queue] The queue the item belongs to, if any - - # @see ModerationAPI::Models::WebhookEvent::AuthorAction::Data::Object#author - class Author < ModerationAPI::Internal::Type::BaseModel - # @!attribute id - # Author ID in Moderation API - # - # @return [String] - required :id, String - - # @!attribute block - # Block or suspension details, if applicable. Null if the author is enabled. - # - # @return [ModerationAPI::Models::WebhookEvent::AuthorAction::Data::Object::Author::Block, nil] - required :block, - -> { - ModerationAPI::WebhookEvent::AuthorAction::Data::Object::Author::Block - }, - nil?: true - - # @!attribute first_seen - # Timestamp when author first appeared - # - # @return [Float] - required :first_seen, Float - - # @!attribute last_seen - # Timestamp of last activity - # - # @return [Float] - required :last_seen, Float - - # @!attribute metadata - # Additional metadata provided by your system. We recommend including any relevant - # information that may assist in the moderation process. - # - # @return [ModerationAPI::Models::WebhookEvent::AuthorAction::Data::Object::Author::Metadata] - required :metadata, -> { ModerationAPI::WebhookEvent::AuthorAction::Data::Object::Author::Metadata } - - # @!attribute metrics - # - # @return [ModerationAPI::Models::WebhookEvent::AuthorAction::Data::Object::Author::Metrics] - required :metrics, -> { ModerationAPI::WebhookEvent::AuthorAction::Data::Object::Author::Metrics } - - # @!attribute risk_evaluation - # Risk assessment details, if available. - # - # @return [ModerationAPI::Models::WebhookEvent::AuthorAction::Data::Object::Author::RiskEvaluation, nil] - required :risk_evaluation, - -> { ModerationAPI::WebhookEvent::AuthorAction::Data::Object::Author::RiskEvaluation }, - nil?: true - - # @!attribute status - # Current author status - # - # @return [Symbol, ModerationAPI::Models::WebhookEvent::AuthorAction::Data::Object::Author::Status] - required :status, enum: -> { ModerationAPI::WebhookEvent::AuthorAction::Data::Object::Author::Status } - - # @!attribute trust_level - # - # @return [ModerationAPI::Models::WebhookEvent::AuthorAction::Data::Object::Author::TrustLevel] - required :trust_level, -> { ModerationAPI::WebhookEvent::AuthorAction::Data::Object::Author::TrustLevel } - - # @!attribute company - # The author's company or organization - # - # @return [String, nil] - optional :company, String, nil?: true - - # @!attribute email - # Author email address - # - # @return [String, nil] - optional :email, String, nil?: true - - # @!attribute external_id - # The author's ID from your system - # - # @return [String, nil] - optional :external_id, String, nil?: true - - # @!attribute external_link - # URL of the author's external profile - # - # @return [String, nil] - optional :external_link, String, nil?: true - - # @!attribute last_incident - # Timestamp of last incident - # - # @return [Float, nil] - optional :last_incident, Float, nil?: true - - # @!attribute name - # Author name or identifier - # - # @return [String, nil] - optional :name, String, nil?: true - - # @!attribute profile_picture - # URL of the author's profile picture - # - # @return [String, nil] - optional :profile_picture, String, nil?: true - - # @!method initialize(id:, block:, first_seen:, last_seen:, metadata:, metrics:, risk_evaluation:, status:, trust_level:, company: nil, email: nil, external_id: nil, external_link: nil, last_incident: nil, name: nil, profile_picture: nil) - # Some parameter documentations has been truncated, see - # {ModerationAPI::Models::WebhookEvent::AuthorAction::Data::Object::Author} for - # more details. - # - # The author the action was performed on - # - # @param id [String] Author ID in Moderation API - # - # @param block [ModerationAPI::Models::WebhookEvent::AuthorAction::Data::Object::Author::Block, nil] Block or suspension details, if applicable. Null if the author is enabled. - # - # @param first_seen [Float] Timestamp when author first appeared - # - # @param last_seen [Float] Timestamp of last activity - # - # @param metadata [ModerationAPI::Models::WebhookEvent::AuthorAction::Data::Object::Author::Metadata] Additional metadata provided by your system. We recommend including any relevant - # - # @param metrics [ModerationAPI::Models::WebhookEvent::AuthorAction::Data::Object::Author::Metrics] - # - # @param risk_evaluation [ModerationAPI::Models::WebhookEvent::AuthorAction::Data::Object::Author::RiskEvaluation, nil] Risk assessment details, if available. - # - # @param status [Symbol, ModerationAPI::Models::WebhookEvent::AuthorAction::Data::Object::Author::Status] Current author status - # - # @param trust_level [ModerationAPI::Models::WebhookEvent::AuthorAction::Data::Object::Author::TrustLevel] - # - # @param company [String, nil] The author's company or organization - # - # @param email [String, nil] Author email address - # - # @param external_id [String, nil] The author's ID from your system - # - # @param external_link [String, nil] URL of the author's external profile - # - # @param last_incident [Float, nil] Timestamp of last incident - # - # @param name [String, nil] Author name or identifier - # - # @param profile_picture [String, nil] URL of the author's profile picture - - # @see ModerationAPI::Models::WebhookEvent::AuthorAction::Data::Object::Author#block - class Block < ModerationAPI::Internal::Type::BaseModel - # @!attribute reason - # The moderators reason why the author was blocked or suspended. - # - # @return [String, nil] - optional :reason, String, nil?: true - - # @!attribute until_ - # The timestamp until which they are blocked if the author is suspended. - # - # @return [Float, nil] - optional :until_, Float, api_name: :until, nil?: true - - # @!method initialize(reason: nil, until_: nil) - # Block or suspension details, if applicable. Null if the author is enabled. - # - # @param reason [String, nil] The moderators reason why the author was blocked or suspended. - # - # @param until_ [Float, nil] The timestamp until which they are blocked if the author is suspended. - end - - # @see ModerationAPI::Models::WebhookEvent::AuthorAction::Data::Object::Author#metadata - class Metadata < ModerationAPI::Internal::Type::BaseModel - # @!attribute email_verified - # Whether the author's email is verified - # - # @return [Boolean, nil] - optional :email_verified, ModerationAPI::Internal::Type::Boolean, nil?: true - - # @!attribute identity_verified - # Whether the author's identity is verified - # - # @return [Boolean, nil] - optional :identity_verified, ModerationAPI::Internal::Type::Boolean, nil?: true - - # @!attribute is_paying_customer - # Whether the author is a paying customer - # - # @return [Boolean, nil] - optional :is_paying_customer, ModerationAPI::Internal::Type::Boolean, nil?: true - - # @!attribute phone_verified - # Whether the author's phone number is verified - # - # @return [Boolean, nil] - optional :phone_verified, ModerationAPI::Internal::Type::Boolean, nil?: true - - # @!method initialize(email_verified: nil, identity_verified: nil, is_paying_customer: nil, phone_verified: nil) - # Additional metadata provided by your system. We recommend including any relevant - # information that may assist in the moderation process. - # - # @param email_verified [Boolean, nil] Whether the author's email is verified - # - # @param identity_verified [Boolean, nil] Whether the author's identity is verified - # - # @param is_paying_customer [Boolean, nil] Whether the author is a paying customer - # - # @param phone_verified [Boolean, nil] Whether the author's phone number is verified - end - - # @see ModerationAPI::Models::WebhookEvent::AuthorAction::Data::Object::Author#metrics - class Metrics < ModerationAPI::Internal::Type::BaseModel - # @!attribute flagged_content - # Number of flagged content pieces - # - # @return [Float] - required :flagged_content, Float - - # @!attribute total_content - # Total pieces of content - # - # @return [Float] - required :total_content, Float - - # @!attribute average_sentiment - # Average sentiment score of content (-1 to 1). Requires a sentiment model in your - # project. - # - # @return [Float, nil] - optional :average_sentiment, Float, nil?: true - - # @!method initialize(flagged_content:, total_content:, average_sentiment: nil) - # Some parameter documentations has been truncated, see - # {ModerationAPI::Models::WebhookEvent::AuthorAction::Data::Object::Author::Metrics} - # for more details. - # - # @param flagged_content [Float] Number of flagged content pieces - # - # @param total_content [Float] Total pieces of content - # - # @param average_sentiment [Float, nil] Average sentiment score of content (-1 to 1). Requires a sentiment model in your - end - - # @see ModerationAPI::Models::WebhookEvent::AuthorAction::Data::Object::Author#risk_evaluation - class RiskEvaluation < ModerationAPI::Internal::Type::BaseModel - # @!attribute risk_level - # Calculated risk level based on more than 10 behavioral signals. - # - # @return [Float, nil] - optional :risk_level, Float, nil?: true - - # @!method initialize(risk_level: nil) - # Risk assessment details, if available. - # - # @param risk_level [Float, nil] Calculated risk level based on more than 10 behavioral signals. - end - - # Current author status - # - # @see ModerationAPI::Models::WebhookEvent::AuthorAction::Data::Object::Author#status - module Status - extend ModerationAPI::Internal::Type::Enum - - ENABLED = :enabled - SUSPENDED = :suspended - BLOCKED = :blocked - - # @!method self.values - # @return [Array] - end - - # @see ModerationAPI::Models::WebhookEvent::AuthorAction::Data::Object::Author#trust_level - class TrustLevel < ModerationAPI::Internal::Type::BaseModel - # @!attribute level - # Author trust level (-1, 0, 1, 2, 3, or 4) - # - # @return [Float] - required :level, Float - - # @!attribute manual - # True if the trust level was set manually by a moderator - # - # @return [Boolean] - required :manual, ModerationAPI::Internal::Type::Boolean - - # @!method initialize(level:, manual:) - # @param level [Float] Author trust level (-1, 0, 1, 2, 3, or 4) - # - # @param manual [Boolean] True if the trust level was set manually by a moderator - end - end - - # @see ModerationAPI::Models::WebhookEvent::AuthorAction::Data::Object#queue - class Queue < ModerationAPI::Internal::Type::BaseModel - # @!attribute id - # - # @return [String] - required :id, String - - # @!method initialize(id:) - # The queue the item belongs to, if any - # - # @param id [String] - end - end - end - end - - class QueueItemResolved < ModerationAPI::Internal::Type::BaseModel - # @!attribute id - # Stable event ID. Use this to dedupe retries. - # - # @return [String] - required :id, String - - # @!attribute api_version - # - # @return [Symbol, :v2] - required :api_version, const: :v2 - - # @!attribute created - # ISO 8601 timestamp of when the event was emitted. - # - # @return [Time] - required :created, Time - - # @!attribute data - # - # @return [ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data] - required :data, -> { ModerationAPI::WebhookEvent::QueueItemResolved::Data } - - # @!attribute type - # The event type. - # - # @return [Symbol, :"queue_item.resolved"] - required :type, const: :"queue_item.resolved" - - # @!method initialize(id:, created:, data:, api_version: :v2, type: :"queue_item.resolved") - # @param id [String] Stable event ID. Use this to dedupe retries. - # - # @param created [Time] ISO 8601 timestamp of when the event was emitted. - # - # @param data [ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data] - # - # @param api_version [Symbol, :v2] - # - # @param type [Symbol, :"queue_item.resolved"] The event type. - - # @see ModerationAPI::Models::WebhookEvent::QueueItemResolved#data - class Data < ModerationAPI::Internal::Type::BaseModel - # @!attribute object - # - # @return [ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object] - required :object, -> { ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object } - - # @!method initialize(object:) - # @param object [ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object] - - # @see ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data#object - class Object < ModerationAPI::Internal::Type::BaseModel - # @!attribute item - # - # @return [ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object::Item] - required :item, -> { ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item } - - # @!attribute author - # - # @return [ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object::Author, nil] - optional :author, -> { ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Author } - - # @!attribute queue - # - # @return [ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object::Queue, nil] - optional :queue, -> { ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Queue } - - # @!method initialize(item:, author: nil, queue: nil) - # @param item [ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object::Item] - # @param author [ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object::Author] - # @param queue [ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object::Queue] - - # @see ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object#item - class Item < ModerationAPI::Internal::Type::BaseModel - # @!attribute id - # Content ID from your system - # - # @return [String] - required :id, String - - # @!attribute author_id - # External author ID (the customer's identifier, not Moderation API's internal id) - # - # @return [String, nil] - required :author_id, String, nil?: true - - # @!attribute channel_key - # The channel the content was submitted to, identified by your customer-defined - # channel key. - # - # @return [String, nil] - required :channel_key, String, nil?: true - - # @!attribute client_action - # A recommendation from your own client-side flagging. - # - # @return [ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object::Item::ClientAction, nil] - required :client_action, - -> { - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::ClientAction - }, - nil?: true - - # @!attribute content - # The original content payload - # - # @return [ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object::Item::Content::Text, ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object::Item::Content::Image, ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object::Item::Content::Video, ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object::Item::Content::Audio, ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object::Item::Content::Object] - required :content, - union: -> { ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::Content } - - # @!attribute conversation_id - # Conversation grouping ID, if any - # - # @return [String, nil] - required :conversation_id, String, nil?: true - - # @!attribute flagged - # Whether the content was flagged by moderation - # - # @return [Boolean, nil] - required :flagged, ModerationAPI::Internal::Type::Boolean, nil?: true - - # @!attribute flagged_fields - # For object content, the field keys (e.g. "bio") that triggered a flag. Empty - # when no fields were flagged or the content is not an object. - # - # @return [Array] - required :flagged_fields, ModerationAPI::Internal::Type::ArrayOf[String] - - # @!attribute labels - # Moderation labels applied to the content - # - # @return [Array, nil] - required :labels, - -> { - ModerationAPI::Internal::Type::ArrayOf[ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::Label] - }, - nil?: true - - # @!attribute language - # Detected ISO language code, if available - # - # @return [String, nil] - required :language, String, nil?: true - - # @!attribute meta_type - # High-level content type (e.g. message, post, comment). Defaults to the channel's - # configured content type but can be overridden per request via the moderation API - # `type` field. - # - # @return [Symbol, ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object::Item::MetaType, nil] - required :meta_type, - enum: -> { - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::MetaType - }, - nil?: true - - # @!attribute metadata - # Arbitrary key/value metadata. Top-level keys are strings. - # - # @return [Hash{Symbol=>Object}, nil] - required :metadata, - ModerationAPI::Internal::Type::HashOf[ModerationAPI::Internal::Type::Unknown], - nil?: true - - # @!attribute timestamp - # ISO 8601 timestamp of when the content was submitted - # - # @return [Time] - required :timestamp, Time - - # @!method initialize(id:, author_id:, channel_key:, client_action:, content:, conversation_id:, flagged:, flagged_fields:, labels:, language:, meta_type:, metadata:, timestamp:) - # Some parameter documentations has been truncated, see - # {ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object::Item} for - # more details. - # - # @param id [String] Content ID from your system - # - # @param author_id [String, nil] External author ID (the customer's identifier, not Moderation API's internal id) - # - # @param channel_key [String, nil] The channel the content was submitted to, identified by your customer-defined ch - # - # @param client_action [ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object::Item::ClientAction, nil] A recommendation from your own client-side flagging. - # - # @param content [ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object::Item::Content::Text, ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object::Item::Content::Image, ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object::Item::Content::Video, ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object::Item::Content::Audio, ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object::Item::Content::Object] The original content payload - # - # @param conversation_id [String, nil] Conversation grouping ID, if any - # - # @param flagged [Boolean, nil] Whether the content was flagged by moderation - # - # @param flagged_fields [Array] For object content, the field keys (e.g. "bio") that triggered a flag. Empty whe - # - # @param labels [Array, nil] Moderation labels applied to the content - # - # @param language [String, nil] Detected ISO language code, if available - # - # @param meta_type [Symbol, ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object::Item::MetaType, nil] High-level content type (e.g. message, post, comment). Defaults to the channel's - # - # @param metadata [Hash{Symbol=>Object}, nil] Arbitrary key/value metadata. Top-level keys are strings. - # - # @param timestamp [Time] ISO 8601 timestamp of when the content was submitted - - # @see ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object::Item#client_action - class ClientAction < ModerationAPI::Internal::Type::BaseModel - # @!attribute action - # Your recommendation for the content: allow, review, or reject. - # - # @return [Symbol, ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object::Item::ClientAction::Action] - required :action, - enum: -> { ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::ClientAction::Action } - - # @!attribute behavior - # How your recommendation combines with ours. Defaults to 'escalate', which only - # applies it when stricter than ours; 'override' replaces ours outright. - # - # @return [Symbol, ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object::Item::ClientAction::Behavior, nil] - optional :behavior, - enum: -> { ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::ClientAction::Behavior } - - # @!attribute reason - # A human-readable explanation for your recommendation. - # - # @return [String, nil] - optional :reason, String - - # @!attribute source - # Where your recommendation came from, e.g. "banned-ip". - # - # @return [String, nil] - optional :source, String - - # @!method initialize(action:, behavior: nil, reason: nil, source: nil) - # Some parameter documentations has been truncated, see - # {ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object::Item::ClientAction} - # for more details. - # - # A recommendation from your own client-side flagging. - # - # @param action [Symbol, ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object::Item::ClientAction::Action] Your recommendation for the content: allow, review, or reject. - # - # @param behavior [Symbol, ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object::Item::ClientAction::Behavior] How your recommendation combines with ours. Defaults to 'escalate', which only a - # - # @param reason [String] A human-readable explanation for your recommendation. - # - # @param source [String] Where your recommendation came from, e.g. "banned-ip". - - # Your recommendation for the content: allow, review, or reject. - # - # @see ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object::Item::ClientAction#action - module Action - extend ModerationAPI::Internal::Type::Enum - - REVIEW = :review - ALLOW = :allow - REJECT = :reject - - # @!method self.values - # @return [Array] - end - - # How your recommendation combines with ours. Defaults to 'escalate', which only - # applies it when stricter than ours; 'override' replaces ours outright. - # - # @see ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object::Item::ClientAction#behavior - module Behavior - extend ModerationAPI::Internal::Type::Enum - - OVERRIDE = :override - ESCALATE = :escalate - - # @!method self.values - # @return [Array] - end - end - - # The original content payload - # - # @see ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object::Item#content - module Content - extend ModerationAPI::Internal::Type::Union - - # Text - variant -> { ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::Content::Text } - - # Image - variant -> { ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::Content::Image } - - # Video - variant -> { ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::Content::Video } - - # Audio - variant -> { ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::Content::Audio } - - # Object - variant -> { ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::Content::Object } - - class Text < ModerationAPI::Internal::Type::BaseModel - # @!attribute text - # The content text - # - # @return [String] - required :text, String - - # @!attribute type - # - # @return [Symbol, :text] - required :type, const: :text - - # @!method initialize(text:, type: :text) - # Text - # - # @param text [String] The content text - # - # @param type [Symbol, :text] - end - - class Image < ModerationAPI::Internal::Type::BaseModel - # @!attribute type - # - # @return [Symbol, :image] - required :type, const: :image - - # @!attribute data - # Base64-encoded image data. Either url or data must be provided. Note: base64 - # images are not stored and will not appear in the review queue. - # - # @return [String, nil] - optional :data, String - - # @!attribute url - # A public URL of the image content. Either url or data must be provided. - # - # @return [String, nil] - optional :url, String - - # @!method initialize(data: nil, url: nil, type: :image) - # Some parameter documentations has been truncated, see - # {ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object::Item::Content::Image} - # for more details. - # - # Image - # - # @param data [String] Base64-encoded image data. Either url or data must be provided. Note: base64 ima - # - # @param url [String] A public URL of the image content. Either url or data must be provided. - # - # @param type [Symbol, :image] - end - - class Video < ModerationAPI::Internal::Type::BaseModel - # @!attribute type - # - # @return [Symbol, :video] - required :type, const: :video - - # @!attribute url - # A public URL of the video content - # - # @return [String] - required :url, String - - # @!method initialize(url:, type: :video) - # Video - # - # @param url [String] A public URL of the video content - # - # @param type [Symbol, :video] - end - - class Audio < ModerationAPI::Internal::Type::BaseModel - # @!attribute type - # - # @return [Symbol, :audio] - required :type, const: :audio - - # @!attribute url - # The URL of the audio content - # - # @return [String] - required :url, String - - # @!method initialize(url:, type: :audio) - # Audio - # - # @param url [String] The URL of the audio content - # - # @param type [Symbol, :audio] - end - - class Object < ModerationAPI::Internal::Type::BaseModel - # @!attribute data - # Values in the object. Can be mixed content types. - # - # @return [Hash{Symbol=>ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object::Item::Content::Object::Data::Text, ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object::Item::Content::Object::Data::Image, ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object::Item::Content::Object::Data::Video, ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object::Item::Content::Object::Data::Audio}] - required :data, - -> { ModerationAPI::Internal::Type::HashOf[union: ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::Content::Object::Data] } - - # @!attribute type - # - # @return [Symbol, :object] - required :type, const: :object - - # @!method initialize(data:, type: :object) - # Object - # - # @param data [Hash{Symbol=>ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object::Item::Content::Object::Data::Text, ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object::Item::Content::Object::Data::Image, ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object::Item::Content::Object::Data::Video, ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object::Item::Content::Object::Data::Audio}] Values in the object. Can be mixed content types. - # - # @param type [Symbol, :object] - - # Text - module Data - extend ModerationAPI::Internal::Type::Union - - # Text - variant -> { ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::Content::Object::Data::Text } - - # Image - variant -> { ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::Content::Object::Data::Image } - - # Video - variant -> { ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::Content::Object::Data::Video } - - # Audio - variant -> { ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::Content::Object::Data::Audio } - - class Text < ModerationAPI::Internal::Type::BaseModel - # @!attribute text - # The content text - # - # @return [String] - required :text, String - - # @!attribute type - # - # @return [Symbol, :text] - required :type, const: :text - - # @!method initialize(text:, type: :text) - # Text - # - # @param text [String] The content text - # - # @param type [Symbol, :text] - end - - class Image < ModerationAPI::Internal::Type::BaseModel - # @!attribute type - # - # @return [Symbol, :image] - required :type, const: :image - - # @!attribute data - # Base64-encoded image data. Either url or data must be provided. Note: base64 - # images are not stored and will not appear in the review queue. - # - # @return [String, nil] - optional :data, String - - # @!attribute url - # A public URL of the image content. Either url or data must be provided. - # - # @return [String, nil] - optional :url, String - - # @!method initialize(data: nil, url: nil, type: :image) - # Some parameter documentations has been truncated, see - # {ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object::Item::Content::Object::Data::Image} - # for more details. - # - # Image - # - # @param data [String] Base64-encoded image data. Either url or data must be provided. Note: base64 ima - # - # @param url [String] A public URL of the image content. Either url or data must be provided. - # - # @param type [Symbol, :image] - end - - class Video < ModerationAPI::Internal::Type::BaseModel - # @!attribute type - # - # @return [Symbol, :video] - required :type, const: :video - - # @!attribute url - # A public URL of the video content - # - # @return [String] - required :url, String - - # @!method initialize(url:, type: :video) - # Video - # - # @param url [String] A public URL of the video content - # - # @param type [Symbol, :video] - end - - class Audio < ModerationAPI::Internal::Type::BaseModel - # @!attribute type - # - # @return [Symbol, :audio] - required :type, const: :audio - - # @!attribute url - # The URL of the audio content - # - # @return [String] - required :url, String - - # @!method initialize(url:, type: :audio) - # Audio - # - # @param url [String] The URL of the audio content - # - # @param type [Symbol, :audio] - end - - # @!method self.variants - # @return [Array(ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object::Item::Content::Object::Data::Text, ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object::Item::Content::Object::Data::Image, ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object::Item::Content::Object::Data::Video, ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object::Item::Content::Object::Data::Audio)] - end - end - - # @!method self.variants - # @return [Array(ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object::Item::Content::Text, ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object::Item::Content::Image, ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object::Item::Content::Video, ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object::Item::Content::Audio, ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object::Item::Content::Object)] - end - - class Label < ModerationAPI::Internal::Type::BaseModel - # @!attribute label - # The label name - # - # @return [String] - required :label, String - - # @!attribute score - # Confidence score between 0 and 1 - # - # @return [Float] - required :score, Float - - # @!attribute flagged - # Whether this label crossed its flagging threshold - # - # @return [Boolean, nil] - optional :flagged, ModerationAPI::Internal::Type::Boolean - - # @!attribute manual - # True if the label was applied manually by a moderator - # - # @return [Boolean, nil] - optional :manual, ModerationAPI::Internal::Type::Boolean - - # @!attribute matches - # - # @return [Array, nil] - optional :matches, - -> { ModerationAPI::Internal::Type::ArrayOf[ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::Label::Match] } - - # @!attribute shadow_flagged - # Whether this label crossed its threshold under a shadowed policy — reported for - # visibility, never counted toward a flagging decision - # - # @return [Boolean, nil] - optional :shadow_flagged, ModerationAPI::Internal::Type::Boolean - - # @!method initialize(label:, score:, flagged: nil, manual: nil, matches: nil, shadow_flagged: nil) - # Some parameter documentations has been truncated, see - # {ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object::Item::Label} - # for more details. - # - # @param label [String] The label name - # - # @param score [Float] Confidence score between 0 and 1 - # - # @param flagged [Boolean] Whether this label crossed its flagging threshold - # - # @param manual [Boolean] True if the label was applied manually by a moderator - # - # @param matches [Array] - # - # @param shadow_flagged [Boolean] Whether this label crossed its threshold under a shadowed policy — reported for - - class Match < ModerationAPI::Internal::Type::BaseModel - # @!attribute match - # The matched substring - # - # @return [String] - required :match, String - - # @!attribute probability - # Match confidence between 0 and 1 - # - # @return [Float] - required :probability, Float - - # @!attribute span - # [start, end] character offsets in the source text - # - # @return [Array] - required :span, ModerationAPI::Internal::Type::ArrayOf[ModerationAPI::Internal::Type::Unknown] - - # @!attribute entity_type - # - # @return [String, nil] - optional :entity_type, String - - # @!attribute mask - # - # @return [String, nil] - optional :mask, String, nil?: true - - # @!attribute reasons - # - # @return [Array, nil] - optional :reasons, ModerationAPI::Internal::Type::ArrayOf[String] - - # @!attribute scripts - # - # @return [Array, nil] - optional :scripts, ModerationAPI::Internal::Type::ArrayOf[String] - - # @!attribute signals - # - # @return [ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object::Item::Label::Match::Signals, nil] - optional :signals, - -> { ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::Label::Match::Signals } - - # @!attribute skeleton - # - # @return [String, nil] - optional :skeleton, String - - # @!method initialize(match:, probability:, span:, entity_type: nil, mask: nil, reasons: nil, scripts: nil, signals: nil, skeleton: nil) - # @param match [String] The matched substring - # - # @param probability [Float] Match confidence between 0 and 1 - # - # @param span [Array] [start, end] character offsets in the source text - # - # @param entity_type [String] - # - # @param mask [String, nil] - # - # @param reasons [Array] - # - # @param scripts [Array] - # - # @param signals [ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object::Item::Label::Match::Signals] - # - # @param skeleton [String] - - # @see ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object::Item::Label::Match#signals - class Signals < ModerationAPI::Internal::Type::BaseModel - # @!attribute bot_protection - # - # @return [Boolean, nil] - required :bot_protection, ModerationAPI::Internal::Type::Boolean, nil?: true - - # @!attribute brand_impersonation - # - # @return [ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object::Item::Label::Match::Signals::BrandImpersonation, nil] - required :brand_impersonation, - -> { - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::Label::Match::Signals::BrandImpersonation - }, - nil?: true - - # @!attribute domain_age_days - # - # @return [Float, nil] - required :domain_age_days, Float, nil?: true - - # @!attribute final_url - # - # @return [String, nil] - required :final_url, String, nil?: true - - # @!attribute has_email_setup - # - # @return [Boolean, nil] - required :has_email_setup, ModerationAPI::Internal::Type::Boolean, nil?: true - - # @!attribute has_suspicious_characters - # - # @return [Boolean] - required :has_suspicious_characters, ModerationAPI::Internal::Type::Boolean - - # @!attribute is_link_shortener - # - # @return [Boolean] - required :is_link_shortener, ModerationAPI::Internal::Type::Boolean - - # @!attribute is_reported - # - # @return [Boolean] - required :is_reported, ModerationAPI::Internal::Type::Boolean - - # @!attribute redirect_count - # - # @return [Float, nil] - required :redirect_count, Float, nil?: true - - # @!method initialize(bot_protection:, brand_impersonation:, domain_age_days:, final_url:, has_email_setup:, has_suspicious_characters:, is_link_shortener:, is_reported:, redirect_count:) - # @param bot_protection [Boolean, nil] - # @param brand_impersonation [ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object::Item::Label::Match::Signals::BrandImpersonation, nil] - # @param domain_age_days [Float, nil] - # @param final_url [String, nil] - # @param has_email_setup [Boolean, nil] - # @param has_suspicious_characters [Boolean] - # @param is_link_shortener [Boolean] - # @param is_reported [Boolean] - # @param redirect_count [Float, nil] - - # @see ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object::Item::Label::Match::Signals#brand_impersonation - class BrandImpersonation < ModerationAPI::Internal::Type::BaseModel - # @!attribute brand - # - # @return [String] - required :brand, String - - # @!attribute method_ - # - # @return [String] - required :method_, String, api_name: :method - - # @!method initialize(brand:, method_:) - # @param brand [String] - # @param method_ [String] - end - end - end - end - - # High-level content type (e.g. message, post, comment). Defaults to the channel's - # configured content type but can be overridden per request via the moderation API - # `type` field. - # - # @see ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object::Item#meta_type - module MetaType - extend ModerationAPI::Internal::Type::Enum - - PROFILE = :profile - MESSAGE = :message - POST = :post - COMMENT = :comment - EVENT = :event - PRODUCT = :product - REVIEW = :review - VOICE = :voice - OTHER = :other - - # @!method self.values - # @return [Array] - end - end - - # @see ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object#author - class Author < ModerationAPI::Internal::Type::BaseModel - # @!attribute id - # Author ID in Moderation API - # - # @return [String] - required :id, String - - # @!attribute block - # Block or suspension details, if applicable. Null if the author is enabled. - # - # @return [ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object::Author::Block, nil] - required :block, - -> { ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Author::Block }, - nil?: true - - # @!attribute first_seen - # Timestamp when author first appeared - # - # @return [Float] - required :first_seen, Float - - # @!attribute last_seen - # Timestamp of last activity - # - # @return [Float] - required :last_seen, Float - - # @!attribute metadata - # Additional metadata provided by your system. We recommend including any relevant - # information that may assist in the moderation process. - # - # @return [ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object::Author::Metadata] - required :metadata, -> { ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Author::Metadata } - - # @!attribute metrics - # - # @return [ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object::Author::Metrics] - required :metrics, -> { ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Author::Metrics } - - # @!attribute risk_evaluation - # Risk assessment details, if available. - # - # @return [ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object::Author::RiskEvaluation, nil] - required :risk_evaluation, - -> { - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Author::RiskEvaluation - }, - nil?: true - - # @!attribute status - # Current author status - # - # @return [Symbol, ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object::Author::Status] - required :status, - enum: -> { ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Author::Status } - - # @!attribute trust_level - # - # @return [ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object::Author::TrustLevel] - required :trust_level, - -> { ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Author::TrustLevel } - - # @!attribute company - # The author's company or organization - # - # @return [String, nil] - optional :company, String, nil?: true - - # @!attribute email - # Author email address - # - # @return [String, nil] - optional :email, String, nil?: true - - # @!attribute external_id - # The author's ID from your system - # - # @return [String, nil] - optional :external_id, String, nil?: true - - # @!attribute external_link - # URL of the author's external profile - # - # @return [String, nil] - optional :external_link, String, nil?: true - - # @!attribute last_incident - # Timestamp of last incident - # - # @return [Float, nil] - optional :last_incident, Float, nil?: true - - # @!attribute name - # Author name or identifier - # - # @return [String, nil] - optional :name, String, nil?: true - - # @!attribute profile_picture - # URL of the author's profile picture - # - # @return [String, nil] - optional :profile_picture, String, nil?: true - - # @!method initialize(id:, block:, first_seen:, last_seen:, metadata:, metrics:, risk_evaluation:, status:, trust_level:, company: nil, email: nil, external_id: nil, external_link: nil, last_incident: nil, name: nil, profile_picture: nil) - # Some parameter documentations has been truncated, see - # {ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object::Author} - # for more details. - # - # @param id [String] Author ID in Moderation API - # - # @param block [ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object::Author::Block, nil] Block or suspension details, if applicable. Null if the author is enabled. - # - # @param first_seen [Float] Timestamp when author first appeared - # - # @param last_seen [Float] Timestamp of last activity - # - # @param metadata [ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object::Author::Metadata] Additional metadata provided by your system. We recommend including any relevant - # - # @param metrics [ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object::Author::Metrics] - # - # @param risk_evaluation [ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object::Author::RiskEvaluation, nil] Risk assessment details, if available. - # - # @param status [Symbol, ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object::Author::Status] Current author status - # - # @param trust_level [ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object::Author::TrustLevel] - # - # @param company [String, nil] The author's company or organization - # - # @param email [String, nil] Author email address - # - # @param external_id [String, nil] The author's ID from your system - # - # @param external_link [String, nil] URL of the author's external profile - # - # @param last_incident [Float, nil] Timestamp of last incident - # - # @param name [String, nil] Author name or identifier - # - # @param profile_picture [String, nil] URL of the author's profile picture - - # @see ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object::Author#block - class Block < ModerationAPI::Internal::Type::BaseModel - # @!attribute reason - # The moderators reason why the author was blocked or suspended. - # - # @return [String, nil] - optional :reason, String, nil?: true - - # @!attribute until_ - # The timestamp until which they are blocked if the author is suspended. - # - # @return [Float, nil] - optional :until_, Float, api_name: :until, nil?: true - - # @!method initialize(reason: nil, until_: nil) - # Block or suspension details, if applicable. Null if the author is enabled. - # - # @param reason [String, nil] The moderators reason why the author was blocked or suspended. - # - # @param until_ [Float, nil] The timestamp until which they are blocked if the author is suspended. - end - - # @see ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object::Author#metadata - class Metadata < ModerationAPI::Internal::Type::BaseModel - # @!attribute email_verified - # Whether the author's email is verified - # - # @return [Boolean, nil] - optional :email_verified, ModerationAPI::Internal::Type::Boolean, nil?: true - - # @!attribute identity_verified - # Whether the author's identity is verified - # - # @return [Boolean, nil] - optional :identity_verified, ModerationAPI::Internal::Type::Boolean, nil?: true - - # @!attribute is_paying_customer - # Whether the author is a paying customer - # - # @return [Boolean, nil] - optional :is_paying_customer, ModerationAPI::Internal::Type::Boolean, nil?: true - - # @!attribute phone_verified - # Whether the author's phone number is verified - # - # @return [Boolean, nil] - optional :phone_verified, ModerationAPI::Internal::Type::Boolean, nil?: true - - # @!method initialize(email_verified: nil, identity_verified: nil, is_paying_customer: nil, phone_verified: nil) - # Additional metadata provided by your system. We recommend including any relevant - # information that may assist in the moderation process. - # - # @param email_verified [Boolean, nil] Whether the author's email is verified - # - # @param identity_verified [Boolean, nil] Whether the author's identity is verified - # - # @param is_paying_customer [Boolean, nil] Whether the author is a paying customer - # - # @param phone_verified [Boolean, nil] Whether the author's phone number is verified - end - - # @see ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object::Author#metrics - class Metrics < ModerationAPI::Internal::Type::BaseModel - # @!attribute flagged_content - # Number of flagged content pieces - # - # @return [Float] - required :flagged_content, Float - - # @!attribute total_content - # Total pieces of content - # - # @return [Float] - required :total_content, Float - - # @!attribute average_sentiment - # Average sentiment score of content (-1 to 1). Requires a sentiment model in your - # project. - # - # @return [Float, nil] - optional :average_sentiment, Float, nil?: true - - # @!method initialize(flagged_content:, total_content:, average_sentiment: nil) - # Some parameter documentations has been truncated, see - # {ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object::Author::Metrics} - # for more details. - # - # @param flagged_content [Float] Number of flagged content pieces - # - # @param total_content [Float] Total pieces of content - # - # @param average_sentiment [Float, nil] Average sentiment score of content (-1 to 1). Requires a sentiment model in your - end - - # @see ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object::Author#risk_evaluation - class RiskEvaluation < ModerationAPI::Internal::Type::BaseModel - # @!attribute risk_level - # Calculated risk level based on more than 10 behavioral signals. - # - # @return [Float, nil] - optional :risk_level, Float, nil?: true - - # @!method initialize(risk_level: nil) - # Risk assessment details, if available. - # - # @param risk_level [Float, nil] Calculated risk level based on more than 10 behavioral signals. - end - - # Current author status - # - # @see ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object::Author#status - module Status - extend ModerationAPI::Internal::Type::Enum - - ENABLED = :enabled - SUSPENDED = :suspended - BLOCKED = :blocked - - # @!method self.values - # @return [Array] - end - - # @see ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object::Author#trust_level - class TrustLevel < ModerationAPI::Internal::Type::BaseModel - # @!attribute level - # Author trust level (-1, 0, 1, 2, 3, or 4) - # - # @return [Float] - required :level, Float - - # @!attribute manual - # True if the trust level was set manually by a moderator - # - # @return [Boolean] - required :manual, ModerationAPI::Internal::Type::Boolean - - # @!method initialize(level:, manual:) - # @param level [Float] Author trust level (-1, 0, 1, 2, 3, or 4) - # - # @param manual [Boolean] True if the trust level was set manually by a moderator - end - end - - # @see ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object#queue - class Queue < ModerationAPI::Internal::Type::BaseModel - # @!attribute id - # - # @return [String] - required :id, String - - # @!method initialize(id:) - # @param id [String] - end - end - end - end - - class QueueItemAction < ModerationAPI::Internal::Type::BaseModel - # @!attribute id - # Stable event ID. Use this to dedupe retries. - # - # @return [String] - required :id, String - - # @!attribute api_version - # - # @return [Symbol, :v2] - required :api_version, const: :v2 - - # @!attribute created - # ISO 8601 timestamp of when the event was emitted. - # - # @return [Time] - required :created, Time - - # @!attribute data - # - # @return [ModerationAPI::Models::WebhookEvent::QueueItemAction::Data] - required :data, -> { ModerationAPI::WebhookEvent::QueueItemAction::Data } - - # @!attribute type - # The event type. - # - # @return [Symbol, :"queue_item.action"] - required :type, const: :"queue_item.action" - - # @!method initialize(id:, created:, data:, api_version: :v2, type: :"queue_item.action") - # @param id [String] Stable event ID. Use this to dedupe retries. - # - # @param created [Time] ISO 8601 timestamp of when the event was emitted. - # - # @param data [ModerationAPI::Models::WebhookEvent::QueueItemAction::Data] - # - # @param api_version [Symbol, :v2] - # - # @param type [Symbol, :"queue_item.action"] The event type. - - # @see ModerationAPI::Models::WebhookEvent::QueueItemAction#data - class Data < ModerationAPI::Internal::Type::BaseModel - # @!attribute object - # - # @return [ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object] - required :object, -> { ModerationAPI::WebhookEvent::QueueItemAction::Data::Object } - - # @!method initialize(object:) - # @param object [ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object] - - # @see ModerationAPI::Models::WebhookEvent::QueueItemAction::Data#object - class Object < ModerationAPI::Internal::Type::BaseModel - # @!attribute id - # Moderation action ID - # - # @return [String] - required :id, String - - # @!attribute created_at - # ISO 8601 timestamp of when the action was performed - # - # @return [Time] - required :created_at, Time - - # @!attribute key - # Customer-defined key identifying this action - # - # @return [String, nil] - required :key, String, nil?: true - - # @!attribute name - # Display name of the action - # - # @return [String, nil] - required :name, String, nil?: true - - # @!attribute value - # The value passed to the action when it ran - # - # @return [String, nil] - required :value, String, nil?: true - - # @!attribute author - # The author the action was performed on, if any - # - # @return [ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object::Author, nil] - optional :author, -> { ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Author } - - # @!attribute item - # The content item the action was performed on, if any - # - # @return [ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object::Item, nil] - optional :item, -> { ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item } - - # @!attribute queue - # The queue the item belongs to, if any - # - # @return [ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object::Queue, nil] - optional :queue, -> { ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Queue } - - # @!method initialize(id:, created_at:, key:, name:, value:, author: nil, item: nil, queue: nil) - # @param id [String] Moderation action ID - # - # @param created_at [Time] ISO 8601 timestamp of when the action was performed - # - # @param key [String, nil] Customer-defined key identifying this action - # - # @param name [String, nil] Display name of the action - # - # @param value [String, nil] The value passed to the action when it ran - # - # @param author [ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object::Author] The author the action was performed on, if any - # - # @param item [ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object::Item] The content item the action was performed on, if any - # - # @param queue [ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object::Queue] The queue the item belongs to, if any - - # @see ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object#author - class Author < ModerationAPI::Internal::Type::BaseModel - # @!attribute id - # Author ID in Moderation API - # - # @return [String] - required :id, String - - # @!attribute block - # Block or suspension details, if applicable. Null if the author is enabled. - # - # @return [ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object::Author::Block, nil] - required :block, - -> { ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Author::Block }, - nil?: true - - # @!attribute first_seen - # Timestamp when author first appeared - # - # @return [Float] - required :first_seen, Float - - # @!attribute last_seen - # Timestamp of last activity - # - # @return [Float] - required :last_seen, Float - - # @!attribute metadata - # Additional metadata provided by your system. We recommend including any relevant - # information that may assist in the moderation process. - # - # @return [ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object::Author::Metadata] - required :metadata, -> { ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Author::Metadata } - - # @!attribute metrics - # - # @return [ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object::Author::Metrics] - required :metrics, -> { ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Author::Metrics } - - # @!attribute risk_evaluation - # Risk assessment details, if available. - # - # @return [ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object::Author::RiskEvaluation, nil] - required :risk_evaluation, - -> { - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Author::RiskEvaluation - }, - nil?: true - - # @!attribute status - # Current author status - # - # @return [Symbol, ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object::Author::Status] - required :status, enum: -> { ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Author::Status } - - # @!attribute trust_level - # - # @return [ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object::Author::TrustLevel] - required :trust_level, - -> { ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Author::TrustLevel } - - # @!attribute company - # The author's company or organization - # - # @return [String, nil] - optional :company, String, nil?: true - - # @!attribute email - # Author email address - # - # @return [String, nil] - optional :email, String, nil?: true - - # @!attribute external_id - # The author's ID from your system - # - # @return [String, nil] - optional :external_id, String, nil?: true - - # @!attribute external_link - # URL of the author's external profile - # - # @return [String, nil] - optional :external_link, String, nil?: true - - # @!attribute last_incident - # Timestamp of last incident - # - # @return [Float, nil] - optional :last_incident, Float, nil?: true - - # @!attribute name - # Author name or identifier - # - # @return [String, nil] - optional :name, String, nil?: true - - # @!attribute profile_picture - # URL of the author's profile picture - # - # @return [String, nil] - optional :profile_picture, String, nil?: true - - # @!method initialize(id:, block:, first_seen:, last_seen:, metadata:, metrics:, risk_evaluation:, status:, trust_level:, company: nil, email: nil, external_id: nil, external_link: nil, last_incident: nil, name: nil, profile_picture: nil) - # Some parameter documentations has been truncated, see - # {ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object::Author} for - # more details. - # - # The author the action was performed on, if any - # - # @param id [String] Author ID in Moderation API - # - # @param block [ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object::Author::Block, nil] Block or suspension details, if applicable. Null if the author is enabled. - # - # @param first_seen [Float] Timestamp when author first appeared - # - # @param last_seen [Float] Timestamp of last activity - # - # @param metadata [ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object::Author::Metadata] Additional metadata provided by your system. We recommend including any relevant - # - # @param metrics [ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object::Author::Metrics] - # - # @param risk_evaluation [ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object::Author::RiskEvaluation, nil] Risk assessment details, if available. - # - # @param status [Symbol, ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object::Author::Status] Current author status - # - # @param trust_level [ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object::Author::TrustLevel] - # - # @param company [String, nil] The author's company or organization - # - # @param email [String, nil] Author email address - # - # @param external_id [String, nil] The author's ID from your system - # - # @param external_link [String, nil] URL of the author's external profile - # - # @param last_incident [Float, nil] Timestamp of last incident - # - # @param name [String, nil] Author name or identifier - # - # @param profile_picture [String, nil] URL of the author's profile picture - - # @see ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object::Author#block - class Block < ModerationAPI::Internal::Type::BaseModel - # @!attribute reason - # The moderators reason why the author was blocked or suspended. - # - # @return [String, nil] - optional :reason, String, nil?: true - - # @!attribute until_ - # The timestamp until which they are blocked if the author is suspended. - # - # @return [Float, nil] - optional :until_, Float, api_name: :until, nil?: true - - # @!method initialize(reason: nil, until_: nil) - # Block or suspension details, if applicable. Null if the author is enabled. - # - # @param reason [String, nil] The moderators reason why the author was blocked or suspended. - # - # @param until_ [Float, nil] The timestamp until which they are blocked if the author is suspended. - end - - # @see ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object::Author#metadata - class Metadata < ModerationAPI::Internal::Type::BaseModel - # @!attribute email_verified - # Whether the author's email is verified - # - # @return [Boolean, nil] - optional :email_verified, ModerationAPI::Internal::Type::Boolean, nil?: true - - # @!attribute identity_verified - # Whether the author's identity is verified - # - # @return [Boolean, nil] - optional :identity_verified, ModerationAPI::Internal::Type::Boolean, nil?: true - - # @!attribute is_paying_customer - # Whether the author is a paying customer - # - # @return [Boolean, nil] - optional :is_paying_customer, ModerationAPI::Internal::Type::Boolean, nil?: true - - # @!attribute phone_verified - # Whether the author's phone number is verified - # - # @return [Boolean, nil] - optional :phone_verified, ModerationAPI::Internal::Type::Boolean, nil?: true - - # @!method initialize(email_verified: nil, identity_verified: nil, is_paying_customer: nil, phone_verified: nil) - # Additional metadata provided by your system. We recommend including any relevant - # information that may assist in the moderation process. - # - # @param email_verified [Boolean, nil] Whether the author's email is verified - # - # @param identity_verified [Boolean, nil] Whether the author's identity is verified - # - # @param is_paying_customer [Boolean, nil] Whether the author is a paying customer - # - # @param phone_verified [Boolean, nil] Whether the author's phone number is verified - end - - # @see ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object::Author#metrics - class Metrics < ModerationAPI::Internal::Type::BaseModel - # @!attribute flagged_content - # Number of flagged content pieces - # - # @return [Float] - required :flagged_content, Float - - # @!attribute total_content - # Total pieces of content - # - # @return [Float] - required :total_content, Float - - # @!attribute average_sentiment - # Average sentiment score of content (-1 to 1). Requires a sentiment model in your - # project. - # - # @return [Float, nil] - optional :average_sentiment, Float, nil?: true - - # @!method initialize(flagged_content:, total_content:, average_sentiment: nil) - # Some parameter documentations has been truncated, see - # {ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object::Author::Metrics} - # for more details. - # - # @param flagged_content [Float] Number of flagged content pieces - # - # @param total_content [Float] Total pieces of content - # - # @param average_sentiment [Float, nil] Average sentiment score of content (-1 to 1). Requires a sentiment model in your - end - - # @see ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object::Author#risk_evaluation - class RiskEvaluation < ModerationAPI::Internal::Type::BaseModel - # @!attribute risk_level - # Calculated risk level based on more than 10 behavioral signals. - # - # @return [Float, nil] - optional :risk_level, Float, nil?: true - - # @!method initialize(risk_level: nil) - # Risk assessment details, if available. - # - # @param risk_level [Float, nil] Calculated risk level based on more than 10 behavioral signals. - end - - # Current author status - # - # @see ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object::Author#status - module Status - extend ModerationAPI::Internal::Type::Enum - - ENABLED = :enabled - SUSPENDED = :suspended - BLOCKED = :blocked - - # @!method self.values - # @return [Array] - end - - # @see ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object::Author#trust_level - class TrustLevel < ModerationAPI::Internal::Type::BaseModel - # @!attribute level - # Author trust level (-1, 0, 1, 2, 3, or 4) - # - # @return [Float] - required :level, Float - - # @!attribute manual - # True if the trust level was set manually by a moderator - # - # @return [Boolean] - required :manual, ModerationAPI::Internal::Type::Boolean - - # @!method initialize(level:, manual:) - # @param level [Float] Author trust level (-1, 0, 1, 2, 3, or 4) - # - # @param manual [Boolean] True if the trust level was set manually by a moderator - end - end - - # @see ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object#item - class Item < ModerationAPI::Internal::Type::BaseModel - # @!attribute id - # Content ID from your system - # - # @return [String] - required :id, String - - # @!attribute author_id - # External author ID (the customer's identifier, not Moderation API's internal id) - # - # @return [String, nil] - required :author_id, String, nil?: true - - # @!attribute channel_key - # The channel the content was submitted to, identified by your customer-defined - # channel key. - # - # @return [String, nil] - required :channel_key, String, nil?: true - - # @!attribute client_action - # A recommendation from your own client-side flagging. - # - # @return [ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object::Item::ClientAction, nil] - required :client_action, - -> { ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::ClientAction }, - nil?: true - - # @!attribute content - # The original content payload - # - # @return [ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object::Item::Content::Text, ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object::Item::Content::Image, ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object::Item::Content::Video, ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object::Item::Content::Audio, ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object::Item::Content::Object] - required :content, union: -> { ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::Content } - - # @!attribute conversation_id - # Conversation grouping ID, if any - # - # @return [String, nil] - required :conversation_id, String, nil?: true - - # @!attribute flagged - # Whether the content was flagged by moderation - # - # @return [Boolean, nil] - required :flagged, ModerationAPI::Internal::Type::Boolean, nil?: true - - # @!attribute flagged_fields - # For object content, the field keys (e.g. "bio") that triggered a flag. Empty - # when no fields were flagged or the content is not an object. - # - # @return [Array] - required :flagged_fields, ModerationAPI::Internal::Type::ArrayOf[String] - - # @!attribute labels - # Moderation labels applied to the content - # - # @return [Array, nil] - required :labels, - -> { - ModerationAPI::Internal::Type::ArrayOf[ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::Label] - }, - nil?: true - - # @!attribute language - # Detected ISO language code, if available - # - # @return [String, nil] - required :language, String, nil?: true - - # @!attribute meta_type - # High-level content type (e.g. message, post, comment). Defaults to the channel's - # configured content type but can be overridden per request via the moderation API - # `type` field. - # - # @return [Symbol, ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object::Item::MetaType, nil] - required :meta_type, - enum: -> { - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::MetaType - }, - nil?: true - - # @!attribute metadata - # Arbitrary key/value metadata. Top-level keys are strings. - # - # @return [Hash{Symbol=>Object}, nil] - required :metadata, - ModerationAPI::Internal::Type::HashOf[ModerationAPI::Internal::Type::Unknown], - nil?: true - - # @!attribute timestamp - # ISO 8601 timestamp of when the content was submitted - # - # @return [Time] - required :timestamp, Time - - # @!method initialize(id:, author_id:, channel_key:, client_action:, content:, conversation_id:, flagged:, flagged_fields:, labels:, language:, meta_type:, metadata:, timestamp:) - # Some parameter documentations has been truncated, see - # {ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object::Item} for - # more details. - # - # The content item the action was performed on, if any - # - # @param id [String] Content ID from your system - # - # @param author_id [String, nil] External author ID (the customer's identifier, not Moderation API's internal id) - # - # @param channel_key [String, nil] The channel the content was submitted to, identified by your customer-defined ch - # - # @param client_action [ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object::Item::ClientAction, nil] A recommendation from your own client-side flagging. - # - # @param content [ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object::Item::Content::Text, ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object::Item::Content::Image, ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object::Item::Content::Video, ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object::Item::Content::Audio, ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object::Item::Content::Object] The original content payload - # - # @param conversation_id [String, nil] Conversation grouping ID, if any - # - # @param flagged [Boolean, nil] Whether the content was flagged by moderation - # - # @param flagged_fields [Array] For object content, the field keys (e.g. "bio") that triggered a flag. Empty whe - # - # @param labels [Array, nil] Moderation labels applied to the content - # - # @param language [String, nil] Detected ISO language code, if available - # - # @param meta_type [Symbol, ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object::Item::MetaType, nil] High-level content type (e.g. message, post, comment). Defaults to the channel's - # - # @param metadata [Hash{Symbol=>Object}, nil] Arbitrary key/value metadata. Top-level keys are strings. - # - # @param timestamp [Time] ISO 8601 timestamp of when the content was submitted - - # @see ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object::Item#client_action - class ClientAction < ModerationAPI::Internal::Type::BaseModel - # @!attribute action - # Your recommendation for the content: allow, review, or reject. - # - # @return [Symbol, ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object::Item::ClientAction::Action] - required :action, - enum: -> { ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::ClientAction::Action } - - # @!attribute behavior - # How your recommendation combines with ours. Defaults to 'escalate', which only - # applies it when stricter than ours; 'override' replaces ours outright. - # - # @return [Symbol, ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object::Item::ClientAction::Behavior, nil] - optional :behavior, - enum: -> { ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::ClientAction::Behavior } - - # @!attribute reason - # A human-readable explanation for your recommendation. - # - # @return [String, nil] - optional :reason, String - - # @!attribute source - # Where your recommendation came from, e.g. "banned-ip". - # - # @return [String, nil] - optional :source, String - - # @!method initialize(action:, behavior: nil, reason: nil, source: nil) - # Some parameter documentations has been truncated, see - # {ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object::Item::ClientAction} - # for more details. - # - # A recommendation from your own client-side flagging. - # - # @param action [Symbol, ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object::Item::ClientAction::Action] Your recommendation for the content: allow, review, or reject. - # - # @param behavior [Symbol, ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object::Item::ClientAction::Behavior] How your recommendation combines with ours. Defaults to 'escalate', which only a - # - # @param reason [String] A human-readable explanation for your recommendation. - # - # @param source [String] Where your recommendation came from, e.g. "banned-ip". - - # Your recommendation for the content: allow, review, or reject. - # - # @see ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object::Item::ClientAction#action - module Action - extend ModerationAPI::Internal::Type::Enum - - REVIEW = :review - ALLOW = :allow - REJECT = :reject - - # @!method self.values - # @return [Array] - end - - # How your recommendation combines with ours. Defaults to 'escalate', which only - # applies it when stricter than ours; 'override' replaces ours outright. - # - # @see ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object::Item::ClientAction#behavior - module Behavior - extend ModerationAPI::Internal::Type::Enum - - OVERRIDE = :override - ESCALATE = :escalate - - # @!method self.values - # @return [Array] - end - end - - # The original content payload - # - # @see ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object::Item#content - module Content - extend ModerationAPI::Internal::Type::Union - - # Text - variant -> { ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::Content::Text } - - # Image - variant -> { ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::Content::Image } - - # Video - variant -> { ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::Content::Video } - - # Audio - variant -> { ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::Content::Audio } - - # Object - variant -> { ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::Content::Object } - - class Text < ModerationAPI::Internal::Type::BaseModel - # @!attribute text - # The content text - # - # @return [String] - required :text, String - - # @!attribute type - # - # @return [Symbol, :text] - required :type, const: :text - - # @!method initialize(text:, type: :text) - # Text - # - # @param text [String] The content text - # - # @param type [Symbol, :text] - end - - class Image < ModerationAPI::Internal::Type::BaseModel - # @!attribute type - # - # @return [Symbol, :image] - required :type, const: :image - - # @!attribute data - # Base64-encoded image data. Either url or data must be provided. Note: base64 - # images are not stored and will not appear in the review queue. - # - # @return [String, nil] - optional :data, String - - # @!attribute url - # A public URL of the image content. Either url or data must be provided. - # - # @return [String, nil] - optional :url, String - - # @!method initialize(data: nil, url: nil, type: :image) - # Some parameter documentations has been truncated, see - # {ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object::Item::Content::Image} - # for more details. - # - # Image - # - # @param data [String] Base64-encoded image data. Either url or data must be provided. Note: base64 ima - # - # @param url [String] A public URL of the image content. Either url or data must be provided. - # - # @param type [Symbol, :image] - end - - class Video < ModerationAPI::Internal::Type::BaseModel - # @!attribute type - # - # @return [Symbol, :video] - required :type, const: :video - - # @!attribute url - # A public URL of the video content - # - # @return [String] - required :url, String - - # @!method initialize(url:, type: :video) - # Video - # - # @param url [String] A public URL of the video content - # - # @param type [Symbol, :video] - end - - class Audio < ModerationAPI::Internal::Type::BaseModel - # @!attribute type - # - # @return [Symbol, :audio] - required :type, const: :audio - - # @!attribute url - # The URL of the audio content - # - # @return [String] - required :url, String - - # @!method initialize(url:, type: :audio) - # Audio - # - # @param url [String] The URL of the audio content - # - # @param type [Symbol, :audio] - end - - class Object < ModerationAPI::Internal::Type::BaseModel - # @!attribute data - # Values in the object. Can be mixed content types. - # - # @return [Hash{Symbol=>ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object::Item::Content::Object::Data::Text, ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object::Item::Content::Object::Data::Image, ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object::Item::Content::Object::Data::Video, ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object::Item::Content::Object::Data::Audio}] - required :data, - -> { ModerationAPI::Internal::Type::HashOf[union: ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::Content::Object::Data] } - - # @!attribute type - # - # @return [Symbol, :object] - required :type, const: :object - - # @!method initialize(data:, type: :object) - # Object - # - # @param data [Hash{Symbol=>ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object::Item::Content::Object::Data::Text, ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object::Item::Content::Object::Data::Image, ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object::Item::Content::Object::Data::Video, ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object::Item::Content::Object::Data::Audio}] Values in the object. Can be mixed content types. - # - # @param type [Symbol, :object] - - # Text - module Data - extend ModerationAPI::Internal::Type::Union - - # Text - variant -> { ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::Content::Object::Data::Text } - - # Image - variant -> { ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::Content::Object::Data::Image } - - # Video - variant -> { ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::Content::Object::Data::Video } - - # Audio - variant -> { ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::Content::Object::Data::Audio } - - class Text < ModerationAPI::Internal::Type::BaseModel - # @!attribute text - # The content text - # - # @return [String] - required :text, String - - # @!attribute type - # - # @return [Symbol, :text] - required :type, const: :text - - # @!method initialize(text:, type: :text) - # Text - # - # @param text [String] The content text - # - # @param type [Symbol, :text] - end - - class Image < ModerationAPI::Internal::Type::BaseModel - # @!attribute type - # - # @return [Symbol, :image] - required :type, const: :image - - # @!attribute data - # Base64-encoded image data. Either url or data must be provided. Note: base64 - # images are not stored and will not appear in the review queue. - # - # @return [String, nil] - optional :data, String - - # @!attribute url - # A public URL of the image content. Either url or data must be provided. - # - # @return [String, nil] - optional :url, String - - # @!method initialize(data: nil, url: nil, type: :image) - # Some parameter documentations has been truncated, see - # {ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object::Item::Content::Object::Data::Image} - # for more details. - # - # Image - # - # @param data [String] Base64-encoded image data. Either url or data must be provided. Note: base64 ima - # - # @param url [String] A public URL of the image content. Either url or data must be provided. - # - # @param type [Symbol, :image] - end - - class Video < ModerationAPI::Internal::Type::BaseModel - # @!attribute type - # - # @return [Symbol, :video] - required :type, const: :video - - # @!attribute url - # A public URL of the video content - # - # @return [String] - required :url, String - - # @!method initialize(url:, type: :video) - # Video - # - # @param url [String] A public URL of the video content - # - # @param type [Symbol, :video] - end - - class Audio < ModerationAPI::Internal::Type::BaseModel - # @!attribute type - # - # @return [Symbol, :audio] - required :type, const: :audio - - # @!attribute url - # The URL of the audio content - # - # @return [String] - required :url, String - - # @!method initialize(url:, type: :audio) - # Audio - # - # @param url [String] The URL of the audio content - # - # @param type [Symbol, :audio] - end - - # @!method self.variants - # @return [Array(ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object::Item::Content::Object::Data::Text, ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object::Item::Content::Object::Data::Image, ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object::Item::Content::Object::Data::Video, ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object::Item::Content::Object::Data::Audio)] - end - end - - # @!method self.variants - # @return [Array(ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object::Item::Content::Text, ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object::Item::Content::Image, ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object::Item::Content::Video, ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object::Item::Content::Audio, ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object::Item::Content::Object)] - end - - class Label < ModerationAPI::Internal::Type::BaseModel - # @!attribute label - # The label name - # - # @return [String] - required :label, String - - # @!attribute score - # Confidence score between 0 and 1 - # - # @return [Float] - required :score, Float - - # @!attribute flagged - # Whether this label crossed its flagging threshold - # - # @return [Boolean, nil] - optional :flagged, ModerationAPI::Internal::Type::Boolean - - # @!attribute manual - # True if the label was applied manually by a moderator - # - # @return [Boolean, nil] - optional :manual, ModerationAPI::Internal::Type::Boolean - - # @!attribute matches - # - # @return [Array, nil] - optional :matches, - -> { ModerationAPI::Internal::Type::ArrayOf[ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::Label::Match] } - - # @!attribute shadow_flagged - # Whether this label crossed its threshold under a shadowed policy — reported for - # visibility, never counted toward a flagging decision - # - # @return [Boolean, nil] - optional :shadow_flagged, ModerationAPI::Internal::Type::Boolean - - # @!method initialize(label:, score:, flagged: nil, manual: nil, matches: nil, shadow_flagged: nil) - # Some parameter documentations has been truncated, see - # {ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object::Item::Label} - # for more details. - # - # @param label [String] The label name - # - # @param score [Float] Confidence score between 0 and 1 - # - # @param flagged [Boolean] Whether this label crossed its flagging threshold - # - # @param manual [Boolean] True if the label was applied manually by a moderator - # - # @param matches [Array] - # - # @param shadow_flagged [Boolean] Whether this label crossed its threshold under a shadowed policy — reported for - - class Match < ModerationAPI::Internal::Type::BaseModel - # @!attribute match - # The matched substring - # - # @return [String] - required :match, String - - # @!attribute probability - # Match confidence between 0 and 1 - # - # @return [Float] - required :probability, Float - - # @!attribute span - # [start, end] character offsets in the source text - # - # @return [Array] - required :span, ModerationAPI::Internal::Type::ArrayOf[ModerationAPI::Internal::Type::Unknown] - - # @!attribute entity_type - # - # @return [String, nil] - optional :entity_type, String - - # @!attribute mask - # - # @return [String, nil] - optional :mask, String, nil?: true - - # @!attribute reasons - # - # @return [Array, nil] - optional :reasons, ModerationAPI::Internal::Type::ArrayOf[String] - - # @!attribute scripts - # - # @return [Array, nil] - optional :scripts, ModerationAPI::Internal::Type::ArrayOf[String] - - # @!attribute signals - # - # @return [ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object::Item::Label::Match::Signals, nil] - optional :signals, - -> { ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::Label::Match::Signals } - - # @!attribute skeleton - # - # @return [String, nil] - optional :skeleton, String - - # @!method initialize(match:, probability:, span:, entity_type: nil, mask: nil, reasons: nil, scripts: nil, signals: nil, skeleton: nil) - # @param match [String] The matched substring - # - # @param probability [Float] Match confidence between 0 and 1 - # - # @param span [Array] [start, end] character offsets in the source text - # - # @param entity_type [String] - # - # @param mask [String, nil] - # - # @param reasons [Array] - # - # @param scripts [Array] - # - # @param signals [ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object::Item::Label::Match::Signals] - # - # @param skeleton [String] - - # @see ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object::Item::Label::Match#signals - class Signals < ModerationAPI::Internal::Type::BaseModel - # @!attribute bot_protection - # - # @return [Boolean, nil] - required :bot_protection, ModerationAPI::Internal::Type::Boolean, nil?: true - - # @!attribute brand_impersonation - # - # @return [ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object::Item::Label::Match::Signals::BrandImpersonation, nil] - required :brand_impersonation, - -> { - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::Label::Match::Signals::BrandImpersonation - }, - nil?: true - - # @!attribute domain_age_days - # - # @return [Float, nil] - required :domain_age_days, Float, nil?: true - - # @!attribute final_url - # - # @return [String, nil] - required :final_url, String, nil?: true - - # @!attribute has_email_setup - # - # @return [Boolean, nil] - required :has_email_setup, ModerationAPI::Internal::Type::Boolean, nil?: true - - # @!attribute has_suspicious_characters - # - # @return [Boolean] - required :has_suspicious_characters, ModerationAPI::Internal::Type::Boolean - - # @!attribute is_link_shortener - # - # @return [Boolean] - required :is_link_shortener, ModerationAPI::Internal::Type::Boolean - - # @!attribute is_reported - # - # @return [Boolean] - required :is_reported, ModerationAPI::Internal::Type::Boolean - - # @!attribute redirect_count - # - # @return [Float, nil] - required :redirect_count, Float, nil?: true - - # @!method initialize(bot_protection:, brand_impersonation:, domain_age_days:, final_url:, has_email_setup:, has_suspicious_characters:, is_link_shortener:, is_reported:, redirect_count:) - # @param bot_protection [Boolean, nil] - # @param brand_impersonation [ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object::Item::Label::Match::Signals::BrandImpersonation, nil] - # @param domain_age_days [Float, nil] - # @param final_url [String, nil] - # @param has_email_setup [Boolean, nil] - # @param has_suspicious_characters [Boolean] - # @param is_link_shortener [Boolean] - # @param is_reported [Boolean] - # @param redirect_count [Float, nil] - - # @see ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object::Item::Label::Match::Signals#brand_impersonation - class BrandImpersonation < ModerationAPI::Internal::Type::BaseModel - # @!attribute brand - # - # @return [String] - required :brand, String - - # @!attribute method_ - # - # @return [String] - required :method_, String, api_name: :method - - # @!method initialize(brand:, method_:) - # @param brand [String] - # @param method_ [String] - end - end - end - end - - # High-level content type (e.g. message, post, comment). Defaults to the channel's - # configured content type but can be overridden per request via the moderation API - # `type` field. - # - # @see ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object::Item#meta_type - module MetaType - extend ModerationAPI::Internal::Type::Enum - - PROFILE = :profile - MESSAGE = :message - POST = :post - COMMENT = :comment - EVENT = :event - PRODUCT = :product - REVIEW = :review - VOICE = :voice - OTHER = :other - - # @!method self.values - # @return [Array] - end - end - - # @see ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object#queue - class Queue < ModerationAPI::Internal::Type::BaseModel - # @!attribute id - # - # @return [String] - required :id, String - - # @!method initialize(id:) - # The queue the item belongs to, if any - # - # @param id [String] - end - end - end - end - - class QueueItemRejected < ModerationAPI::Internal::Type::BaseModel - # @!attribute id - # Stable event ID. Use this to dedupe retries. - # - # @return [String] - required :id, String - - # @!attribute api_version - # - # @return [Symbol, :v2] - required :api_version, const: :v2 - - # @!attribute created - # ISO 8601 timestamp of when the event was emitted. - # - # @return [Time] - required :created, Time - - # @!attribute data - # - # @return [ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data] - required :data, -> { ModerationAPI::WebhookEvent::QueueItemRejected::Data } - - # @!attribute type - # The event type. - # - # @return [Symbol, :"queue_item.rejected"] - required :type, const: :"queue_item.rejected" - - # @!method initialize(id:, created:, data:, api_version: :v2, type: :"queue_item.rejected") - # @param id [String] Stable event ID. Use this to dedupe retries. - # - # @param created [Time] ISO 8601 timestamp of when the event was emitted. - # - # @param data [ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data] - # - # @param api_version [Symbol, :v2] - # - # @param type [Symbol, :"queue_item.rejected"] The event type. - - # @see ModerationAPI::Models::WebhookEvent::QueueItemRejected#data - class Data < ModerationAPI::Internal::Type::BaseModel - # @!attribute object - # - # @return [ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object] - required :object, -> { ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object } - - # @!method initialize(object:) - # @param object [ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object] - - # @see ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data#object - class Object < ModerationAPI::Internal::Type::BaseModel - # @!attribute id - # Moderation action ID - # - # @return [String] - required :id, String - - # @!attribute created_at - # ISO 8601 timestamp of when the action was performed - # - # @return [Time] - required :created_at, Time - - # @!attribute key - # Customer-defined key identifying this action - # - # @return [String, nil] - required :key, String, nil?: true - - # @!attribute name - # Display name of the action - # - # @return [String, nil] - required :name, String, nil?: true - - # @!attribute value - # The value passed to the action when it ran - # - # @return [String, nil] - required :value, String, nil?: true - - # @!attribute author - # The author the action was performed on, if any - # - # @return [ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Author, nil] - optional :author, -> { ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Author } - - # @!attribute item - # The content item the action was performed on, if any - # - # @return [ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Item, nil] - optional :item, -> { ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item } - - # @!attribute queue - # The queue the item belongs to, if any - # - # @return [ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Queue, nil] - optional :queue, -> { ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Queue } - - # @!method initialize(id:, created_at:, key:, name:, value:, author: nil, item: nil, queue: nil) - # @param id [String] Moderation action ID - # - # @param created_at [Time] ISO 8601 timestamp of when the action was performed - # - # @param key [String, nil] Customer-defined key identifying this action - # - # @param name [String, nil] Display name of the action - # - # @param value [String, nil] The value passed to the action when it ran - # - # @param author [ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Author] The author the action was performed on, if any - # - # @param item [ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Item] The content item the action was performed on, if any - # - # @param queue [ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Queue] The queue the item belongs to, if any - - # @see ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object#author - class Author < ModerationAPI::Internal::Type::BaseModel - # @!attribute id - # Author ID in Moderation API - # - # @return [String] - required :id, String - - # @!attribute block - # Block or suspension details, if applicable. Null if the author is enabled. - # - # @return [ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Author::Block, nil] - required :block, - -> { ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Author::Block }, - nil?: true - - # @!attribute first_seen - # Timestamp when author first appeared - # - # @return [Float] - required :first_seen, Float - - # @!attribute last_seen - # Timestamp of last activity - # - # @return [Float] - required :last_seen, Float - - # @!attribute metadata - # Additional metadata provided by your system. We recommend including any relevant - # information that may assist in the moderation process. - # - # @return [ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Author::Metadata] - required :metadata, -> { ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Author::Metadata } - - # @!attribute metrics - # - # @return [ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Author::Metrics] - required :metrics, -> { ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Author::Metrics } - - # @!attribute risk_evaluation - # Risk assessment details, if available. - # - # @return [ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Author::RiskEvaluation, nil] - required :risk_evaluation, - -> { - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Author::RiskEvaluation - }, - nil?: true - - # @!attribute status - # Current author status - # - # @return [Symbol, ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Author::Status] - required :status, - enum: -> { ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Author::Status } - - # @!attribute trust_level - # - # @return [ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Author::TrustLevel] - required :trust_level, - -> { ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Author::TrustLevel } - - # @!attribute company - # The author's company or organization - # - # @return [String, nil] - optional :company, String, nil?: true - - # @!attribute email - # Author email address - # - # @return [String, nil] - optional :email, String, nil?: true - - # @!attribute external_id - # The author's ID from your system - # - # @return [String, nil] - optional :external_id, String, nil?: true - - # @!attribute external_link - # URL of the author's external profile - # - # @return [String, nil] - optional :external_link, String, nil?: true - - # @!attribute last_incident - # Timestamp of last incident - # - # @return [Float, nil] - optional :last_incident, Float, nil?: true - - # @!attribute name - # Author name or identifier - # - # @return [String, nil] - optional :name, String, nil?: true - - # @!attribute profile_picture - # URL of the author's profile picture - # - # @return [String, nil] - optional :profile_picture, String, nil?: true - - # @!method initialize(id:, block:, first_seen:, last_seen:, metadata:, metrics:, risk_evaluation:, status:, trust_level:, company: nil, email: nil, external_id: nil, external_link: nil, last_incident: nil, name: nil, profile_picture: nil) - # Some parameter documentations has been truncated, see - # {ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Author} - # for more details. - # - # The author the action was performed on, if any - # - # @param id [String] Author ID in Moderation API - # - # @param block [ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Author::Block, nil] Block or suspension details, if applicable. Null if the author is enabled. - # - # @param first_seen [Float] Timestamp when author first appeared - # - # @param last_seen [Float] Timestamp of last activity - # - # @param metadata [ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Author::Metadata] Additional metadata provided by your system. We recommend including any relevant - # - # @param metrics [ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Author::Metrics] - # - # @param risk_evaluation [ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Author::RiskEvaluation, nil] Risk assessment details, if available. - # - # @param status [Symbol, ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Author::Status] Current author status - # - # @param trust_level [ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Author::TrustLevel] - # - # @param company [String, nil] The author's company or organization - # - # @param email [String, nil] Author email address - # - # @param external_id [String, nil] The author's ID from your system - # - # @param external_link [String, nil] URL of the author's external profile - # - # @param last_incident [Float, nil] Timestamp of last incident - # - # @param name [String, nil] Author name or identifier - # - # @param profile_picture [String, nil] URL of the author's profile picture - - # @see ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Author#block - class Block < ModerationAPI::Internal::Type::BaseModel - # @!attribute reason - # The moderators reason why the author was blocked or suspended. - # - # @return [String, nil] - optional :reason, String, nil?: true - - # @!attribute until_ - # The timestamp until which they are blocked if the author is suspended. - # - # @return [Float, nil] - optional :until_, Float, api_name: :until, nil?: true - - # @!method initialize(reason: nil, until_: nil) - # Block or suspension details, if applicable. Null if the author is enabled. - # - # @param reason [String, nil] The moderators reason why the author was blocked or suspended. - # - # @param until_ [Float, nil] The timestamp until which they are blocked if the author is suspended. - end - - # @see ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Author#metadata - class Metadata < ModerationAPI::Internal::Type::BaseModel - # @!attribute email_verified - # Whether the author's email is verified - # - # @return [Boolean, nil] - optional :email_verified, ModerationAPI::Internal::Type::Boolean, nil?: true - - # @!attribute identity_verified - # Whether the author's identity is verified - # - # @return [Boolean, nil] - optional :identity_verified, ModerationAPI::Internal::Type::Boolean, nil?: true - - # @!attribute is_paying_customer - # Whether the author is a paying customer - # - # @return [Boolean, nil] - optional :is_paying_customer, ModerationAPI::Internal::Type::Boolean, nil?: true - - # @!attribute phone_verified - # Whether the author's phone number is verified - # - # @return [Boolean, nil] - optional :phone_verified, ModerationAPI::Internal::Type::Boolean, nil?: true - - # @!method initialize(email_verified: nil, identity_verified: nil, is_paying_customer: nil, phone_verified: nil) - # Additional metadata provided by your system. We recommend including any relevant - # information that may assist in the moderation process. - # - # @param email_verified [Boolean, nil] Whether the author's email is verified - # - # @param identity_verified [Boolean, nil] Whether the author's identity is verified - # - # @param is_paying_customer [Boolean, nil] Whether the author is a paying customer - # - # @param phone_verified [Boolean, nil] Whether the author's phone number is verified - end - - # @see ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Author#metrics - class Metrics < ModerationAPI::Internal::Type::BaseModel - # @!attribute flagged_content - # Number of flagged content pieces - # - # @return [Float] - required :flagged_content, Float - - # @!attribute total_content - # Total pieces of content - # - # @return [Float] - required :total_content, Float - - # @!attribute average_sentiment - # Average sentiment score of content (-1 to 1). Requires a sentiment model in your - # project. - # - # @return [Float, nil] - optional :average_sentiment, Float, nil?: true - - # @!method initialize(flagged_content:, total_content:, average_sentiment: nil) - # Some parameter documentations has been truncated, see - # {ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Author::Metrics} - # for more details. - # - # @param flagged_content [Float] Number of flagged content pieces - # - # @param total_content [Float] Total pieces of content - # - # @param average_sentiment [Float, nil] Average sentiment score of content (-1 to 1). Requires a sentiment model in your - end - - # @see ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Author#risk_evaluation - class RiskEvaluation < ModerationAPI::Internal::Type::BaseModel - # @!attribute risk_level - # Calculated risk level based on more than 10 behavioral signals. - # - # @return [Float, nil] - optional :risk_level, Float, nil?: true - - # @!method initialize(risk_level: nil) - # Risk assessment details, if available. - # - # @param risk_level [Float, nil] Calculated risk level based on more than 10 behavioral signals. - end - - # Current author status - # - # @see ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Author#status - module Status - extend ModerationAPI::Internal::Type::Enum - - ENABLED = :enabled - SUSPENDED = :suspended - BLOCKED = :blocked - - # @!method self.values - # @return [Array] - end - - # @see ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Author#trust_level - class TrustLevel < ModerationAPI::Internal::Type::BaseModel - # @!attribute level - # Author trust level (-1, 0, 1, 2, 3, or 4) - # - # @return [Float] - required :level, Float - - # @!attribute manual - # True if the trust level was set manually by a moderator - # - # @return [Boolean] - required :manual, ModerationAPI::Internal::Type::Boolean - - # @!method initialize(level:, manual:) - # @param level [Float] Author trust level (-1, 0, 1, 2, 3, or 4) - # - # @param manual [Boolean] True if the trust level was set manually by a moderator - end - end - - # @see ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object#item - class Item < ModerationAPI::Internal::Type::BaseModel - # @!attribute id - # Content ID from your system - # - # @return [String] - required :id, String - - # @!attribute author_id - # External author ID (the customer's identifier, not Moderation API's internal id) - # - # @return [String, nil] - required :author_id, String, nil?: true - - # @!attribute channel_key - # The channel the content was submitted to, identified by your customer-defined - # channel key. - # - # @return [String, nil] - required :channel_key, String, nil?: true - - # @!attribute client_action - # A recommendation from your own client-side flagging. - # - # @return [ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Item::ClientAction, nil] - required :client_action, - -> { - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::ClientAction - }, - nil?: true - - # @!attribute content - # The original content payload - # - # @return [ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Item::Content::Text, ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Item::Content::Image, ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Item::Content::Video, ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Item::Content::Audio, ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Item::Content::Object] - required :content, - union: -> { ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::Content } - - # @!attribute conversation_id - # Conversation grouping ID, if any - # - # @return [String, nil] - required :conversation_id, String, nil?: true - - # @!attribute flagged - # Whether the content was flagged by moderation - # - # @return [Boolean, nil] - required :flagged, ModerationAPI::Internal::Type::Boolean, nil?: true - - # @!attribute flagged_fields - # For object content, the field keys (e.g. "bio") that triggered a flag. Empty - # when no fields were flagged or the content is not an object. - # - # @return [Array] - required :flagged_fields, ModerationAPI::Internal::Type::ArrayOf[String] - - # @!attribute labels - # Moderation labels applied to the content - # - # @return [Array, nil] - required :labels, - -> { - ModerationAPI::Internal::Type::ArrayOf[ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::Label] - }, - nil?: true - - # @!attribute language - # Detected ISO language code, if available - # - # @return [String, nil] - required :language, String, nil?: true - - # @!attribute meta_type - # High-level content type (e.g. message, post, comment). Defaults to the channel's - # configured content type but can be overridden per request via the moderation API - # `type` field. - # - # @return [Symbol, ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Item::MetaType, nil] - required :meta_type, - enum: -> { - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::MetaType - }, - nil?: true - - # @!attribute metadata - # Arbitrary key/value metadata. Top-level keys are strings. - # - # @return [Hash{Symbol=>Object}, nil] - required :metadata, - ModerationAPI::Internal::Type::HashOf[ModerationAPI::Internal::Type::Unknown], - nil?: true - - # @!attribute timestamp - # ISO 8601 timestamp of when the content was submitted - # - # @return [Time] - required :timestamp, Time - - # @!method initialize(id:, author_id:, channel_key:, client_action:, content:, conversation_id:, flagged:, flagged_fields:, labels:, language:, meta_type:, metadata:, timestamp:) - # Some parameter documentations has been truncated, see - # {ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Item} for - # more details. - # - # The content item the action was performed on, if any - # - # @param id [String] Content ID from your system - # - # @param author_id [String, nil] External author ID (the customer's identifier, not Moderation API's internal id) - # - # @param channel_key [String, nil] The channel the content was submitted to, identified by your customer-defined ch - # - # @param client_action [ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Item::ClientAction, nil] A recommendation from your own client-side flagging. - # - # @param content [ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Item::Content::Text, ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Item::Content::Image, ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Item::Content::Video, ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Item::Content::Audio, ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Item::Content::Object] The original content payload - # - # @param conversation_id [String, nil] Conversation grouping ID, if any - # - # @param flagged [Boolean, nil] Whether the content was flagged by moderation - # - # @param flagged_fields [Array] For object content, the field keys (e.g. "bio") that triggered a flag. Empty whe - # - # @param labels [Array, nil] Moderation labels applied to the content - # - # @param language [String, nil] Detected ISO language code, if available - # - # @param meta_type [Symbol, ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Item::MetaType, nil] High-level content type (e.g. message, post, comment). Defaults to the channel's - # - # @param metadata [Hash{Symbol=>Object}, nil] Arbitrary key/value metadata. Top-level keys are strings. - # - # @param timestamp [Time] ISO 8601 timestamp of when the content was submitted - - # @see ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Item#client_action - class ClientAction < ModerationAPI::Internal::Type::BaseModel - # @!attribute action - # Your recommendation for the content: allow, review, or reject. - # - # @return [Symbol, ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Item::ClientAction::Action] - required :action, - enum: -> { ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::ClientAction::Action } - - # @!attribute behavior - # How your recommendation combines with ours. Defaults to 'escalate', which only - # applies it when stricter than ours; 'override' replaces ours outright. - # - # @return [Symbol, ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Item::ClientAction::Behavior, nil] - optional :behavior, - enum: -> { ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::ClientAction::Behavior } - - # @!attribute reason - # A human-readable explanation for your recommendation. - # - # @return [String, nil] - optional :reason, String - - # @!attribute source - # Where your recommendation came from, e.g. "banned-ip". - # - # @return [String, nil] - optional :source, String - - # @!method initialize(action:, behavior: nil, reason: nil, source: nil) - # Some parameter documentations has been truncated, see - # {ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Item::ClientAction} - # for more details. - # - # A recommendation from your own client-side flagging. - # - # @param action [Symbol, ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Item::ClientAction::Action] Your recommendation for the content: allow, review, or reject. - # - # @param behavior [Symbol, ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Item::ClientAction::Behavior] How your recommendation combines with ours. Defaults to 'escalate', which only a - # - # @param reason [String] A human-readable explanation for your recommendation. - # - # @param source [String] Where your recommendation came from, e.g. "banned-ip". - - # Your recommendation for the content: allow, review, or reject. - # - # @see ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Item::ClientAction#action - module Action - extend ModerationAPI::Internal::Type::Enum - - REVIEW = :review - ALLOW = :allow - REJECT = :reject - - # @!method self.values - # @return [Array] - end - - # How your recommendation combines with ours. Defaults to 'escalate', which only - # applies it when stricter than ours; 'override' replaces ours outright. - # - # @see ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Item::ClientAction#behavior - module Behavior - extend ModerationAPI::Internal::Type::Enum - - OVERRIDE = :override - ESCALATE = :escalate - - # @!method self.values - # @return [Array] - end - end - - # The original content payload - # - # @see ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Item#content - module Content - extend ModerationAPI::Internal::Type::Union - - # Text - variant -> { ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::Content::Text } - - # Image - variant -> { ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::Content::Image } - - # Video - variant -> { ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::Content::Video } - - # Audio - variant -> { ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::Content::Audio } - - # Object - variant -> { ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::Content::Object } - - class Text < ModerationAPI::Internal::Type::BaseModel - # @!attribute text - # The content text - # - # @return [String] - required :text, String - - # @!attribute type - # - # @return [Symbol, :text] - required :type, const: :text - - # @!method initialize(text:, type: :text) - # Text - # - # @param text [String] The content text - # - # @param type [Symbol, :text] - end - - class Image < ModerationAPI::Internal::Type::BaseModel - # @!attribute type - # - # @return [Symbol, :image] - required :type, const: :image - - # @!attribute data - # Base64-encoded image data. Either url or data must be provided. Note: base64 - # images are not stored and will not appear in the review queue. - # - # @return [String, nil] - optional :data, String - - # @!attribute url - # A public URL of the image content. Either url or data must be provided. - # - # @return [String, nil] - optional :url, String - - # @!method initialize(data: nil, url: nil, type: :image) - # Some parameter documentations has been truncated, see - # {ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Item::Content::Image} - # for more details. - # - # Image - # - # @param data [String] Base64-encoded image data. Either url or data must be provided. Note: base64 ima - # - # @param url [String] A public URL of the image content. Either url or data must be provided. - # - # @param type [Symbol, :image] - end - - class Video < ModerationAPI::Internal::Type::BaseModel - # @!attribute type - # - # @return [Symbol, :video] - required :type, const: :video - - # @!attribute url - # A public URL of the video content - # - # @return [String] - required :url, String - - # @!method initialize(url:, type: :video) - # Video - # - # @param url [String] A public URL of the video content - # - # @param type [Symbol, :video] - end - - class Audio < ModerationAPI::Internal::Type::BaseModel - # @!attribute type - # - # @return [Symbol, :audio] - required :type, const: :audio - - # @!attribute url - # The URL of the audio content - # - # @return [String] - required :url, String - - # @!method initialize(url:, type: :audio) - # Audio - # - # @param url [String] The URL of the audio content - # - # @param type [Symbol, :audio] - end - - class Object < ModerationAPI::Internal::Type::BaseModel - # @!attribute data - # Values in the object. Can be mixed content types. - # - # @return [Hash{Symbol=>ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Item::Content::Object::Data::Text, ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Item::Content::Object::Data::Image, ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Item::Content::Object::Data::Video, ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Item::Content::Object::Data::Audio}] - required :data, - -> { ModerationAPI::Internal::Type::HashOf[union: ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::Content::Object::Data] } - - # @!attribute type - # - # @return [Symbol, :object] - required :type, const: :object - - # @!method initialize(data:, type: :object) - # Object - # - # @param data [Hash{Symbol=>ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Item::Content::Object::Data::Text, ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Item::Content::Object::Data::Image, ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Item::Content::Object::Data::Video, ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Item::Content::Object::Data::Audio}] Values in the object. Can be mixed content types. - # - # @param type [Symbol, :object] - - # Text - module Data - extend ModerationAPI::Internal::Type::Union - - # Text - variant -> { ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::Content::Object::Data::Text } - - # Image - variant -> { ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::Content::Object::Data::Image } - - # Video - variant -> { ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::Content::Object::Data::Video } - - # Audio - variant -> { ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::Content::Object::Data::Audio } - - class Text < ModerationAPI::Internal::Type::BaseModel - # @!attribute text - # The content text - # - # @return [String] - required :text, String - - # @!attribute type - # - # @return [Symbol, :text] - required :type, const: :text - - # @!method initialize(text:, type: :text) - # Text - # - # @param text [String] The content text - # - # @param type [Symbol, :text] - end - - class Image < ModerationAPI::Internal::Type::BaseModel - # @!attribute type - # - # @return [Symbol, :image] - required :type, const: :image - - # @!attribute data - # Base64-encoded image data. Either url or data must be provided. Note: base64 - # images are not stored and will not appear in the review queue. - # - # @return [String, nil] - optional :data, String - - # @!attribute url - # A public URL of the image content. Either url or data must be provided. - # - # @return [String, nil] - optional :url, String - - # @!method initialize(data: nil, url: nil, type: :image) - # Some parameter documentations has been truncated, see - # {ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Item::Content::Object::Data::Image} - # for more details. - # - # Image - # - # @param data [String] Base64-encoded image data. Either url or data must be provided. Note: base64 ima - # - # @param url [String] A public URL of the image content. Either url or data must be provided. - # - # @param type [Symbol, :image] - end - - class Video < ModerationAPI::Internal::Type::BaseModel - # @!attribute type - # - # @return [Symbol, :video] - required :type, const: :video - - # @!attribute url - # A public URL of the video content - # - # @return [String] - required :url, String - - # @!method initialize(url:, type: :video) - # Video - # - # @param url [String] A public URL of the video content - # - # @param type [Symbol, :video] - end - - class Audio < ModerationAPI::Internal::Type::BaseModel - # @!attribute type - # - # @return [Symbol, :audio] - required :type, const: :audio - - # @!attribute url - # The URL of the audio content - # - # @return [String] - required :url, String - - # @!method initialize(url:, type: :audio) - # Audio - # - # @param url [String] The URL of the audio content - # - # @param type [Symbol, :audio] - end - - # @!method self.variants - # @return [Array(ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Item::Content::Object::Data::Text, ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Item::Content::Object::Data::Image, ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Item::Content::Object::Data::Video, ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Item::Content::Object::Data::Audio)] - end - end - - # @!method self.variants - # @return [Array(ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Item::Content::Text, ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Item::Content::Image, ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Item::Content::Video, ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Item::Content::Audio, ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Item::Content::Object)] - end - - class Label < ModerationAPI::Internal::Type::BaseModel - # @!attribute label - # The label name - # - # @return [String] - required :label, String - - # @!attribute score - # Confidence score between 0 and 1 - # - # @return [Float] - required :score, Float - - # @!attribute flagged - # Whether this label crossed its flagging threshold - # - # @return [Boolean, nil] - optional :flagged, ModerationAPI::Internal::Type::Boolean - - # @!attribute manual - # True if the label was applied manually by a moderator - # - # @return [Boolean, nil] - optional :manual, ModerationAPI::Internal::Type::Boolean - - # @!attribute matches - # - # @return [Array, nil] - optional :matches, - -> { ModerationAPI::Internal::Type::ArrayOf[ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::Label::Match] } - - # @!attribute shadow_flagged - # Whether this label crossed its threshold under a shadowed policy — reported for - # visibility, never counted toward a flagging decision - # - # @return [Boolean, nil] - optional :shadow_flagged, ModerationAPI::Internal::Type::Boolean - - # @!method initialize(label:, score:, flagged: nil, manual: nil, matches: nil, shadow_flagged: nil) - # Some parameter documentations has been truncated, see - # {ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Item::Label} - # for more details. - # - # @param label [String] The label name - # - # @param score [Float] Confidence score between 0 and 1 - # - # @param flagged [Boolean] Whether this label crossed its flagging threshold - # - # @param manual [Boolean] True if the label was applied manually by a moderator - # - # @param matches [Array] - # - # @param shadow_flagged [Boolean] Whether this label crossed its threshold under a shadowed policy — reported for - - class Match < ModerationAPI::Internal::Type::BaseModel - # @!attribute match - # The matched substring - # - # @return [String] - required :match, String - - # @!attribute probability - # Match confidence between 0 and 1 - # - # @return [Float] - required :probability, Float - - # @!attribute span - # [start, end] character offsets in the source text - # - # @return [Array] - required :span, ModerationAPI::Internal::Type::ArrayOf[ModerationAPI::Internal::Type::Unknown] - - # @!attribute entity_type - # - # @return [String, nil] - optional :entity_type, String - - # @!attribute mask - # - # @return [String, nil] - optional :mask, String, nil?: true - - # @!attribute reasons - # - # @return [Array, nil] - optional :reasons, ModerationAPI::Internal::Type::ArrayOf[String] - - # @!attribute scripts - # - # @return [Array, nil] - optional :scripts, ModerationAPI::Internal::Type::ArrayOf[String] - - # @!attribute signals - # - # @return [ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Item::Label::Match::Signals, nil] - optional :signals, - -> { ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::Label::Match::Signals } - - # @!attribute skeleton - # - # @return [String, nil] - optional :skeleton, String - - # @!method initialize(match:, probability:, span:, entity_type: nil, mask: nil, reasons: nil, scripts: nil, signals: nil, skeleton: nil) - # @param match [String] The matched substring - # - # @param probability [Float] Match confidence between 0 and 1 - # - # @param span [Array] [start, end] character offsets in the source text - # - # @param entity_type [String] - # - # @param mask [String, nil] - # - # @param reasons [Array] - # - # @param scripts [Array] - # - # @param signals [ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Item::Label::Match::Signals] - # - # @param skeleton [String] - - # @see ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Item::Label::Match#signals - class Signals < ModerationAPI::Internal::Type::BaseModel - # @!attribute bot_protection - # - # @return [Boolean, nil] - required :bot_protection, ModerationAPI::Internal::Type::Boolean, nil?: true - - # @!attribute brand_impersonation - # - # @return [ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Item::Label::Match::Signals::BrandImpersonation, nil] - required :brand_impersonation, - -> { - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::Label::Match::Signals::BrandImpersonation - }, - nil?: true - - # @!attribute domain_age_days - # - # @return [Float, nil] - required :domain_age_days, Float, nil?: true - - # @!attribute final_url - # - # @return [String, nil] - required :final_url, String, nil?: true - - # @!attribute has_email_setup - # - # @return [Boolean, nil] - required :has_email_setup, ModerationAPI::Internal::Type::Boolean, nil?: true - - # @!attribute has_suspicious_characters - # - # @return [Boolean] - required :has_suspicious_characters, ModerationAPI::Internal::Type::Boolean - - # @!attribute is_link_shortener - # - # @return [Boolean] - required :is_link_shortener, ModerationAPI::Internal::Type::Boolean - - # @!attribute is_reported - # - # @return [Boolean] - required :is_reported, ModerationAPI::Internal::Type::Boolean - - # @!attribute redirect_count - # - # @return [Float, nil] - required :redirect_count, Float, nil?: true - - # @!method initialize(bot_protection:, brand_impersonation:, domain_age_days:, final_url:, has_email_setup:, has_suspicious_characters:, is_link_shortener:, is_reported:, redirect_count:) - # @param bot_protection [Boolean, nil] - # @param brand_impersonation [ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Item::Label::Match::Signals::BrandImpersonation, nil] - # @param domain_age_days [Float, nil] - # @param final_url [String, nil] - # @param has_email_setup [Boolean, nil] - # @param has_suspicious_characters [Boolean] - # @param is_link_shortener [Boolean] - # @param is_reported [Boolean] - # @param redirect_count [Float, nil] - - # @see ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Item::Label::Match::Signals#brand_impersonation - class BrandImpersonation < ModerationAPI::Internal::Type::BaseModel - # @!attribute brand - # - # @return [String] - required :brand, String - - # @!attribute method_ - # - # @return [String] - required :method_, String, api_name: :method - - # @!method initialize(brand:, method_:) - # @param brand [String] - # @param method_ [String] - end - end - end - end - - # High-level content type (e.g. message, post, comment). Defaults to the channel's - # configured content type but can be overridden per request via the moderation API - # `type` field. - # - # @see ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Item#meta_type - module MetaType - extend ModerationAPI::Internal::Type::Enum - - PROFILE = :profile - MESSAGE = :message - POST = :post - COMMENT = :comment - EVENT = :event - PRODUCT = :product - REVIEW = :review - VOICE = :voice - OTHER = :other - - # @!method self.values - # @return [Array] - end - end - - # @see ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object#queue - class Queue < ModerationAPI::Internal::Type::BaseModel - # @!attribute id - # - # @return [String] - required :id, String - - # @!method initialize(id:) - # The queue the item belongs to, if any - # - # @param id [String] - end - end - end - end - - class QueueItemAllowed < ModerationAPI::Internal::Type::BaseModel - # @!attribute id - # Stable event ID. Use this to dedupe retries. - # - # @return [String] - required :id, String - - # @!attribute api_version - # - # @return [Symbol, :v2] - required :api_version, const: :v2 - - # @!attribute created - # ISO 8601 timestamp of when the event was emitted. - # - # @return [Time] - required :created, Time - - # @!attribute data - # - # @return [ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data] - required :data, -> { ModerationAPI::WebhookEvent::QueueItemAllowed::Data } - - # @!attribute type - # The event type. - # - # @return [Symbol, :"queue_item.allowed"] - required :type, const: :"queue_item.allowed" - - # @!method initialize(id:, created:, data:, api_version: :v2, type: :"queue_item.allowed") - # @param id [String] Stable event ID. Use this to dedupe retries. - # - # @param created [Time] ISO 8601 timestamp of when the event was emitted. - # - # @param data [ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data] - # - # @param api_version [Symbol, :v2] - # - # @param type [Symbol, :"queue_item.allowed"] The event type. - - # @see ModerationAPI::Models::WebhookEvent::QueueItemAllowed#data - class Data < ModerationAPI::Internal::Type::BaseModel - # @!attribute object - # - # @return [ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object] - required :object, -> { ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object } - - # @!method initialize(object:) - # @param object [ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object] - - # @see ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data#object - class Object < ModerationAPI::Internal::Type::BaseModel - # @!attribute id - # Moderation action ID - # - # @return [String] - required :id, String - - # @!attribute created_at - # ISO 8601 timestamp of when the action was performed - # - # @return [Time] - required :created_at, Time - - # @!attribute key - # Customer-defined key identifying this action - # - # @return [String, nil] - required :key, String, nil?: true - - # @!attribute name - # Display name of the action - # - # @return [String, nil] - required :name, String, nil?: true - - # @!attribute value - # The value passed to the action when it ran - # - # @return [String, nil] - required :value, String, nil?: true - - # @!attribute author - # The author the action was performed on, if any - # - # @return [ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object::Author, nil] - optional :author, -> { ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Author } - - # @!attribute item - # The content item the action was performed on, if any - # - # @return [ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object::Item, nil] - optional :item, -> { ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item } - - # @!attribute queue - # The queue the item belongs to, if any - # - # @return [ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object::Queue, nil] - optional :queue, -> { ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Queue } - - # @!method initialize(id:, created_at:, key:, name:, value:, author: nil, item: nil, queue: nil) - # @param id [String] Moderation action ID - # - # @param created_at [Time] ISO 8601 timestamp of when the action was performed - # - # @param key [String, nil] Customer-defined key identifying this action - # - # @param name [String, nil] Display name of the action - # - # @param value [String, nil] The value passed to the action when it ran - # - # @param author [ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object::Author] The author the action was performed on, if any - # - # @param item [ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object::Item] The content item the action was performed on, if any - # - # @param queue [ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object::Queue] The queue the item belongs to, if any - - # @see ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object#author - class Author < ModerationAPI::Internal::Type::BaseModel - # @!attribute id - # Author ID in Moderation API - # - # @return [String] - required :id, String - - # @!attribute block - # Block or suspension details, if applicable. Null if the author is enabled. - # - # @return [ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object::Author::Block, nil] - required :block, - -> { ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Author::Block }, - nil?: true - - # @!attribute first_seen - # Timestamp when author first appeared - # - # @return [Float] - required :first_seen, Float - - # @!attribute last_seen - # Timestamp of last activity - # - # @return [Float] - required :last_seen, Float - - # @!attribute metadata - # Additional metadata provided by your system. We recommend including any relevant - # information that may assist in the moderation process. - # - # @return [ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object::Author::Metadata] - required :metadata, -> { ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Author::Metadata } - - # @!attribute metrics - # - # @return [ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object::Author::Metrics] - required :metrics, -> { ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Author::Metrics } - - # @!attribute risk_evaluation - # Risk assessment details, if available. - # - # @return [ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object::Author::RiskEvaluation, nil] - required :risk_evaluation, - -> { - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Author::RiskEvaluation - }, - nil?: true - - # @!attribute status - # Current author status - # - # @return [Symbol, ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object::Author::Status] - required :status, enum: -> { ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Author::Status } - - # @!attribute trust_level - # - # @return [ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object::Author::TrustLevel] - required :trust_level, - -> { ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Author::TrustLevel } - - # @!attribute company - # The author's company or organization - # - # @return [String, nil] - optional :company, String, nil?: true - - # @!attribute email - # Author email address - # - # @return [String, nil] - optional :email, String, nil?: true - - # @!attribute external_id - # The author's ID from your system - # - # @return [String, nil] - optional :external_id, String, nil?: true - - # @!attribute external_link - # URL of the author's external profile - # - # @return [String, nil] - optional :external_link, String, nil?: true - - # @!attribute last_incident - # Timestamp of last incident - # - # @return [Float, nil] - optional :last_incident, Float, nil?: true - - # @!attribute name - # Author name or identifier - # - # @return [String, nil] - optional :name, String, nil?: true - - # @!attribute profile_picture - # URL of the author's profile picture - # - # @return [String, nil] - optional :profile_picture, String, nil?: true - - # @!method initialize(id:, block:, first_seen:, last_seen:, metadata:, metrics:, risk_evaluation:, status:, trust_level:, company: nil, email: nil, external_id: nil, external_link: nil, last_incident: nil, name: nil, profile_picture: nil) - # Some parameter documentations has been truncated, see - # {ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object::Author} - # for more details. - # - # The author the action was performed on, if any - # - # @param id [String] Author ID in Moderation API - # - # @param block [ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object::Author::Block, nil] Block or suspension details, if applicable. Null if the author is enabled. - # - # @param first_seen [Float] Timestamp when author first appeared - # - # @param last_seen [Float] Timestamp of last activity - # - # @param metadata [ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object::Author::Metadata] Additional metadata provided by your system. We recommend including any relevant - # - # @param metrics [ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object::Author::Metrics] - # - # @param risk_evaluation [ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object::Author::RiskEvaluation, nil] Risk assessment details, if available. - # - # @param status [Symbol, ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object::Author::Status] Current author status - # - # @param trust_level [ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object::Author::TrustLevel] - # - # @param company [String, nil] The author's company or organization - # - # @param email [String, nil] Author email address - # - # @param external_id [String, nil] The author's ID from your system - # - # @param external_link [String, nil] URL of the author's external profile - # - # @param last_incident [Float, nil] Timestamp of last incident - # - # @param name [String, nil] Author name or identifier - # - # @param profile_picture [String, nil] URL of the author's profile picture - - # @see ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object::Author#block - class Block < ModerationAPI::Internal::Type::BaseModel - # @!attribute reason - # The moderators reason why the author was blocked or suspended. - # - # @return [String, nil] - optional :reason, String, nil?: true - - # @!attribute until_ - # The timestamp until which they are blocked if the author is suspended. - # - # @return [Float, nil] - optional :until_, Float, api_name: :until, nil?: true - - # @!method initialize(reason: nil, until_: nil) - # Block or suspension details, if applicable. Null if the author is enabled. - # - # @param reason [String, nil] The moderators reason why the author was blocked or suspended. - # - # @param until_ [Float, nil] The timestamp until which they are blocked if the author is suspended. - end - - # @see ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object::Author#metadata - class Metadata < ModerationAPI::Internal::Type::BaseModel - # @!attribute email_verified - # Whether the author's email is verified - # - # @return [Boolean, nil] - optional :email_verified, ModerationAPI::Internal::Type::Boolean, nil?: true - - # @!attribute identity_verified - # Whether the author's identity is verified - # - # @return [Boolean, nil] - optional :identity_verified, ModerationAPI::Internal::Type::Boolean, nil?: true - - # @!attribute is_paying_customer - # Whether the author is a paying customer - # - # @return [Boolean, nil] - optional :is_paying_customer, ModerationAPI::Internal::Type::Boolean, nil?: true - - # @!attribute phone_verified - # Whether the author's phone number is verified - # - # @return [Boolean, nil] - optional :phone_verified, ModerationAPI::Internal::Type::Boolean, nil?: true - - # @!method initialize(email_verified: nil, identity_verified: nil, is_paying_customer: nil, phone_verified: nil) - # Additional metadata provided by your system. We recommend including any relevant - # information that may assist in the moderation process. - # - # @param email_verified [Boolean, nil] Whether the author's email is verified - # - # @param identity_verified [Boolean, nil] Whether the author's identity is verified - # - # @param is_paying_customer [Boolean, nil] Whether the author is a paying customer - # - # @param phone_verified [Boolean, nil] Whether the author's phone number is verified - end - - # @see ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object::Author#metrics - class Metrics < ModerationAPI::Internal::Type::BaseModel - # @!attribute flagged_content - # Number of flagged content pieces - # - # @return [Float] - required :flagged_content, Float - - # @!attribute total_content - # Total pieces of content - # - # @return [Float] - required :total_content, Float - - # @!attribute average_sentiment - # Average sentiment score of content (-1 to 1). Requires a sentiment model in your - # project. - # - # @return [Float, nil] - optional :average_sentiment, Float, nil?: true - - # @!method initialize(flagged_content:, total_content:, average_sentiment: nil) - # Some parameter documentations has been truncated, see - # {ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object::Author::Metrics} - # for more details. - # - # @param flagged_content [Float] Number of flagged content pieces - # - # @param total_content [Float] Total pieces of content - # - # @param average_sentiment [Float, nil] Average sentiment score of content (-1 to 1). Requires a sentiment model in your - end - - # @see ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object::Author#risk_evaluation - class RiskEvaluation < ModerationAPI::Internal::Type::BaseModel - # @!attribute risk_level - # Calculated risk level based on more than 10 behavioral signals. - # - # @return [Float, nil] - optional :risk_level, Float, nil?: true - - # @!method initialize(risk_level: nil) - # Risk assessment details, if available. - # - # @param risk_level [Float, nil] Calculated risk level based on more than 10 behavioral signals. - end - - # Current author status - # - # @see ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object::Author#status - module Status - extend ModerationAPI::Internal::Type::Enum - - ENABLED = :enabled - SUSPENDED = :suspended - BLOCKED = :blocked - - # @!method self.values - # @return [Array] - end - - # @see ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object::Author#trust_level - class TrustLevel < ModerationAPI::Internal::Type::BaseModel - # @!attribute level - # Author trust level (-1, 0, 1, 2, 3, or 4) - # - # @return [Float] - required :level, Float - - # @!attribute manual - # True if the trust level was set manually by a moderator - # - # @return [Boolean] - required :manual, ModerationAPI::Internal::Type::Boolean - - # @!method initialize(level:, manual:) - # @param level [Float] Author trust level (-1, 0, 1, 2, 3, or 4) - # - # @param manual [Boolean] True if the trust level was set manually by a moderator - end - end - - # @see ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object#item - class Item < ModerationAPI::Internal::Type::BaseModel - # @!attribute id - # Content ID from your system - # - # @return [String] - required :id, String - - # @!attribute author_id - # External author ID (the customer's identifier, not Moderation API's internal id) - # - # @return [String, nil] - required :author_id, String, nil?: true - - # @!attribute channel_key - # The channel the content was submitted to, identified by your customer-defined - # channel key. - # - # @return [String, nil] - required :channel_key, String, nil?: true - - # @!attribute client_action - # A recommendation from your own client-side flagging. - # - # @return [ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object::Item::ClientAction, nil] - required :client_action, - -> { ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::ClientAction }, - nil?: true - - # @!attribute content - # The original content payload - # - # @return [ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object::Item::Content::Text, ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object::Item::Content::Image, ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object::Item::Content::Video, ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object::Item::Content::Audio, ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object::Item::Content::Object] - required :content, - union: -> { ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::Content } - - # @!attribute conversation_id - # Conversation grouping ID, if any - # - # @return [String, nil] - required :conversation_id, String, nil?: true - - # @!attribute flagged - # Whether the content was flagged by moderation - # - # @return [Boolean, nil] - required :flagged, ModerationAPI::Internal::Type::Boolean, nil?: true - - # @!attribute flagged_fields - # For object content, the field keys (e.g. "bio") that triggered a flag. Empty - # when no fields were flagged or the content is not an object. - # - # @return [Array] - required :flagged_fields, ModerationAPI::Internal::Type::ArrayOf[String] - - # @!attribute labels - # Moderation labels applied to the content - # - # @return [Array, nil] - required :labels, - -> { - ModerationAPI::Internal::Type::ArrayOf[ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::Label] - }, - nil?: true - - # @!attribute language - # Detected ISO language code, if available - # - # @return [String, nil] - required :language, String, nil?: true - - # @!attribute meta_type - # High-level content type (e.g. message, post, comment). Defaults to the channel's - # configured content type but can be overridden per request via the moderation API - # `type` field. - # - # @return [Symbol, ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object::Item::MetaType, nil] - required :meta_type, - enum: -> { - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::MetaType - }, - nil?: true - - # @!attribute metadata - # Arbitrary key/value metadata. Top-level keys are strings. - # - # @return [Hash{Symbol=>Object}, nil] - required :metadata, - ModerationAPI::Internal::Type::HashOf[ModerationAPI::Internal::Type::Unknown], - nil?: true - - # @!attribute timestamp - # ISO 8601 timestamp of when the content was submitted - # - # @return [Time] - required :timestamp, Time - - # @!method initialize(id:, author_id:, channel_key:, client_action:, content:, conversation_id:, flagged:, flagged_fields:, labels:, language:, meta_type:, metadata:, timestamp:) - # Some parameter documentations has been truncated, see - # {ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object::Item} for - # more details. - # - # The content item the action was performed on, if any - # - # @param id [String] Content ID from your system - # - # @param author_id [String, nil] External author ID (the customer's identifier, not Moderation API's internal id) - # - # @param channel_key [String, nil] The channel the content was submitted to, identified by your customer-defined ch - # - # @param client_action [ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object::Item::ClientAction, nil] A recommendation from your own client-side flagging. - # - # @param content [ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object::Item::Content::Text, ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object::Item::Content::Image, ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object::Item::Content::Video, ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object::Item::Content::Audio, ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object::Item::Content::Object] The original content payload - # - # @param conversation_id [String, nil] Conversation grouping ID, if any - # - # @param flagged [Boolean, nil] Whether the content was flagged by moderation - # - # @param flagged_fields [Array] For object content, the field keys (e.g. "bio") that triggered a flag. Empty whe - # - # @param labels [Array, nil] Moderation labels applied to the content - # - # @param language [String, nil] Detected ISO language code, if available - # - # @param meta_type [Symbol, ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object::Item::MetaType, nil] High-level content type (e.g. message, post, comment). Defaults to the channel's - # - # @param metadata [Hash{Symbol=>Object}, nil] Arbitrary key/value metadata. Top-level keys are strings. - # - # @param timestamp [Time] ISO 8601 timestamp of when the content was submitted - - # @see ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object::Item#client_action - class ClientAction < ModerationAPI::Internal::Type::BaseModel - # @!attribute action - # Your recommendation for the content: allow, review, or reject. - # - # @return [Symbol, ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object::Item::ClientAction::Action] - required :action, - enum: -> { ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::ClientAction::Action } - - # @!attribute behavior - # How your recommendation combines with ours. Defaults to 'escalate', which only - # applies it when stricter than ours; 'override' replaces ours outright. - # - # @return [Symbol, ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object::Item::ClientAction::Behavior, nil] - optional :behavior, - enum: -> { ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::ClientAction::Behavior } - - # @!attribute reason - # A human-readable explanation for your recommendation. - # - # @return [String, nil] - optional :reason, String - - # @!attribute source - # Where your recommendation came from, e.g. "banned-ip". - # - # @return [String, nil] - optional :source, String - - # @!method initialize(action:, behavior: nil, reason: nil, source: nil) - # Some parameter documentations has been truncated, see - # {ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object::Item::ClientAction} - # for more details. - # - # A recommendation from your own client-side flagging. - # - # @param action [Symbol, ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object::Item::ClientAction::Action] Your recommendation for the content: allow, review, or reject. - # - # @param behavior [Symbol, ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object::Item::ClientAction::Behavior] How your recommendation combines with ours. Defaults to 'escalate', which only a - # - # @param reason [String] A human-readable explanation for your recommendation. - # - # @param source [String] Where your recommendation came from, e.g. "banned-ip". - - # Your recommendation for the content: allow, review, or reject. - # - # @see ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object::Item::ClientAction#action - module Action - extend ModerationAPI::Internal::Type::Enum - - REVIEW = :review - ALLOW = :allow - REJECT = :reject - - # @!method self.values - # @return [Array] - end - - # How your recommendation combines with ours. Defaults to 'escalate', which only - # applies it when stricter than ours; 'override' replaces ours outright. - # - # @see ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object::Item::ClientAction#behavior - module Behavior - extend ModerationAPI::Internal::Type::Enum - - OVERRIDE = :override - ESCALATE = :escalate - - # @!method self.values - # @return [Array] - end - end - - # The original content payload - # - # @see ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object::Item#content - module Content - extend ModerationAPI::Internal::Type::Union - - # Text - variant -> { ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::Content::Text } - - # Image - variant -> { ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::Content::Image } - - # Video - variant -> { ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::Content::Video } - - # Audio - variant -> { ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::Content::Audio } - - # Object - variant -> { ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::Content::Object } - - class Text < ModerationAPI::Internal::Type::BaseModel - # @!attribute text - # The content text - # - # @return [String] - required :text, String - - # @!attribute type - # - # @return [Symbol, :text] - required :type, const: :text - - # @!method initialize(text:, type: :text) - # Text - # - # @param text [String] The content text - # - # @param type [Symbol, :text] - end - - class Image < ModerationAPI::Internal::Type::BaseModel - # @!attribute type - # - # @return [Symbol, :image] - required :type, const: :image - - # @!attribute data - # Base64-encoded image data. Either url or data must be provided. Note: base64 - # images are not stored and will not appear in the review queue. - # - # @return [String, nil] - optional :data, String - - # @!attribute url - # A public URL of the image content. Either url or data must be provided. - # - # @return [String, nil] - optional :url, String - - # @!method initialize(data: nil, url: nil, type: :image) - # Some parameter documentations has been truncated, see - # {ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object::Item::Content::Image} - # for more details. - # - # Image - # - # @param data [String] Base64-encoded image data. Either url or data must be provided. Note: base64 ima - # - # @param url [String] A public URL of the image content. Either url or data must be provided. - # - # @param type [Symbol, :image] - end - - class Video < ModerationAPI::Internal::Type::BaseModel - # @!attribute type - # - # @return [Symbol, :video] - required :type, const: :video - - # @!attribute url - # A public URL of the video content - # - # @return [String] - required :url, String - - # @!method initialize(url:, type: :video) - # Video - # - # @param url [String] A public URL of the video content - # - # @param type [Symbol, :video] - end - - class Audio < ModerationAPI::Internal::Type::BaseModel - # @!attribute type - # - # @return [Symbol, :audio] - required :type, const: :audio - - # @!attribute url - # The URL of the audio content - # - # @return [String] - required :url, String - - # @!method initialize(url:, type: :audio) - # Audio - # - # @param url [String] The URL of the audio content - # - # @param type [Symbol, :audio] - end - - class Object < ModerationAPI::Internal::Type::BaseModel - # @!attribute data - # Values in the object. Can be mixed content types. - # - # @return [Hash{Symbol=>ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object::Item::Content::Object::Data::Text, ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object::Item::Content::Object::Data::Image, ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object::Item::Content::Object::Data::Video, ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object::Item::Content::Object::Data::Audio}] - required :data, - -> { ModerationAPI::Internal::Type::HashOf[union: ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::Content::Object::Data] } - - # @!attribute type - # - # @return [Symbol, :object] - required :type, const: :object - - # @!method initialize(data:, type: :object) - # Object - # - # @param data [Hash{Symbol=>ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object::Item::Content::Object::Data::Text, ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object::Item::Content::Object::Data::Image, ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object::Item::Content::Object::Data::Video, ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object::Item::Content::Object::Data::Audio}] Values in the object. Can be mixed content types. - # - # @param type [Symbol, :object] - - # Text - module Data - extend ModerationAPI::Internal::Type::Union - - # Text - variant -> { ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::Content::Object::Data::Text } - - # Image - variant -> { ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::Content::Object::Data::Image } - - # Video - variant -> { ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::Content::Object::Data::Video } - - # Audio - variant -> { ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::Content::Object::Data::Audio } - - class Text < ModerationAPI::Internal::Type::BaseModel - # @!attribute text - # The content text - # - # @return [String] - required :text, String - - # @!attribute type - # - # @return [Symbol, :text] - required :type, const: :text - - # @!method initialize(text:, type: :text) - # Text - # - # @param text [String] The content text - # - # @param type [Symbol, :text] - end - - class Image < ModerationAPI::Internal::Type::BaseModel - # @!attribute type - # - # @return [Symbol, :image] - required :type, const: :image - - # @!attribute data - # Base64-encoded image data. Either url or data must be provided. Note: base64 - # images are not stored and will not appear in the review queue. - # - # @return [String, nil] - optional :data, String - - # @!attribute url - # A public URL of the image content. Either url or data must be provided. - # - # @return [String, nil] - optional :url, String - - # @!method initialize(data: nil, url: nil, type: :image) - # Some parameter documentations has been truncated, see - # {ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object::Item::Content::Object::Data::Image} - # for more details. - # - # Image - # - # @param data [String] Base64-encoded image data. Either url or data must be provided. Note: base64 ima - # - # @param url [String] A public URL of the image content. Either url or data must be provided. - # - # @param type [Symbol, :image] - end - - class Video < ModerationAPI::Internal::Type::BaseModel - # @!attribute type - # - # @return [Symbol, :video] - required :type, const: :video - - # @!attribute url - # A public URL of the video content - # - # @return [String] - required :url, String - - # @!method initialize(url:, type: :video) - # Video - # - # @param url [String] A public URL of the video content - # - # @param type [Symbol, :video] - end - - class Audio < ModerationAPI::Internal::Type::BaseModel - # @!attribute type - # - # @return [Symbol, :audio] - required :type, const: :audio - - # @!attribute url - # The URL of the audio content - # - # @return [String] - required :url, String - - # @!method initialize(url:, type: :audio) - # Audio - # - # @param url [String] The URL of the audio content - # - # @param type [Symbol, :audio] - end - - # @!method self.variants - # @return [Array(ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object::Item::Content::Object::Data::Text, ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object::Item::Content::Object::Data::Image, ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object::Item::Content::Object::Data::Video, ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object::Item::Content::Object::Data::Audio)] - end - end - - # @!method self.variants - # @return [Array(ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object::Item::Content::Text, ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object::Item::Content::Image, ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object::Item::Content::Video, ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object::Item::Content::Audio, ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object::Item::Content::Object)] - end - - class Label < ModerationAPI::Internal::Type::BaseModel - # @!attribute label - # The label name - # - # @return [String] - required :label, String - - # @!attribute score - # Confidence score between 0 and 1 - # - # @return [Float] - required :score, Float - - # @!attribute flagged - # Whether this label crossed its flagging threshold - # - # @return [Boolean, nil] - optional :flagged, ModerationAPI::Internal::Type::Boolean - - # @!attribute manual - # True if the label was applied manually by a moderator - # - # @return [Boolean, nil] - optional :manual, ModerationAPI::Internal::Type::Boolean - - # @!attribute matches - # - # @return [Array, nil] - optional :matches, - -> { ModerationAPI::Internal::Type::ArrayOf[ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::Label::Match] } - - # @!attribute shadow_flagged - # Whether this label crossed its threshold under a shadowed policy — reported for - # visibility, never counted toward a flagging decision - # - # @return [Boolean, nil] - optional :shadow_flagged, ModerationAPI::Internal::Type::Boolean - - # @!method initialize(label:, score:, flagged: nil, manual: nil, matches: nil, shadow_flagged: nil) - # Some parameter documentations has been truncated, see - # {ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object::Item::Label} - # for more details. - # - # @param label [String] The label name - # - # @param score [Float] Confidence score between 0 and 1 - # - # @param flagged [Boolean] Whether this label crossed its flagging threshold - # - # @param manual [Boolean] True if the label was applied manually by a moderator - # - # @param matches [Array] - # - # @param shadow_flagged [Boolean] Whether this label crossed its threshold under a shadowed policy — reported for - - class Match < ModerationAPI::Internal::Type::BaseModel - # @!attribute match - # The matched substring - # - # @return [String] - required :match, String - - # @!attribute probability - # Match confidence between 0 and 1 - # - # @return [Float] - required :probability, Float - - # @!attribute span - # [start, end] character offsets in the source text - # - # @return [Array] - required :span, ModerationAPI::Internal::Type::ArrayOf[ModerationAPI::Internal::Type::Unknown] - - # @!attribute entity_type - # - # @return [String, nil] - optional :entity_type, String - - # @!attribute mask - # - # @return [String, nil] - optional :mask, String, nil?: true - - # @!attribute reasons - # - # @return [Array, nil] - optional :reasons, ModerationAPI::Internal::Type::ArrayOf[String] - - # @!attribute scripts - # - # @return [Array, nil] - optional :scripts, ModerationAPI::Internal::Type::ArrayOf[String] - - # @!attribute signals - # - # @return [ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object::Item::Label::Match::Signals, nil] - optional :signals, - -> { ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::Label::Match::Signals } - - # @!attribute skeleton - # - # @return [String, nil] - optional :skeleton, String - - # @!method initialize(match:, probability:, span:, entity_type: nil, mask: nil, reasons: nil, scripts: nil, signals: nil, skeleton: nil) - # @param match [String] The matched substring - # - # @param probability [Float] Match confidence between 0 and 1 - # - # @param span [Array] [start, end] character offsets in the source text - # - # @param entity_type [String] - # - # @param mask [String, nil] - # - # @param reasons [Array] - # - # @param scripts [Array] - # - # @param signals [ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object::Item::Label::Match::Signals] - # - # @param skeleton [String] - - # @see ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object::Item::Label::Match#signals - class Signals < ModerationAPI::Internal::Type::BaseModel - # @!attribute bot_protection - # - # @return [Boolean, nil] - required :bot_protection, ModerationAPI::Internal::Type::Boolean, nil?: true - - # @!attribute brand_impersonation - # - # @return [ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object::Item::Label::Match::Signals::BrandImpersonation, nil] - required :brand_impersonation, - -> { - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::Label::Match::Signals::BrandImpersonation - }, - nil?: true - - # @!attribute domain_age_days - # - # @return [Float, nil] - required :domain_age_days, Float, nil?: true - - # @!attribute final_url - # - # @return [String, nil] - required :final_url, String, nil?: true - - # @!attribute has_email_setup - # - # @return [Boolean, nil] - required :has_email_setup, ModerationAPI::Internal::Type::Boolean, nil?: true - - # @!attribute has_suspicious_characters - # - # @return [Boolean] - required :has_suspicious_characters, ModerationAPI::Internal::Type::Boolean - - # @!attribute is_link_shortener - # - # @return [Boolean] - required :is_link_shortener, ModerationAPI::Internal::Type::Boolean - - # @!attribute is_reported - # - # @return [Boolean] - required :is_reported, ModerationAPI::Internal::Type::Boolean - - # @!attribute redirect_count - # - # @return [Float, nil] - required :redirect_count, Float, nil?: true - - # @!method initialize(bot_protection:, brand_impersonation:, domain_age_days:, final_url:, has_email_setup:, has_suspicious_characters:, is_link_shortener:, is_reported:, redirect_count:) - # @param bot_protection [Boolean, nil] - # @param brand_impersonation [ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object::Item::Label::Match::Signals::BrandImpersonation, nil] - # @param domain_age_days [Float, nil] - # @param final_url [String, nil] - # @param has_email_setup [Boolean, nil] - # @param has_suspicious_characters [Boolean] - # @param is_link_shortener [Boolean] - # @param is_reported [Boolean] - # @param redirect_count [Float, nil] - - # @see ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object::Item::Label::Match::Signals#brand_impersonation - class BrandImpersonation < ModerationAPI::Internal::Type::BaseModel - # @!attribute brand - # - # @return [String] - required :brand, String - - # @!attribute method_ - # - # @return [String] - required :method_, String, api_name: :method - - # @!method initialize(brand:, method_:) - # @param brand [String] - # @param method_ [String] - end - end - end - end - - # High-level content type (e.g. message, post, comment). Defaults to the channel's - # configured content type but can be overridden per request via the moderation API - # `type` field. - # - # @see ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object::Item#meta_type - module MetaType - extend ModerationAPI::Internal::Type::Enum - - PROFILE = :profile - MESSAGE = :message - POST = :post - COMMENT = :comment - EVENT = :event - PRODUCT = :product - REVIEW = :review - VOICE = :voice - OTHER = :other - - # @!method self.values - # @return [Array] - end - end - - # @see ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object#queue - class Queue < ModerationAPI::Internal::Type::BaseModel - # @!attribute id - # - # @return [String] - required :id, String - - # @!method initialize(id:) - # The queue the item belongs to, if any - # - # @param id [String] - end - end - end - end - - # @!method self.variants - # @return [Array(ModerationAPI::Models::WebhookEvent::AuthorBlocked, ModerationAPI::Models::WebhookEvent::AuthorUnblocked, ModerationAPI::Models::WebhookEvent::AuthorSuspended, ModerationAPI::Models::WebhookEvent::AuthorUpdated, ModerationAPI::Models::WebhookEvent::AuthorTrustLevelChanged, ModerationAPI::Models::WebhookEvent::AuthorAction, ModerationAPI::Models::WebhookEvent::QueueItemResolved, ModerationAPI::Models::WebhookEvent::QueueItemAction, ModerationAPI::Models::WebhookEvent::QueueItemRejected, ModerationAPI::Models::WebhookEvent::QueueItemAllowed)] - end - end -end diff --git a/lib/moderation_api/models/webhook_list_params.rb b/lib/moderation_api/models/webhook_list_params.rb deleted file mode 100644 index 2c3cb07a..00000000 --- a/lib/moderation_api/models/webhook_list_params.rb +++ /dev/null @@ -1,14 +0,0 @@ -# frozen_string_literal: true - -module ModerationAPI - module Models - # @see ModerationAPI::Resources::Webhooks#list - class WebhookListParams < ModerationAPI::Internal::Type::BaseModel - extend ModerationAPI::Internal::Type::RequestParameters::Converter - include ModerationAPI::Internal::Type::RequestParameters - - # @!method initialize(request_options: {}) - # @param request_options [ModerationAPI::RequestOptions, Hash{Symbol=>Object}] - end - end -end diff --git a/lib/moderation_api/models/webhook_list_response.rb b/lib/moderation_api/models/webhook_list_response.rb deleted file mode 100644 index 20786742..00000000 --- a/lib/moderation_api/models/webhook_list_response.rb +++ /dev/null @@ -1,110 +0,0 @@ -# frozen_string_literal: true - -module ModerationAPI - module Models - class WebhookListResponseItem < ModerationAPI::Internal::Type::BaseModel - # @!attribute id - # The ID of the webhook. - # - # @return [String] - required :id, String - - # @!attribute created_at - # The date the webhook was created. - # - # @return [String] - required :created_at, String, api_name: :createdAt - - # @!attribute event_types - # Event types this webhook subscribes to. Empty for legacy v1 webhooks, which - # subscribe via their single deprecated `type` instead. - # - # @return [Array] - required :event_types, - -> { ModerationAPI::Internal::Type::ArrayOf[enum: ModerationAPI::Models::WebhookListResponseItem::EventType] }, - api_name: :eventTypes - - # @!attribute name - # The webhook's name. - # - # @return [String] - required :name, String - - # @!attribute payload_version - # Payload envelope version. V2 is the Stripe-style envelope; V1 is the legacy flat - # shape and is read-only via this API. - # - # @return [Symbol, ModerationAPI::Models::WebhookListResponseItem::PayloadVersion] - required :payload_version, - enum: -> { ModerationAPI::Models::WebhookListResponseItem::PayloadVersion }, - api_name: :payloadVersion - - # @!attribute url - # The URL we call when a subscribed event occurs. - # - # @return [String] - required :url, String - - # @!attribute description - # The webhook's description. - # - # @return [String, nil] - optional :description, String, nil?: true - - # @!method initialize(id:, created_at:, event_types:, name:, payload_version:, url:, description: nil) - # Some parameter documentations has been truncated, see - # {ModerationAPI::Models::WebhookListResponseItem} for more details. - # - # @param id [String] The ID of the webhook. - # - # @param created_at [String] The date the webhook was created. - # - # @param event_types [Array] Event types this webhook subscribes to. Empty for legacy v1 webhooks, which subs - # - # @param name [String] The webhook's name. - # - # @param payload_version [Symbol, ModerationAPI::Models::WebhookListResponseItem::PayloadVersion] Payload envelope version. V2 is the Stripe-style envelope; V1 is the legacy flat - # - # @param url [String] The URL we call when a subscribed event occurs. - # - # @param description [String, nil] The webhook's description. - - module EventType - extend ModerationAPI::Internal::Type::Enum - - QUEUE_ITEM_NEW = :QUEUE_ITEM_NEW - QUEUE_ITEM_COMPLETED = :QUEUE_ITEM_COMPLETED - QUEUE_ITEM_ACTION = :QUEUE_ITEM_ACTION - QUEUE_ITEM_REJECTED = :QUEUE_ITEM_REJECTED - QUEUE_ITEM_ALLOWED = :QUEUE_ITEM_ALLOWED - AUTHOR_BLOCKED = :AUTHOR_BLOCKED - AUTHOR_UNBLOCKED = :AUTHOR_UNBLOCKED - AUTHOR_SUSPENDED = :AUTHOR_SUSPENDED - AUTHOR_UPDATED = :AUTHOR_UPDATED - AUTHOR_TRUST_LEVEL_CHANGED = :AUTHOR_TRUST_LEVEL_CHANGED - AUTHOR_ACTION = :AUTHOR_ACTION - - # @!method self.values - # @return [Array] - end - - # Payload envelope version. V2 is the Stripe-style envelope; V1 is the legacy flat - # shape and is read-only via this API. - # - # @see ModerationAPI::Models::WebhookListResponseItem#payload_version - module PayloadVersion - extend ModerationAPI::Internal::Type::Enum - - V1 = :V1 - V2 = :V2 - - # @!method self.values - # @return [Array] - end - end - - # @type [ModerationAPI::Internal::Type::Converter] - WebhookListResponse = - ModerationAPI::Internal::Type::ArrayOf[-> { ModerationAPI::Models::WebhookListResponseItem }] - end -end diff --git a/lib/moderation_api/models/webhook_retrieve_params.rb b/lib/moderation_api/models/webhook_retrieve_params.rb deleted file mode 100644 index 36e4a49e..00000000 --- a/lib/moderation_api/models/webhook_retrieve_params.rb +++ /dev/null @@ -1,22 +0,0 @@ -# frozen_string_literal: true - -module ModerationAPI - module Models - # @see ModerationAPI::Resources::Webhooks#retrieve - class WebhookRetrieveParams < ModerationAPI::Internal::Type::BaseModel - extend ModerationAPI::Internal::Type::RequestParameters::Converter - include ModerationAPI::Internal::Type::RequestParameters - - # @!attribute id - # The ID of the webhook to get. - # - # @return [String] - required :id, String - - # @!method initialize(id:, request_options: {}) - # @param id [String] The ID of the webhook to get. - # - # @param request_options [ModerationAPI::RequestOptions, Hash{Symbol=>Object}] - end - end -end diff --git a/lib/moderation_api/models/webhook_retrieve_response.rb b/lib/moderation_api/models/webhook_retrieve_response.rb deleted file mode 100644 index 045b35a1..00000000 --- a/lib/moderation_api/models/webhook_retrieve_response.rb +++ /dev/null @@ -1,107 +0,0 @@ -# frozen_string_literal: true - -module ModerationAPI - module Models - # @see ModerationAPI::Resources::Webhooks#retrieve - class WebhookRetrieveResponse < ModerationAPI::Internal::Type::BaseModel - # @!attribute id - # The ID of the webhook. - # - # @return [String] - required :id, String - - # @!attribute created_at - # The date the webhook was created. - # - # @return [String] - required :created_at, String, api_name: :createdAt - - # @!attribute event_types - # Event types this webhook subscribes to. Empty for legacy v1 webhooks, which - # subscribe via their single deprecated `type` instead. - # - # @return [Array] - required :event_types, - -> { ModerationAPI::Internal::Type::ArrayOf[enum: ModerationAPI::Models::WebhookRetrieveResponse::EventType] }, - api_name: :eventTypes - - # @!attribute name - # The webhook's name. - # - # @return [String] - required :name, String - - # @!attribute payload_version - # Payload envelope version. V2 is the Stripe-style envelope; V1 is the legacy flat - # shape and is read-only via this API. - # - # @return [Symbol, ModerationAPI::Models::WebhookRetrieveResponse::PayloadVersion] - required :payload_version, - enum: -> { ModerationAPI::Models::WebhookRetrieveResponse::PayloadVersion }, - api_name: :payloadVersion - - # @!attribute url - # The URL we call when a subscribed event occurs. - # - # @return [String] - required :url, String - - # @!attribute description - # The webhook's description. - # - # @return [String, nil] - optional :description, String, nil?: true - - # @!method initialize(id:, created_at:, event_types:, name:, payload_version:, url:, description: nil) - # Some parameter documentations has been truncated, see - # {ModerationAPI::Models::WebhookRetrieveResponse} for more details. - # - # @param id [String] The ID of the webhook. - # - # @param created_at [String] The date the webhook was created. - # - # @param event_types [Array] Event types this webhook subscribes to. Empty for legacy v1 webhooks, which subs - # - # @param name [String] The webhook's name. - # - # @param payload_version [Symbol, ModerationAPI::Models::WebhookRetrieveResponse::PayloadVersion] Payload envelope version. V2 is the Stripe-style envelope; V1 is the legacy flat - # - # @param url [String] The URL we call when a subscribed event occurs. - # - # @param description [String, nil] The webhook's description. - - module EventType - extend ModerationAPI::Internal::Type::Enum - - QUEUE_ITEM_NEW = :QUEUE_ITEM_NEW - QUEUE_ITEM_COMPLETED = :QUEUE_ITEM_COMPLETED - QUEUE_ITEM_ACTION = :QUEUE_ITEM_ACTION - QUEUE_ITEM_REJECTED = :QUEUE_ITEM_REJECTED - QUEUE_ITEM_ALLOWED = :QUEUE_ITEM_ALLOWED - AUTHOR_BLOCKED = :AUTHOR_BLOCKED - AUTHOR_UNBLOCKED = :AUTHOR_UNBLOCKED - AUTHOR_SUSPENDED = :AUTHOR_SUSPENDED - AUTHOR_UPDATED = :AUTHOR_UPDATED - AUTHOR_TRUST_LEVEL_CHANGED = :AUTHOR_TRUST_LEVEL_CHANGED - AUTHOR_ACTION = :AUTHOR_ACTION - - # @!method self.values - # @return [Array] - end - - # Payload envelope version. V2 is the Stripe-style envelope; V1 is the legacy flat - # shape and is read-only via this API. - # - # @see ModerationAPI::Models::WebhookRetrieveResponse#payload_version - module PayloadVersion - extend ModerationAPI::Internal::Type::Enum - - V1 = :V1 - V2 = :V2 - - # @!method self.values - # @return [Array] - end - end - end -end diff --git a/lib/moderation_api/models/webhook_secret_retrieve_params.rb b/lib/moderation_api/models/webhook_secret_retrieve_params.rb deleted file mode 100644 index b51e9955..00000000 --- a/lib/moderation_api/models/webhook_secret_retrieve_params.rb +++ /dev/null @@ -1,14 +0,0 @@ -# frozen_string_literal: true - -module ModerationAPI - module Models - # @see ModerationAPI::Resources::WebhookSecret#retrieve - class WebhookSecretRetrieveParams < ModerationAPI::Internal::Type::BaseModel - extend ModerationAPI::Internal::Type::RequestParameters::Converter - include ModerationAPI::Internal::Type::RequestParameters - - # @!method initialize(request_options: {}) - # @param request_options [ModerationAPI::RequestOptions, Hash{Symbol=>Object}] - end - end -end diff --git a/lib/moderation_api/models/webhook_secret_retrieve_response.rb b/lib/moderation_api/models/webhook_secret_retrieve_response.rb deleted file mode 100644 index d27d6163..00000000 --- a/lib/moderation_api/models/webhook_secret_retrieve_response.rb +++ /dev/null @@ -1,22 +0,0 @@ -# frozen_string_literal: true - -module ModerationAPI - module Models - # @see ModerationAPI::Resources::WebhookSecret#retrieve - class WebhookSecretRetrieveResponse < ModerationAPI::Internal::Type::BaseModel - # @!attribute secret - # The signing secret for this project. Every webhook delivery is signed with - # HMAC-SHA256 over the raw JSON body, hex-encoded in the `modapi-signature` - # header. - # - # @return [String] - required :secret, String - - # @!method initialize(secret:) - # Some parameter documentations has been truncated, see - # {ModerationAPI::Models::WebhookSecretRetrieveResponse} for more details. - # - # @param secret [String] The signing secret for this project. Every webhook delivery is signed with HMAC- - end - end -end diff --git a/lib/moderation_api/models/webhook_update_params.rb b/lib/moderation_api/models/webhook_update_params.rb deleted file mode 100644 index f2bbf6b3..00000000 --- a/lib/moderation_api/models/webhook_update_params.rb +++ /dev/null @@ -1,81 +0,0 @@ -# frozen_string_literal: true - -module ModerationAPI - module Models - # @see ModerationAPI::Resources::Webhooks#update - class WebhookUpdateParams < ModerationAPI::Internal::Type::BaseModel - extend ModerationAPI::Internal::Type::RequestParameters::Converter - include ModerationAPI::Internal::Type::RequestParameters - - # @!attribute id - # The ID of the webhook to update. - # - # @return [String] - required :id, String - - # @!attribute description - # The webhook's description - # - # @return [String, nil] - optional :description, String, nil?: true - - # @!attribute event_types - # Event types this webhook subscribes to. One webhook URL receives all events you - # list here. - # - # @return [Array, nil] - optional :event_types, - -> { - ModerationAPI::Internal::Type::ArrayOf[enum: ModerationAPI::WebhookUpdateParams::EventType] - }, - api_name: :eventTypes - - # @!attribute name - # The webhook's name, used to identify it in the dashboard - # - # @return [String, nil] - optional :name, String - - # @!attribute url - # The webhook's URL. We'll call this URL when an event occurs. - # - # @return [String, nil] - optional :url, String - - # @!method initialize(id:, description: nil, event_types: nil, name: nil, url: nil, request_options: {}) - # Some parameter documentations has been truncated, see - # {ModerationAPI::Models::WebhookUpdateParams} for more details. - # - # @param id [String] The ID of the webhook to update. - # - # @param description [String, nil] The webhook's description - # - # @param event_types [Array] Event types this webhook subscribes to. One webhook URL receives all events you - # - # @param name [String] The webhook's name, used to identify it in the dashboard - # - # @param url [String] The webhook's URL. We'll call this URL when an event occurs. - # - # @param request_options [ModerationAPI::RequestOptions, Hash{Symbol=>Object}] - - module EventType - extend ModerationAPI::Internal::Type::Enum - - QUEUE_ITEM_NEW = :QUEUE_ITEM_NEW - QUEUE_ITEM_COMPLETED = :QUEUE_ITEM_COMPLETED - QUEUE_ITEM_ACTION = :QUEUE_ITEM_ACTION - QUEUE_ITEM_REJECTED = :QUEUE_ITEM_REJECTED - QUEUE_ITEM_ALLOWED = :QUEUE_ITEM_ALLOWED - AUTHOR_BLOCKED = :AUTHOR_BLOCKED - AUTHOR_UNBLOCKED = :AUTHOR_UNBLOCKED - AUTHOR_SUSPENDED = :AUTHOR_SUSPENDED - AUTHOR_UPDATED = :AUTHOR_UPDATED - AUTHOR_TRUST_LEVEL_CHANGED = :AUTHOR_TRUST_LEVEL_CHANGED - AUTHOR_ACTION = :AUTHOR_ACTION - - # @!method self.values - # @return [Array] - end - end - end -end diff --git a/lib/moderation_api/models/webhook_update_response.rb b/lib/moderation_api/models/webhook_update_response.rb deleted file mode 100644 index 650f4834..00000000 --- a/lib/moderation_api/models/webhook_update_response.rb +++ /dev/null @@ -1,107 +0,0 @@ -# frozen_string_literal: true - -module ModerationAPI - module Models - # @see ModerationAPI::Resources::Webhooks#update - class WebhookUpdateResponse < ModerationAPI::Internal::Type::BaseModel - # @!attribute id - # The ID of the webhook. - # - # @return [String] - required :id, String - - # @!attribute created_at - # The date the webhook was created. - # - # @return [String] - required :created_at, String, api_name: :createdAt - - # @!attribute event_types - # Event types this webhook subscribes to. Empty for legacy v1 webhooks, which - # subscribe via their single deprecated `type` instead. - # - # @return [Array] - required :event_types, - -> { ModerationAPI::Internal::Type::ArrayOf[enum: ModerationAPI::Models::WebhookUpdateResponse::EventType] }, - api_name: :eventTypes - - # @!attribute name - # The webhook's name. - # - # @return [String] - required :name, String - - # @!attribute payload_version - # Payload envelope version. V2 is the Stripe-style envelope; V1 is the legacy flat - # shape and is read-only via this API. - # - # @return [Symbol, ModerationAPI::Models::WebhookUpdateResponse::PayloadVersion] - required :payload_version, - enum: -> { ModerationAPI::Models::WebhookUpdateResponse::PayloadVersion }, - api_name: :payloadVersion - - # @!attribute url - # The URL we call when a subscribed event occurs. - # - # @return [String] - required :url, String - - # @!attribute description - # The webhook's description. - # - # @return [String, nil] - optional :description, String, nil?: true - - # @!method initialize(id:, created_at:, event_types:, name:, payload_version:, url:, description: nil) - # Some parameter documentations has been truncated, see - # {ModerationAPI::Models::WebhookUpdateResponse} for more details. - # - # @param id [String] The ID of the webhook. - # - # @param created_at [String] The date the webhook was created. - # - # @param event_types [Array] Event types this webhook subscribes to. Empty for legacy v1 webhooks, which subs - # - # @param name [String] The webhook's name. - # - # @param payload_version [Symbol, ModerationAPI::Models::WebhookUpdateResponse::PayloadVersion] Payload envelope version. V2 is the Stripe-style envelope; V1 is the legacy flat - # - # @param url [String] The URL we call when a subscribed event occurs. - # - # @param description [String, nil] The webhook's description. - - module EventType - extend ModerationAPI::Internal::Type::Enum - - QUEUE_ITEM_NEW = :QUEUE_ITEM_NEW - QUEUE_ITEM_COMPLETED = :QUEUE_ITEM_COMPLETED - QUEUE_ITEM_ACTION = :QUEUE_ITEM_ACTION - QUEUE_ITEM_REJECTED = :QUEUE_ITEM_REJECTED - QUEUE_ITEM_ALLOWED = :QUEUE_ITEM_ALLOWED - AUTHOR_BLOCKED = :AUTHOR_BLOCKED - AUTHOR_UNBLOCKED = :AUTHOR_UNBLOCKED - AUTHOR_SUSPENDED = :AUTHOR_SUSPENDED - AUTHOR_UPDATED = :AUTHOR_UPDATED - AUTHOR_TRUST_LEVEL_CHANGED = :AUTHOR_TRUST_LEVEL_CHANGED - AUTHOR_ACTION = :AUTHOR_ACTION - - # @!method self.values - # @return [Array] - end - - # Payload envelope version. V2 is the Stripe-style envelope; V1 is the legacy flat - # shape and is read-only via this API. - # - # @see ModerationAPI::Models::WebhookUpdateResponse#payload_version - module PayloadVersion - extend ModerationAPI::Internal::Type::Enum - - V1 = :V1 - V2 = :V2 - - # @!method self.values - # @return [Array] - end - end - end -end diff --git a/lib/moderation_api/models/wordlist/word_add_params.rb b/lib/moderation_api/models/wordlist/word_add_params.rb deleted file mode 100644 index b6215903..00000000 --- a/lib/moderation_api/models/wordlist/word_add_params.rb +++ /dev/null @@ -1,32 +0,0 @@ -# frozen_string_literal: true - -module ModerationAPI - module Models - module Wordlist - # @see ModerationAPI::Resources::Wordlist::Words#add - class WordAddParams < ModerationAPI::Internal::Type::BaseModel - extend ModerationAPI::Internal::Type::RequestParameters::Converter - include ModerationAPI::Internal::Type::RequestParameters - - # @!attribute id - # ID of the wordlist to add words to - # - # @return [String] - required :id, String - - # @!attribute words - # Array of words to add to the wordlist. Duplicate words will be ignored. - # - # @return [Array] - required :words, ModerationAPI::Internal::Type::ArrayOf[String] - - # @!method initialize(id:, words:, request_options: {}) - # @param id [String] ID of the wordlist to add words to - # - # @param words [Array] Array of words to add to the wordlist. Duplicate words will be ignored. - # - # @param request_options [ModerationAPI::RequestOptions, Hash{Symbol=>Object}] - end - end - end -end diff --git a/lib/moderation_api/models/wordlist/word_add_response.rb b/lib/moderation_api/models/wordlist/word_add_response.rb deleted file mode 100644 index fb77dc60..00000000 --- a/lib/moderation_api/models/wordlist/word_add_response.rb +++ /dev/null @@ -1,35 +0,0 @@ -# frozen_string_literal: true - -module ModerationAPI - module Models - module Wordlist - # @see ModerationAPI::Resources::Wordlist::Words#add - class WordAddResponse < ModerationAPI::Internal::Type::BaseModel - # @!attribute added_count - # Number of words added - # - # @return [Float] - required :added_count, Float, api_name: :addedCount - - # @!attribute added_words - # List of words that were added - # - # @return [Array] - required :added_words, ModerationAPI::Internal::Type::ArrayOf[String], api_name: :addedWords - - # @!attribute total_count - # Total number of words in wordlist - # - # @return [Float] - required :total_count, Float, api_name: :totalCount - - # @!method initialize(added_count:, added_words:, total_count:) - # @param added_count [Float] Number of words added - # - # @param added_words [Array] List of words that were added - # - # @param total_count [Float] Total number of words in wordlist - end - end - end -end diff --git a/lib/moderation_api/models/wordlist/word_remove_params.rb b/lib/moderation_api/models/wordlist/word_remove_params.rb deleted file mode 100644 index 2b01f9bc..00000000 --- a/lib/moderation_api/models/wordlist/word_remove_params.rb +++ /dev/null @@ -1,32 +0,0 @@ -# frozen_string_literal: true - -module ModerationAPI - module Models - module Wordlist - # @see ModerationAPI::Resources::Wordlist::Words#remove - class WordRemoveParams < ModerationAPI::Internal::Type::BaseModel - extend ModerationAPI::Internal::Type::RequestParameters::Converter - include ModerationAPI::Internal::Type::RequestParameters - - # @!attribute id - # ID of the wordlist to remove words from - # - # @return [String] - required :id, String - - # @!attribute words - # Array of words to remove from the wordlist - # - # @return [Array] - required :words, ModerationAPI::Internal::Type::ArrayOf[String] - - # @!method initialize(id:, words:, request_options: {}) - # @param id [String] ID of the wordlist to remove words from - # - # @param words [Array] Array of words to remove from the wordlist - # - # @param request_options [ModerationAPI::RequestOptions, Hash{Symbol=>Object}] - end - end - end -end diff --git a/lib/moderation_api/models/wordlist/word_remove_response.rb b/lib/moderation_api/models/wordlist/word_remove_response.rb deleted file mode 100644 index 6c841f36..00000000 --- a/lib/moderation_api/models/wordlist/word_remove_response.rb +++ /dev/null @@ -1,35 +0,0 @@ -# frozen_string_literal: true - -module ModerationAPI - module Models - module Wordlist - # @see ModerationAPI::Resources::Wordlist::Words#remove - class WordRemoveResponse < ModerationAPI::Internal::Type::BaseModel - # @!attribute removed_count - # Number of words removed - # - # @return [Float] - required :removed_count, Float, api_name: :removedCount - - # @!attribute removed_words - # List of words removed - # - # @return [Array] - required :removed_words, ModerationAPI::Internal::Type::ArrayOf[String], api_name: :removedWords - - # @!attribute total_count - # Total number of words in wordlist - # - # @return [Float] - required :total_count, Float, api_name: :totalCount - - # @!method initialize(removed_count:, removed_words:, total_count:) - # @param removed_count [Float] Number of words removed - # - # @param removed_words [Array] List of words removed - # - # @param total_count [Float] Total number of words in wordlist - end - end - end -end diff --git a/lib/moderation_api/models/wordlist_get_embedding_status_params.rb b/lib/moderation_api/models/wordlist_get_embedding_status_params.rb deleted file mode 100644 index aeef3db2..00000000 --- a/lib/moderation_api/models/wordlist_get_embedding_status_params.rb +++ /dev/null @@ -1,22 +0,0 @@ -# frozen_string_literal: true - -module ModerationAPI - module Models - # @see ModerationAPI::Resources::Wordlist#get_embedding_status - class WordlistGetEmbeddingStatusParams < ModerationAPI::Internal::Type::BaseModel - extend ModerationAPI::Internal::Type::RequestParameters::Converter - include ModerationAPI::Internal::Type::RequestParameters - - # @!attribute id - # ID of the wordlist to check embedding status for - # - # @return [String] - required :id, String - - # @!method initialize(id:, request_options: {}) - # @param id [String] ID of the wordlist to check embedding status for - # - # @param request_options [ModerationAPI::RequestOptions, Hash{Symbol=>Object}] - end - end -end diff --git a/lib/moderation_api/models/wordlist_get_embedding_status_response.rb b/lib/moderation_api/models/wordlist_get_embedding_status_response.rb deleted file mode 100644 index 78fe6ab9..00000000 --- a/lib/moderation_api/models/wordlist_get_embedding_status_response.rb +++ /dev/null @@ -1,35 +0,0 @@ -# frozen_string_literal: true - -module ModerationAPI - module Models - # @see ModerationAPI::Resources::Wordlist#get_embedding_status - class WordlistGetEmbeddingStatusResponse < ModerationAPI::Internal::Type::BaseModel - # @!attribute progress - # Percentage of words that have been embedded (0-100) - # - # @return [Float] - required :progress, Float - - # @!attribute remaining_words - # Number of words still waiting to be embedded - # - # @return [Float] - required :remaining_words, Float, api_name: :remainingWords - - # @!attribute total_words - # Total number of words in the wordlist - # - # @return [Float] - required :total_words, Float, api_name: :totalWords - - # @!method initialize(progress:, remaining_words:, total_words:) - # Embedding status details - # - # @param progress [Float] Percentage of words that have been embedded (0-100) - # - # @param remaining_words [Float] Number of words still waiting to be embedded - # - # @param total_words [Float] Total number of words in the wordlist - end - end -end diff --git a/lib/moderation_api/models/wordlist_list_params.rb b/lib/moderation_api/models/wordlist_list_params.rb deleted file mode 100644 index b20bc23a..00000000 --- a/lib/moderation_api/models/wordlist_list_params.rb +++ /dev/null @@ -1,14 +0,0 @@ -# frozen_string_literal: true - -module ModerationAPI - module Models - # @see ModerationAPI::Resources::Wordlist#list - class WordlistListParams < ModerationAPI::Internal::Type::BaseModel - extend ModerationAPI::Internal::Type::RequestParameters::Converter - include ModerationAPI::Internal::Type::RequestParameters - - # @!method initialize(request_options: {}) - # @param request_options [ModerationAPI::RequestOptions, Hash{Symbol=>Object}] - end - end -end diff --git a/lib/moderation_api/models/wordlist_list_response.rb b/lib/moderation_api/models/wordlist_list_response.rb deleted file mode 100644 index 5dcc0ca9..00000000 --- a/lib/moderation_api/models/wordlist_list_response.rb +++ /dev/null @@ -1,52 +0,0 @@ -# frozen_string_literal: true - -module ModerationAPI - module Models - class WordlistListResponseItem < ModerationAPI::Internal::Type::BaseModel - # @!attribute id - # Unique identifier of the wordlist - # - # @return [String] - required :id, String - - # @!attribute created_at - # When the wordlist was created - # - # @return [String, nil] - required :created_at, String, api_name: :createdAt, nil?: true - - # @!attribute description - # Description of the wordlist - # - # @return [String, nil] - required :description, String, nil?: true - - # @!attribute name - # Name of the wordlist - # - # @return [String, nil] - required :name, String, nil?: true - - # @!attribute user_id - # User who created the wordlist - # - # @return [String, nil] - required :user_id, String, api_name: :userId, nil?: true - - # @!method initialize(id:, created_at:, description:, name:, user_id:) - # @param id [String] Unique identifier of the wordlist - # - # @param created_at [String, nil] When the wordlist was created - # - # @param description [String, nil] Description of the wordlist - # - # @param name [String, nil] Name of the wordlist - # - # @param user_id [String, nil] User who created the wordlist - end - - # @type [ModerationAPI::Internal::Type::Converter] - WordlistListResponse = - ModerationAPI::Internal::Type::ArrayOf[-> { ModerationAPI::Models::WordlistListResponseItem }] - end -end diff --git a/lib/moderation_api/models/wordlist_retrieve_params.rb b/lib/moderation_api/models/wordlist_retrieve_params.rb deleted file mode 100644 index 7add1886..00000000 --- a/lib/moderation_api/models/wordlist_retrieve_params.rb +++ /dev/null @@ -1,22 +0,0 @@ -# frozen_string_literal: true - -module ModerationAPI - module Models - # @see ModerationAPI::Resources::Wordlist#retrieve - class WordlistRetrieveParams < ModerationAPI::Internal::Type::BaseModel - extend ModerationAPI::Internal::Type::RequestParameters::Converter - include ModerationAPI::Internal::Type::RequestParameters - - # @!attribute id - # ID of the wordlist to get - # - # @return [String] - required :id, String - - # @!method initialize(id:, request_options: {}) - # @param id [String] ID of the wordlist to get - # - # @param request_options [ModerationAPI::RequestOptions, Hash{Symbol=>Object}] - end - end -end diff --git a/lib/moderation_api/models/wordlist_retrieve_response.rb b/lib/moderation_api/models/wordlist_retrieve_response.rb deleted file mode 100644 index 9dc4a116..00000000 --- a/lib/moderation_api/models/wordlist_retrieve_response.rb +++ /dev/null @@ -1,65 +0,0 @@ -# frozen_string_literal: true - -module ModerationAPI - module Models - # @see ModerationAPI::Resources::Wordlist#retrieve - class WordlistRetrieveResponse < ModerationAPI::Internal::Type::BaseModel - # @!attribute id - # ID of the wordlist - # - # @return [String] - required :id, String - - # @!attribute created_at - # Creation date of the wordlist - # - # @return [String] - required :created_at, String, api_name: :createdAt - - # @!attribute name - # Name of the wordlist - # - # @return [String, nil] - required :name, String, nil?: true - - # @!attribute organization_id - # ID of the organization - # - # @return [String] - required :organization_id, String, api_name: :organizationId - - # @!attribute strict - # Strict mode - # - # @return [Boolean] - required :strict, ModerationAPI::Internal::Type::Boolean - - # @!attribute user_id - # ID of the user - # - # @return [String, nil] - required :user_id, String, api_name: :userId, nil?: true - - # @!attribute words - # Words in the wordlist - # - # @return [Array] - required :words, ModerationAPI::Internal::Type::ArrayOf[String] - - # @!method initialize(id:, created_at:, name:, organization_id:, strict:, user_id:, words:) - # @param id [String] ID of the wordlist - # - # @param created_at [String] Creation date of the wordlist - # - # @param name [String, nil] Name of the wordlist - # - # @param organization_id [String] ID of the organization - # - # @param strict [Boolean] Strict mode - # - # @param user_id [String, nil] ID of the user - # - # @param words [Array] Words in the wordlist - end - end -end diff --git a/lib/moderation_api/models/wordlist_update_params.rb b/lib/moderation_api/models/wordlist_update_params.rb deleted file mode 100644 index 3ebc1534..00000000 --- a/lib/moderation_api/models/wordlist_update_params.rb +++ /dev/null @@ -1,66 +0,0 @@ -# frozen_string_literal: true - -module ModerationAPI - module Models - # @see ModerationAPI::Resources::Wordlist#update - class WordlistUpdateParams < ModerationAPI::Internal::Type::BaseModel - extend ModerationAPI::Internal::Type::RequestParameters::Converter - include ModerationAPI::Internal::Type::RequestParameters - - # @!attribute id - # ID of the wordlist to update - # - # @return [String] - required :id, String - - # @!attribute description - # New description for the wordlist - # - # @return [String, nil] - optional :description, String - - # @!attribute key - # New key for the wordlist - # - # @return [String, nil] - optional :key, String - - # @!attribute name - # New name for the wordlist - # - # @return [String, nil] - optional :name, String - - # @!attribute strict - # Deprecated. Now using threshold in project settings. - # - # @return [Boolean, nil] - optional :strict, ModerationAPI::Internal::Type::Boolean - - # @!attribute words - # New words for the wordlist. Replace the existing words with these new ones. - # Duplicate words will be ignored. - # - # @return [Array, nil] - optional :words, ModerationAPI::Internal::Type::ArrayOf[String] - - # @!method initialize(id:, description: nil, key: nil, name: nil, strict: nil, words: nil, request_options: {}) - # Some parameter documentations has been truncated, see - # {ModerationAPI::Models::WordlistUpdateParams} for more details. - # - # @param id [String] ID of the wordlist to update - # - # @param description [String] New description for the wordlist - # - # @param key [String] New key for the wordlist - # - # @param name [String] New name for the wordlist - # - # @param strict [Boolean] Deprecated. Now using threshold in project settings. - # - # @param words [Array] New words for the wordlist. Replace the existing words with these new ones. Dupl - # - # @param request_options [ModerationAPI::RequestOptions, Hash{Symbol=>Object}] - end - end -end diff --git a/lib/moderation_api/models/wordlist_update_response.rb b/lib/moderation_api/models/wordlist_update_response.rb deleted file mode 100644 index 311d8b9b..00000000 --- a/lib/moderation_api/models/wordlist_update_response.rb +++ /dev/null @@ -1,65 +0,0 @@ -# frozen_string_literal: true - -module ModerationAPI - module Models - # @see ModerationAPI::Resources::Wordlist#update - class WordlistUpdateResponse < ModerationAPI::Internal::Type::BaseModel - # @!attribute id - # ID of the wordlist - # - # @return [String] - required :id, String - - # @!attribute created_at - # Creation date of the wordlist - # - # @return [String] - required :created_at, String, api_name: :createdAt - - # @!attribute name - # Name of the wordlist - # - # @return [String, nil] - required :name, String, nil?: true - - # @!attribute organization_id - # ID of the organization - # - # @return [String] - required :organization_id, String, api_name: :organizationId - - # @!attribute strict - # Strict mode - # - # @return [Boolean] - required :strict, ModerationAPI::Internal::Type::Boolean - - # @!attribute user_id - # ID of the user - # - # @return [String, nil] - required :user_id, String, api_name: :userId, nil?: true - - # @!attribute words - # Words in the wordlist - # - # @return [Array] - required :words, ModerationAPI::Internal::Type::ArrayOf[String] - - # @!method initialize(id:, created_at:, name:, organization_id:, strict:, user_id:, words:) - # @param id [String] ID of the wordlist - # - # @param created_at [String] Creation date of the wordlist - # - # @param name [String, nil] Name of the wordlist - # - # @param organization_id [String] ID of the organization - # - # @param strict [Boolean] Strict mode - # - # @param user_id [String, nil] ID of the user - # - # @param words [Array] Words in the wordlist - end - end -end diff --git a/lib/moderation_api/moderationapi.rb b/lib/moderation_api/moderationapi.rb new file mode 100644 index 00000000..d53568cd --- /dev/null +++ b/lib/moderation_api/moderationapi.rb @@ -0,0 +1,131 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +require "faraday" +require "faraday/multipart" +require "faraday/retry" +require "sorbet-runtime" + +require_relative "sdk_hooks/hooks" +require_relative "utils/retries" + +module ModerationApi + extend T::Sig + + class ModerationApi + extend T::Sig + + attr_accessor( + :authors, + :queue, + :actions, + :webhooks, + :webhook_secret, + :account, + :wordlist, + :content, + :projects, + :channels + ) + + # Instantiates the SDK, configuring it with the provided parameters. + # + # @param client [Faraday::Connection, nil] The faraday HTTP client to use for all operations + # @param retry_config [::ModerationApi::Utils::RetryConfig, nil] The retry configuration to use for all operations + # @param timeout_ms [Integer, nil] Request timeout in milliseconds for all operations + # @param security [Models::Components::Security, nil] The security details required for authentication + # @param security_source [Proc{|| Models::Components::Security, nil}] A function that returns security details required for authentication + # @param server_idx [Integer, nil] The index of the server to use for all operations + # @param server_url [String, nil] The server URL to use for all operations + # @param url_params [Hash{Symbol => String}, nil] Parameters to optionally template the server URL with + sig do + params( + client: T.nilable(Faraday::Connection), + retry_config: T.nilable(::ModerationApi::Utils::RetryConfig), + timeout_ms: T.nilable(Integer), + secret_key: T.nilable(::String), + security_source: T.nilable(T.proc.returns(Models::Components::Security)), + server_idx: T.nilable(Integer), + server_url: T.nilable(String), + url_params: T.nilable(T::Hash[Symbol, String]) + ) + .void + end + def initialize( + client: nil, + retry_config: nil, + timeout_ms: nil, + secret_key: nil, + security_source: nil, + server_idx: nil, + server_url: nil, + url_params: nil + ) + + connection_options = { + request: { + params_encoder: Faraday::FlatParamsEncoder + } + } + connection_options[:request][:timeout] = (timeout_ms.to_f / 1000) unless timeout_ms.nil? + + client ||= Faraday.new(**connection_options) do |f| + f.request(:multipart, {flat_encode: true}) + # f.response :logger, nil, { headers: true, bodies: true, errors: true } + end + + if !server_url.nil? + if !url_params.nil? + server_url = Utils.template_url(server_url, url_params) + end + end + + server_idx = 0 if server_idx.nil? + hooks = SDKHooks::Hooks.new + @sdk_configuration = SDKConfiguration.new( + client, + hooks, + retry_config, + timeout_ms, + secret_key, + security_source, + server_url, + server_idx + ) + @sdk_configuration = hooks.sdk_init(config: @sdk_configuration) + init_sdks + end + + sig { void } + def init_sdks + @authors = Authors.new(@sdk_configuration) + @queue = Queue.new(@sdk_configuration) + @actions = Actions.new(@sdk_configuration) + @webhooks = Webhooks.new(@sdk_configuration) + @webhook_secret = WebhookSecret.new(@sdk_configuration) + @account = Account.new(@sdk_configuration) + @wordlist = Wordlist.new(@sdk_configuration) + @content = Content.new(@sdk_configuration) + @projects = Projects.new(@sdk_configuration) + @channels = Channels.new(@sdk_configuration) + end + + sig { params(base_url: String, url_variables: T.nilable(T::Hash[Symbol, T.any(String, T::Enum)])).returns(String) } + def get_url(base_url:, url_variables: nil) + sd_base_url, sd_options = @sdk_configuration.get_server_details + + if base_url.nil? + base_url = sd_base_url + end + + if url_variables.nil? + url_variables = sd_options + end + + return Utils.template_url(base_url, url_variables) + end + + end +end diff --git a/lib/moderation_api/projects.rb b/lib/moderation_api/projects.rb new file mode 100644 index 00000000..0eb726b6 --- /dev/null +++ b/lib/moderation_api/projects.rb @@ -0,0 +1,1547 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +require "faraday" +require "faraday/multipart" +require "faraday/retry" +require "sorbet-runtime" +require "janeway" + +require_relative "sdk_hooks/hooks" +require_relative "utils/retries" + +module ModerationApi + extend T::Sig + + class Projects + extend T::Sig + + sig { params(sdk_config: SDKConfiguration).void } + def initialize(sdk_config) + @sdk_configuration = sdk_config + end + + sig { params(base_url: String, url_variables: T.nilable(T::Hash[Symbol, T.any(String, T::Enum)])).returns(String) } + def get_url(base_url:, url_variables: nil) + sd_base_url, sd_options = @sdk_configuration.get_server_details + + if base_url.nil? + base_url = sd_base_url + end + + if url_variables.nil? + url_variables = sd_options + end + + return Utils.template_url(base_url, url_variables) + end + + sig { + params( + page: T.nilable(::Integer), + page_size: T.nilable(::Integer), + timeout_ms: T.nilable(Integer), + http_headers: T.nilable(T::Hash[T.any(String, Symbol), String]) + ) + .returns(Models::Operations::ListProjectsResponse) + } + def list(page: nil, page_size: nil, timeout_ms: nil, http_headers: nil) + # list - List projects + # List the projects in the organization. The list is paginated. Needs the `projects:read` permission. + request = Models::Operations::ListProjectsRequest.new( + page: page, + page_size: page_size + ) + url, params = @sdk_configuration.get_server_details + base_url = Utils.template_url(url, params) + url = "#{base_url}/projects" + headers = {} + headers = T.cast(headers, T::Hash[String, String]) + query_params = Utils.get_query_params(Models::Operations::ListProjectsRequest, request, nil) + headers["Accept"] = "application/json" + headers["user-agent"] = @sdk_configuration.user_agent + + security = @sdk_configuration.security_source&.call + + timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil? + timeout ||= @sdk_configuration.timeout + + connection = @sdk_configuration.client + + hook_ctx = SDKHooks::HookContext.new( + config: @sdk_configuration, + base_url: base_url, + oauth2_scopes: nil, + operation_id: "listProjects", + security_source: @sdk_configuration.security_source + ) + + error = T.let(nil, T.nilable(StandardError)) + http_response = T.let(nil, T.nilable(Faraday::Response)) + + begin + http_response = T.must(connection).get(url) do |req| + req.headers.merge!(headers) + req.options.timeout = timeout unless timeout.nil? + req.params = query_params + Utils.configure_request_security(req, security) + http_headers&.each do |key, value| + req.headers[key.to_s] = value + end + + @sdk_configuration.hooks.before_request( + hook_ctx: SDKHooks::BeforeRequestHookContext.new( + hook_ctx: hook_ctx + ), + request: req + ) + end + + rescue StandardError => e + error = e + ensure + if http_response.nil? || Utils.error_status?(http_response.status) + http_response = @sdk_configuration.hooks.after_error( + error: error, + hook_ctx: SDKHooks::AfterErrorHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + else + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + end + + if http_response.nil? + raise error if !error.nil? + raise "no response" + end + end + + content_type = http_response.headers.fetch("Content-Type", "application/octet-stream") + if Utils.match_status_code(http_response.status, ["200"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Operations::ListProjectsResponseBody) + response = Models::Operations::ListProjectsResponse.new( + status_code: http_response.status, + content_type: content_type, + raw_response: http_response, + object: T.unsafe(obj) + ) + sdk = self + + response.next_page = proc do + request_page = T.must(!request.page.nil? ? request.page : 1) + next_page = request_page + 1 + num_pages = Janeway.enum_for("$.pagination.totalPages", JSON.parse(response_data)).search + if num_pages.nil? || num_pages[0] <= request_page + next nil + end + + if !response_data + next nil + end + + results = Janeway.enum_for("$.data", JSON.parse(response_data)).search + if results.is_a?(Array) + results = results[0] + end + + if results.count.zero? + next nil + end + + request_limit = !request.page_size.nil? ? request.page_size : 20 + if results.count < request_limit + next nil + end + + sdk.list( + page: next_page, + page_size: request.page_size, + http_headers: http_headers + ) + end + + return response + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["401"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::AuthenticationError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["403"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::PermissionDeniedError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["429"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::RateLimitError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["4XX"]) + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "API error occurred" + ) + elsif Utils.match_status_code(http_response.status, ["5XX"]) + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "API error occurred" + ) + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown status code received" + ) + + end + end + + sig { + params( + request: Models::Operations::CreateProjectRequest, + timeout_ms: T.nilable(Integer), + http_headers: T.nilable(T::Hash[T.any(String, Symbol), String]) + ) + .returns(Models::Operations::CreateProjectResponse) + } + def create(request:, timeout_ms: nil, http_headers: nil) + # create - Create a project + # Create a project with one channel, a review queue inbox and a secret API key. Give a domain or context and the project suggests policies for the platform. Needs the `projects:write` permission and a key that reaches all projects. + url, params = @sdk_configuration.get_server_details + base_url = Utils.template_url(url, params) + url = "#{base_url}/projects" + headers = {} + headers = T.cast(headers, T::Hash[String, String]) + req_content_type, data, form = Utils.serialize_request_body(request, false, false, :request, :json) + headers["content-type"] = req_content_type + raise StandardError, "request body is required" if data.nil? && form.nil? + + if form && !form.empty? + body = Utils.encode_form(form) + elsif Utils.match_content_type(req_content_type, "application/x-www-form-urlencoded") + body = URI.encode_www_form(T.cast(data, T::Hash[Symbol, Object])) + else + body = data + end + + headers["Accept"] = "application/json" + headers["user-agent"] = @sdk_configuration.user_agent + + security = @sdk_configuration.security_source&.call + + timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil? + timeout ||= @sdk_configuration.timeout + + connection = @sdk_configuration.client + + hook_ctx = SDKHooks::HookContext.new( + config: @sdk_configuration, + base_url: base_url, + oauth2_scopes: nil, + operation_id: "createProject", + security_source: @sdk_configuration.security_source + ) + + error = T.let(nil, T.nilable(StandardError)) + http_response = T.let(nil, T.nilable(Faraday::Response)) + + begin + http_response = T.must(connection).post(url) do |req| + req.body = body + req.headers.merge!(headers) + req.options.timeout = timeout unless timeout.nil? + Utils.configure_request_security(req, security) + http_headers&.each do |key, value| + req.headers[key.to_s] = value + end + + @sdk_configuration.hooks.before_request( + hook_ctx: SDKHooks::BeforeRequestHookContext.new( + hook_ctx: hook_ctx + ), + request: req + ) + end + + rescue StandardError => e + error = e + ensure + if http_response.nil? || Utils.error_status?(http_response.status) + http_response = @sdk_configuration.hooks.after_error( + error: error, + hook_ctx: SDKHooks::AfterErrorHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + else + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + end + + if http_response.nil? + raise error if !error.nil? + raise "no response" + end + end + + content_type = http_response.headers.fetch("Content-Type", "application/octet-stream") + if Utils.match_status_code(http_response.status, ["200"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Components::ProjectWithKey) + response = Models::Operations::CreateProjectResponse.new( + status_code: http_response.status, + content_type: content_type, + raw_response: http_response, + project_with_key: T.unsafe(obj) + ) + + return response + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["400"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::BadRequestError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["401"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::AuthenticationError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["403"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::PermissionDeniedError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["429"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::RateLimitError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["4XX"]) + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "API error occurred" + ) + elsif Utils.match_status_code(http_response.status, ["5XX"]) + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "API error occurred" + ) + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown status code received" + ) + + end + end + + sig { + params( + id: ::String, + timeout_ms: T.nilable(Integer), + http_headers: T.nilable(T::Hash[T.any(String, Symbol), String]) + ) + .returns(Models::Operations::GetProjectResponse) + } + def retrieve(id:, timeout_ms: nil, http_headers: nil) + # retrieve - Get a project + # Get a project by ID. Needs the `projects:read` permission. + request = Models::Operations::GetProjectRequest.new( + id: id + ) + url, params = @sdk_configuration.get_server_details + base_url = Utils.template_url(url, params) + url = Utils.generate_url( + Models::Operations::GetProjectRequest, + base_url, + "/projects/{id}", + request + ) + headers = {} + headers = T.cast(headers, T::Hash[String, String]) + headers["Accept"] = "application/json" + headers["user-agent"] = @sdk_configuration.user_agent + + security = @sdk_configuration.security_source&.call + + timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil? + timeout ||= @sdk_configuration.timeout + + connection = @sdk_configuration.client + + hook_ctx = SDKHooks::HookContext.new( + config: @sdk_configuration, + base_url: base_url, + oauth2_scopes: nil, + operation_id: "getProject", + security_source: @sdk_configuration.security_source + ) + + error = T.let(nil, T.nilable(StandardError)) + http_response = T.let(nil, T.nilable(Faraday::Response)) + + begin + http_response = T.must(connection).get(url) do |req| + req.headers.merge!(headers) + req.options.timeout = timeout unless timeout.nil? + Utils.configure_request_security(req, security) + http_headers&.each do |key, value| + req.headers[key.to_s] = value + end + + @sdk_configuration.hooks.before_request( + hook_ctx: SDKHooks::BeforeRequestHookContext.new( + hook_ctx: hook_ctx + ), + request: req + ) + end + + rescue StandardError => e + error = e + ensure + if http_response.nil? || Utils.error_status?(http_response.status) + http_response = @sdk_configuration.hooks.after_error( + error: error, + hook_ctx: SDKHooks::AfterErrorHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + else + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + end + + if http_response.nil? + raise error if !error.nil? + raise "no response" + end + end + + content_type = http_response.headers.fetch("Content-Type", "application/octet-stream") + if Utils.match_status_code(http_response.status, ["200"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Components::Project) + response = Models::Operations::GetProjectResponse.new( + status_code: http_response.status, + content_type: content_type, + raw_response: http_response, + project: T.unsafe(obj) + ) + + return response + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["401"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::AuthenticationError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["403"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::PermissionDeniedError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["404"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::NotFoundError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["429"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::RateLimitError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["4XX"]) + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "API error occurred" + ) + elsif Utils.match_status_code(http_response.status, ["5XX"]) + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "API error occurred" + ) + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown status code received" + ) + + end + end + + sig { + params( + body: Models::Operations::UpdateProjectRequestBody, + id: ::String, + timeout_ms: T.nilable(Integer), + http_headers: T.nilable(T::Hash[T.any(String, Symbol), String]) + ) + .returns(Models::Operations::UpdateProjectResponse) + } + def update(body:, id:, timeout_ms: nil, http_headers: nil) + # update - Update a project + # Update a project. Fields you leave out keep their value. Needs the `projects:write` permission. + request = Models::Operations::UpdateProjectRequest.new( + id: id, + body: body + ) + url, params = @sdk_configuration.get_server_details + base_url = Utils.template_url(url, params) + url = Utils.generate_url( + Models::Operations::UpdateProjectRequest, + base_url, + "/projects/{id}", + request + ) + headers = {} + headers = T.cast(headers, T::Hash[String, String]) + req_content_type, data, form = Utils.serialize_request_body(request, false, false, :body, :json) + headers["content-type"] = req_content_type + raise StandardError, "request body is required" if data.nil? && form.nil? + + if form && !form.empty? + body = Utils.encode_form(form) + elsif Utils.match_content_type(req_content_type, "application/x-www-form-urlencoded") + body = URI.encode_www_form(T.cast(data, T::Hash[Symbol, Object])) + else + body = data + end + + headers["Accept"] = "application/json" + headers["user-agent"] = @sdk_configuration.user_agent + + security = @sdk_configuration.security_source&.call + + timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil? + timeout ||= @sdk_configuration.timeout + + connection = @sdk_configuration.client + + hook_ctx = SDKHooks::HookContext.new( + config: @sdk_configuration, + base_url: base_url, + oauth2_scopes: nil, + operation_id: "updateProject", + security_source: @sdk_configuration.security_source + ) + + error = T.let(nil, T.nilable(StandardError)) + http_response = T.let(nil, T.nilable(Faraday::Response)) + + begin + http_response = T.must(connection).put(url) do |req| + req.body = body + req.headers.merge!(headers) + req.options.timeout = timeout unless timeout.nil? + Utils.configure_request_security(req, security) + http_headers&.each do |key, value| + req.headers[key.to_s] = value + end + + @sdk_configuration.hooks.before_request( + hook_ctx: SDKHooks::BeforeRequestHookContext.new( + hook_ctx: hook_ctx + ), + request: req + ) + end + + rescue StandardError => e + error = e + ensure + if http_response.nil? || Utils.error_status?(http_response.status) + http_response = @sdk_configuration.hooks.after_error( + error: error, + hook_ctx: SDKHooks::AfterErrorHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + else + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + end + + if http_response.nil? + raise error if !error.nil? + raise "no response" + end + end + + content_type = http_response.headers.fetch("Content-Type", "application/octet-stream") + if Utils.match_status_code(http_response.status, ["200"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Components::Project) + response = Models::Operations::UpdateProjectResponse.new( + status_code: http_response.status, + content_type: content_type, + raw_response: http_response, + project: T.unsafe(obj) + ) + + return response + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["400"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::BadRequestError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["401"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::AuthenticationError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["403"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::PermissionDeniedError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["404"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::NotFoundError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["429"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::RateLimitError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["4XX"]) + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "API error occurred" + ) + elsif Utils.match_status_code(http_response.status, ["5XX"]) + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "API error occurred" + ) + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown status code received" + ) + + end + end + + sig { + params( + id: ::String, + timeout_ms: T.nilable(Integer), + http_headers: T.nilable(T::Hash[T.any(String, Symbol), String]) + ) + .returns(Models::Operations::DeleteProjectResponse) + } + def delete(id:, timeout_ms: nil, http_headers: nil) + # delete - Delete a project + # Delete a project with everything in it: channels, queues, API keys and stored content. This can't be undone. The project's API keys stop working at once. Needs the `projects:write` permission. + request = Models::Operations::DeleteProjectRequest.new( + id: id + ) + url, params = @sdk_configuration.get_server_details + base_url = Utils.template_url(url, params) + url = Utils.generate_url( + Models::Operations::DeleteProjectRequest, + base_url, + "/projects/{id}", + request + ) + headers = {} + headers = T.cast(headers, T::Hash[String, String]) + headers["Accept"] = "application/json" + headers["user-agent"] = @sdk_configuration.user_agent + + security = @sdk_configuration.security_source&.call + + timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil? + timeout ||= @sdk_configuration.timeout + + connection = @sdk_configuration.client + + hook_ctx = SDKHooks::HookContext.new( + config: @sdk_configuration, + base_url: base_url, + oauth2_scopes: nil, + operation_id: "deleteProject", + security_source: @sdk_configuration.security_source + ) + + error = T.let(nil, T.nilable(StandardError)) + http_response = T.let(nil, T.nilable(Faraday::Response)) + + begin + http_response = T.must(connection).delete(url) do |req| + req.headers.merge!(headers) + req.options.timeout = timeout unless timeout.nil? + Utils.configure_request_security(req, security) + http_headers&.each do |key, value| + req.headers[key.to_s] = value + end + + @sdk_configuration.hooks.before_request( + hook_ctx: SDKHooks::BeforeRequestHookContext.new( + hook_ctx: hook_ctx + ), + request: req + ) + end + + rescue StandardError => e + error = e + ensure + if http_response.nil? || Utils.error_status?(http_response.status) + http_response = @sdk_configuration.hooks.after_error( + error: error, + hook_ctx: SDKHooks::AfterErrorHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + else + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + end + + if http_response.nil? + raise error if !error.nil? + raise "no response" + end + end + + content_type = http_response.headers.fetch("Content-Type", "application/octet-stream") + if Utils.match_status_code(http_response.status, ["200"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Operations::DeleteProjectResponseBody) + response = Models::Operations::DeleteProjectResponse.new( + status_code: http_response.status, + content_type: content_type, + raw_response: http_response, + object: T.unsafe(obj) + ) + + return response + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["401"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::AuthenticationError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["403"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::PermissionDeniedError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["404"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::NotFoundError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["429"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::RateLimitError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["4XX"]) + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "API error occurred" + ) + elsif Utils.match_status_code(http_response.status, ["5XX"]) + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "API error occurred" + ) + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown status code received" + ) + + end + end + + sig { + params( + body: Models::Operations::DuplicateProjectRequestBody, + id: ::String, + timeout_ms: T.nilable(Integer), + http_headers: T.nilable(T::Hash[T.any(String, Symbol), String]) + ) + .returns(Models::Operations::DuplicateProjectResponse) + } + def duplicate(body:, id:, timeout_ms: nil, http_headers: nil) + # duplicate - Duplicate a project + # Copy a project's configuration into a new project: its settings, every channel with its policies, rules and wordlists, its moderation actions and its review queues. The copy gets its own secret API key. Webhooks, integrations, API keys and content are not copied. Needs the `projects:write` permission and a key that reaches all projects. + request = Models::Operations::DuplicateProjectRequest.new( + id: id, + body: body + ) + url, params = @sdk_configuration.get_server_details + base_url = Utils.template_url(url, params) + url = Utils.generate_url( + Models::Operations::DuplicateProjectRequest, + base_url, + "/projects/{id}/duplicate", + request + ) + headers = {} + headers = T.cast(headers, T::Hash[String, String]) + req_content_type, data, form = Utils.serialize_request_body(request, false, false, :body, :json) + headers["content-type"] = req_content_type + raise StandardError, "request body is required" if data.nil? && form.nil? + + if form && !form.empty? + body = Utils.encode_form(form) + elsif Utils.match_content_type(req_content_type, "application/x-www-form-urlencoded") + body = URI.encode_www_form(T.cast(data, T::Hash[Symbol, Object])) + else + body = data + end + + headers["Accept"] = "application/json" + headers["user-agent"] = @sdk_configuration.user_agent + + security = @sdk_configuration.security_source&.call + + timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil? + timeout ||= @sdk_configuration.timeout + + connection = @sdk_configuration.client + + hook_ctx = SDKHooks::HookContext.new( + config: @sdk_configuration, + base_url: base_url, + oauth2_scopes: nil, + operation_id: "duplicateProject", + security_source: @sdk_configuration.security_source + ) + + error = T.let(nil, T.nilable(StandardError)) + http_response = T.let(nil, T.nilable(Faraday::Response)) + + begin + http_response = T.must(connection).post(url) do |req| + req.body = body + req.headers.merge!(headers) + req.options.timeout = timeout unless timeout.nil? + Utils.configure_request_security(req, security) + http_headers&.each do |key, value| + req.headers[key.to_s] = value + end + + @sdk_configuration.hooks.before_request( + hook_ctx: SDKHooks::BeforeRequestHookContext.new( + hook_ctx: hook_ctx + ), + request: req + ) + end + + rescue StandardError => e + error = e + ensure + if http_response.nil? || Utils.error_status?(http_response.status) + http_response = @sdk_configuration.hooks.after_error( + error: error, + hook_ctx: SDKHooks::AfterErrorHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + else + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + end + + if http_response.nil? + raise error if !error.nil? + raise "no response" + end + end + + content_type = http_response.headers.fetch("Content-Type", "application/octet-stream") + if Utils.match_status_code(http_response.status, ["200"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Components::ProjectWithKey) + response = Models::Operations::DuplicateProjectResponse.new( + status_code: http_response.status, + content_type: content_type, + raw_response: http_response, + project_with_key: T.unsafe(obj) + ) + + return response + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["400"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::BadRequestError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["401"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::AuthenticationError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["403"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::PermissionDeniedError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["404"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::NotFoundError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["429"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::RateLimitError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["4XX"]) + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "API error occurred" + ) + elsif Utils.match_status_code(http_response.status, ["5XX"]) + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "API error occurred" + ) + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown status code received" + ) + + end + end + end +end diff --git a/lib/moderation_api/queue.rb b/lib/moderation_api/queue.rb new file mode 100644 index 00000000..c613ef59 --- /dev/null +++ b/lib/moderation_api/queue.rb @@ -0,0 +1,611 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +require "faraday" +require "faraday/multipart" +require "faraday/retry" +require "sorbet-runtime" + +require_relative "sdk_hooks/hooks" +require_relative "utils/retries" + +module ModerationApi + extend T::Sig + + class Queue + extend T::Sig + attr_accessor :items + + sig { params(sdk_config: SDKConfiguration).void } + def initialize(sdk_config) + @sdk_configuration = sdk_config + init_sdks + end + + sig { void } + def init_sdks + @items = ::ModerationApi::Items.new(@sdk_configuration) + end + + sig { params(base_url: String, url_variables: T.nilable(T::Hash[Symbol, T.any(String, T::Enum)])).returns(String) } + def get_url(base_url:, url_variables: nil) + sd_base_url, sd_options = @sdk_configuration.get_server_details + + if base_url.nil? + base_url = sd_base_url + end + + if url_variables.nil? + url_variables = sd_options + end + + return Utils.template_url(base_url, url_variables) + end + + sig { + params( + id: ::String, + timeout_ms: T.nilable(Integer), + http_headers: T.nilable(T::Hash[T.any(String, Symbol), String]) + ) + .returns(Models::Operations::GetQueueResponse) + } + def retrieve(id:, timeout_ms: nil, http_headers: nil) + # retrieve - Get a queue + # Get a queue + request = Models::Operations::GetQueueRequest.new( + id: id + ) + url, params = @sdk_configuration.get_server_details + base_url = Utils.template_url(url, params) + url = Utils.generate_url( + Models::Operations::GetQueueRequest, + base_url, + "/queue/{id}", + request + ) + headers = {} + headers = T.cast(headers, T::Hash[String, String]) + headers["Accept"] = "application/json" + headers["user-agent"] = @sdk_configuration.user_agent + + security = @sdk_configuration.security_source&.call + + timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil? + timeout ||= @sdk_configuration.timeout + + connection = @sdk_configuration.client + + hook_ctx = SDKHooks::HookContext.new( + config: @sdk_configuration, + base_url: base_url, + oauth2_scopes: nil, + operation_id: "getQueue", + security_source: @sdk_configuration.security_source + ) + + error = T.let(nil, T.nilable(StandardError)) + http_response = T.let(nil, T.nilable(Faraday::Response)) + + begin + http_response = T.must(connection).get(url) do |req| + req.headers.merge!(headers) + req.options.timeout = timeout unless timeout.nil? + Utils.configure_request_security(req, security) + http_headers&.each do |key, value| + req.headers[key.to_s] = value + end + + @sdk_configuration.hooks.before_request( + hook_ctx: SDKHooks::BeforeRequestHookContext.new( + hook_ctx: hook_ctx + ), + request: req + ) + end + + rescue StandardError => e + error = e + ensure + if http_response.nil? || Utils.error_status?(http_response.status) + http_response = @sdk_configuration.hooks.after_error( + error: error, + hook_ctx: SDKHooks::AfterErrorHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + else + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + end + + if http_response.nil? + raise error if !error.nil? + raise "no response" + end + end + + content_type = http_response.headers.fetch("Content-Type", "application/octet-stream") + if Utils.match_status_code(http_response.status, ["200"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Operations::GetQueueResponseBody) + response = Models::Operations::GetQueueResponse.new( + status_code: http_response.status, + content_type: content_type, + raw_response: http_response, + object: T.unsafe(obj) + ) + + return response + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["400"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::BadRequestError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["401"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::AuthenticationError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["403"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::PermissionDeniedError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["404"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::NotFoundError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["429"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::RateLimitError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["500"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::InternalServerError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["4XX"]) + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "API error occurred" + ) + elsif Utils.match_status_code(http_response.status, ["5XX"]) + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "API error occurred" + ) + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown status code received" + ) + + end + end + + sig { + params( + id: ::String, + within_days: T.nilable(::Integer), + timeout_ms: T.nilable(Integer), + http_headers: T.nilable(T::Hash[T.any(String, Symbol), String]) + ) + .returns(Models::Operations::GetQueueStatsResponse) + } + def get_stats(id:, within_days: nil, timeout_ms: nil, http_headers: nil) + # get_stats - Get queue statistics + # Get detailed statistics about a moderation queue including review times, action counts, and trends + request = Models::Operations::GetQueueStatsRequest.new( + id: id, + within_days: within_days + ) + url, params = @sdk_configuration.get_server_details + base_url = Utils.template_url(url, params) + url = Utils.generate_url( + Models::Operations::GetQueueStatsRequest, + base_url, + "/queue/{id}/stats", + request + ) + headers = {} + headers = T.cast(headers, T::Hash[String, String]) + query_params = Utils.get_query_params(Models::Operations::GetQueueStatsRequest, request, nil) + headers["Accept"] = "application/json" + headers["user-agent"] = @sdk_configuration.user_agent + + security = @sdk_configuration.security_source&.call + + timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil? + timeout ||= @sdk_configuration.timeout + + connection = @sdk_configuration.client + + hook_ctx = SDKHooks::HookContext.new( + config: @sdk_configuration, + base_url: base_url, + oauth2_scopes: nil, + operation_id: "getQueueStats", + security_source: @sdk_configuration.security_source + ) + + error = T.let(nil, T.nilable(StandardError)) + http_response = T.let(nil, T.nilable(Faraday::Response)) + + begin + http_response = T.must(connection).get(url) do |req| + req.headers.merge!(headers) + req.options.timeout = timeout unless timeout.nil? + req.params = query_params + Utils.configure_request_security(req, security) + http_headers&.each do |key, value| + req.headers[key.to_s] = value + end + + @sdk_configuration.hooks.before_request( + hook_ctx: SDKHooks::BeforeRequestHookContext.new( + hook_ctx: hook_ctx + ), + request: req + ) + end + + rescue StandardError => e + error = e + ensure + if http_response.nil? || Utils.error_status?(http_response.status) + http_response = @sdk_configuration.hooks.after_error( + error: error, + hook_ctx: SDKHooks::AfterErrorHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + else + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + end + + if http_response.nil? + raise error if !error.nil? + raise "no response" + end + end + + content_type = http_response.headers.fetch("Content-Type", "application/octet-stream") + if Utils.match_status_code(http_response.status, ["200"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Operations::GetQueueStatsResponseBody) + response = Models::Operations::GetQueueStatsResponse.new( + status_code: http_response.status, + content_type: content_type, + raw_response: http_response, + object: T.unsafe(obj) + ) + + return response + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["400"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::BadRequestError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["401"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::AuthenticationError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["403"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::PermissionDeniedError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["404"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::NotFoundError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["429"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::RateLimitError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["500"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::InternalServerError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["4XX"]) + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "API error occurred" + ) + elsif Utils.match_status_code(http_response.status, ["5XX"]) + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "API error occurred" + ) + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown status code received" + ) + + end + end + end +end diff --git a/lib/moderation_api/request_options.rb b/lib/moderation_api/request_options.rb deleted file mode 100644 index a793a6d7..00000000 --- a/lib/moderation_api/request_options.rb +++ /dev/null @@ -1,78 +0,0 @@ -# frozen_string_literal: true - -module ModerationAPI - # Specify HTTP behaviour to use for a specific request. These options supplement - # or override those provided at the client level. - # - # When making a request, you can pass an actual {RequestOptions} instance, or - # simply pass a Hash with symbol keys matching the attributes on this class. - class RequestOptions < ModerationAPI::Internal::Type::BaseModel - # @api private - # - # @param opts [ModerationAPI::RequestOptions, Hash{Symbol=>Object}] - # - # @raise [ArgumentError] - def self.validate!(opts) - case opts - in ModerationAPI::RequestOptions | Hash - opts.to_h.each_key do |k| - unless fields.include?(k) - raise ArgumentError.new("Request `opts` keys must be one of #{fields.keys}, got #{k.inspect}") - end - end - else - raise ArgumentError.new("Request `opts` must be a Hash or RequestOptions, got #{opts.inspect}") - end - end - - # @!attribute idempotency_key - # Idempotency key to send with request and all associated retries. Will only be - # sent for write requests. - # - # @return [String, nil] - optional :idempotency_key, String - - # @!attribute extra_query - # Extra query params to send with the request. These are `.merge`’d into any - # `query` given at the client level. - # - # @return [Hash{String=>Array, String, nil}, nil] - optional :extra_query, - ModerationAPI::Internal::Type::HashOf[ModerationAPI::Internal::Type::ArrayOf[String]] - - # @!attribute extra_headers - # Extra headers to send with the request. These are `.merged`’d into any - # `extra_headers` given at the client level. - # - # @return [Hash{String=>String, nil}, nil] - optional :extra_headers, ModerationAPI::Internal::Type::HashOf[String, nil?: true] - - # @!attribute extra_body - # Extra data to send with the request. These are deep merged into any data - # generated as part of the normal request. - # - # @return [Object, nil] - optional :extra_body, ModerationAPI::Internal::Type::HashOf[ModerationAPI::Internal::Type::Unknown] - - # @!attribute max_retries - # Maximum number of retries to attempt after a failed initial request. - # - # @return [Integer, nil] - optional :max_retries, Integer - - # @!attribute timeout - # Request timeout in seconds. - # - # @return [Float, nil] - optional :timeout, Float - - # @!method initialize(values = {}) - # Returns a new instance of RequestOptions. - # - # @param values [Hash{Symbol=>Object}] - - define_sorbet_constant!(:OrHash) do - T.type_alias { T.any(ModerationAPI::RequestOptions, ModerationAPI::Internal::AnyHash) } - end - end -end diff --git a/lib/moderation_api/resources/account.rb b/lib/moderation_api/resources/account.rb deleted file mode 100644 index be0c1f49..00000000 --- a/lib/moderation_api/resources/account.rb +++ /dev/null @@ -1,32 +0,0 @@ -# frozen_string_literal: true - -module ModerationAPI - module Resources - class Account - # Get account details - # - # @overload list(request_options: {}) - # - # @param request_options [ModerationAPI::RequestOptions, Hash{Symbol=>Object}, nil] - # - # @return [ModerationAPI::Models::AccountListResponse] - # - # @see ModerationAPI::Models::AccountListParams - def list(params = {}) - @client.request( - method: :get, - path: "account", - model: ModerationAPI::Models::AccountListResponse, - options: params[:request_options] - ) - end - - # @api private - # - # @param client [ModerationAPI::Client] - def initialize(client:) - @client = client - end - end - end -end diff --git a/lib/moderation_api/resources/actions.rb b/lib/moderation_api/resources/actions.rb deleted file mode 100644 index ac805179..00000000 --- a/lib/moderation_api/resources/actions.rb +++ /dev/null @@ -1,172 +0,0 @@ -# frozen_string_literal: true - -module ModerationAPI - module Resources - class Actions - # @return [ModerationAPI::Resources::Actions::Execute] - attr_reader :execute - - # Some parameter documentations has been truncated, see - # {ModerationAPI::Models::ActionCreateParams} for more details. - # - # Create an action. - # - # @overload create(name:, built_in: nil, description: nil, filter_in_queue_ids: nil, free_text: nil, key: nil, position: nil, possible_values: nil, queue_behaviour: nil, type: nil, value_required: nil, request_options: {}) - # - # @param name [String] The name of the action. - # - # @param built_in [Boolean, nil] Whether the action is a built-in action or a custom one. - # - # @param description [String, nil] The description of the action. - # - # @param filter_in_queue_ids [Array] The IDs of the queues the action is available in. - # - # @param free_text [Boolean] Whether the action allows any text to be entered as a value or if it must be one - # - # @param key [String, nil] User defined key of the action. - # - # @param position [Symbol, ModerationAPI::Models::ActionCreateParams::Position] Show the action in all queues, selected queues or no queues (to use via API only - # - # @param possible_values [Array] The possible values of the action. The user will be prompted to select one of th - # - # @param queue_behaviour [Symbol, ModerationAPI::Models::ActionCreateParams::QueueBehaviour] Whether the action resolves and removes the item, unresolves and re-add it to th - # - # @param type [Symbol, ModerationAPI::Models::ActionCreateParams::Type, nil] The type of the action. - # - # @param value_required [Boolean] Whether the action requires a value to be executed. - # - # @param request_options [ModerationAPI::RequestOptions, Hash{Symbol=>Object}, nil] - # - # @return [ModerationAPI::Models::ActionCreateResponse] - # - # @see ModerationAPI::Models::ActionCreateParams - def create(params) - parsed, options = ModerationAPI::ActionCreateParams.dump_request(params) - @client.request( - method: :post, - path: "actions", - body: parsed, - model: ModerationAPI::Models::ActionCreateResponse, - options: options - ) - end - - # Get an action by ID. - # - # @overload retrieve(id, request_options: {}) - # - # @param id [String] The ID of the action to get. - # - # @param request_options [ModerationAPI::RequestOptions, Hash{Symbol=>Object}, nil] - # - # @return [ModerationAPI::Models::ActionRetrieveResponse] - # - # @see ModerationAPI::Models::ActionRetrieveParams - def retrieve(id, params = {}) - @client.request( - method: :get, - path: ["actions/%1$s", id], - model: ModerationAPI::Models::ActionRetrieveResponse, - options: params[:request_options] - ) - end - - # Some parameter documentations has been truncated, see - # {ModerationAPI::Models::ActionUpdateParams} for more details. - # - # Update an action. - # - # @overload update(id, built_in: nil, description: nil, filter_in_queue_ids: nil, free_text: nil, key: nil, name: nil, position: nil, possible_values: nil, queue_behaviour: nil, type: nil, value_required: nil, request_options: {}) - # - # @param id [String] The ID of the action to update. - # - # @param built_in [Boolean, nil] Whether the action is a built-in action or a custom one. - # - # @param description [String, nil] The description of the action. - # - # @param filter_in_queue_ids [Array] The IDs of the queues the action is available in. - # - # @param free_text [Boolean] Whether the action allows any text to be entered as a value or if it must be one - # - # @param key [String, nil] User defined key of the action. - # - # @param name [String] The name of the action. - # - # @param position [Symbol, ModerationAPI::Models::ActionUpdateParams::Position] Show the action in all queues, selected queues or no queues (to use via API only - # - # @param possible_values [Array] The possible values of the action. The user will be prompted to select one of th - # - # @param queue_behaviour [Symbol, ModerationAPI::Models::ActionUpdateParams::QueueBehaviour] Whether the action resolves and removes the item, unresolves and re-add it to th - # - # @param type [Symbol, ModerationAPI::Models::ActionUpdateParams::Type, nil] The type of the action. - # - # @param value_required [Boolean] Whether the action requires a value to be executed. - # - # @param request_options [ModerationAPI::RequestOptions, Hash{Symbol=>Object}, nil] - # - # @return [ModerationAPI::Models::ActionUpdateResponse] - # - # @see ModerationAPI::Models::ActionUpdateParams - def update(id, params = {}) - parsed, options = ModerationAPI::ActionUpdateParams.dump_request(params) - @client.request( - method: :put, - path: ["actions/%1$s", id], - body: parsed, - model: ModerationAPI::Models::ActionUpdateResponse, - options: options - ) - end - - # List all available moderation actions for the authenticated organization. - # - # @overload list(queue_id: nil, request_options: {}) - # - # @param queue_id [String] - # @param request_options [ModerationAPI::RequestOptions, Hash{Symbol=>Object}, nil] - # - # @return [Array] - # - # @see ModerationAPI::Models::ActionListParams - def list(params = {}) - parsed, options = ModerationAPI::ActionListParams.dump_request(params) - query = ModerationAPI::Internal::Util.encode_query_params(parsed) - @client.request( - method: :get, - path: "actions", - query: query.transform_keys(queue_id: "queueId"), - model: ModerationAPI::Internal::Type::ArrayOf[ModerationAPI::Models::ActionListResponseItem], - options: options - ) - end - - # Delete an action and all of its webhooks. - # - # @overload delete(id, request_options: {}) - # - # @param id [String] The ID of the action to delete. - # - # @param request_options [ModerationAPI::RequestOptions, Hash{Symbol=>Object}, nil] - # - # @return [ModerationAPI::Models::ActionDeleteResponse] - # - # @see ModerationAPI::Models::ActionDeleteParams - def delete(id, params = {}) - @client.request( - method: :delete, - path: ["actions/%1$s", id], - model: ModerationAPI::Models::ActionDeleteResponse, - options: params[:request_options] - ) - end - - # @api private - # - # @param client [ModerationAPI::Client] - def initialize(client:) - @client = client - @execute = ModerationAPI::Resources::Actions::Execute.new(client: client) - end - end - end -end diff --git a/lib/moderation_api/resources/actions/execute.rb b/lib/moderation_api/resources/actions/execute.rb deleted file mode 100644 index 8fa54ced..00000000 --- a/lib/moderation_api/resources/actions/execute.rb +++ /dev/null @@ -1,80 +0,0 @@ -# frozen_string_literal: true - -module ModerationAPI - module Resources - class Actions - class Execute - # Execute a moderation action on one or more content items. - # - # @overload execute(action_key:, author_ids: nil, content_ids: nil, duration: nil, queue_id: nil, value: nil, request_options: {}) - # - # @param action_key [String] ID or key of the action to execute - # - # @param author_ids [Array] IDs of the authors to apply the action to. Provide this or contentIds. - # - # @param content_ids [Array] IDs of the content items to apply the action to. Provide this or authorIds. - # - # @param duration [Float] Optional duration in milliseconds for actions with timeouts - # - # @param queue_id [String] Optional queue ID if the action is queue-specific - # - # @param value [String] Optional value to provide with the action - # - # @param request_options [ModerationAPI::RequestOptions, Hash{Symbol=>Object}, nil] - # - # @return [ModerationAPI::Models::Actions::ExecuteExecuteResponse] - # - # @see ModerationAPI::Models::Actions::ExecuteExecuteParams - def execute(params) - parsed, options = ModerationAPI::Actions::ExecuteExecuteParams.dump_request(params) - @client.request( - method: :post, - path: "actions/execute", - body: parsed, - model: ModerationAPI::Models::Actions::ExecuteExecuteResponse, - options: options - ) - end - - # @deprecated - # - # Execute an action on a set of content items in a queue. - # - # @overload execute_by_id(action_id, author_ids: nil, content_ids: nil, queue_id: nil, value: nil, request_options: {}) - # - # @param action_id [String] The ID or key of the action to execute. - # - # @param author_ids [Array] IDs of the authors to apply the action to - # - # @param content_ids [Array] The IDs of the content items to perform the action on. - # - # @param queue_id [String] The ID of the queue the action was performed from if any. - # - # @param value [String] The value of the action. Useful to set a reason for the action etc. - # - # @param request_options [ModerationAPI::RequestOptions, Hash{Symbol=>Object}, nil] - # - # @return [ModerationAPI::Models::Actions::ExecuteExecuteByIDResponse] - # - # @see ModerationAPI::Models::Actions::ExecuteExecuteByIDParams - def execute_by_id(action_id, params = {}) - parsed, options = ModerationAPI::Actions::ExecuteExecuteByIDParams.dump_request(params) - @client.request( - method: :post, - path: ["actions/%1$s/execute", action_id], - body: parsed, - model: ModerationAPI::Models::Actions::ExecuteExecuteByIDResponse, - options: options - ) - end - - # @api private - # - # @param client [ModerationAPI::Client] - def initialize(client:) - @client = client - end - end - end - end -end diff --git a/lib/moderation_api/resources/auth.rb b/lib/moderation_api/resources/auth.rb deleted file mode 100644 index 42829531..00000000 --- a/lib/moderation_api/resources/auth.rb +++ /dev/null @@ -1,50 +0,0 @@ -# frozen_string_literal: true - -module ModerationAPI - module Resources - class Auth - # @deprecated - # - # @overload create(request_options: {}) - # - # @param request_options [ModerationAPI::RequestOptions, Hash{Symbol=>Object}, nil] - # - # @return [ModerationAPI::Models::AuthCreateResponse] - # - # @see ModerationAPI::Models::AuthCreateParams - def create(params = {}) - @client.request( - method: :post, - path: "auth", - model: ModerationAPI::Models::AuthCreateResponse, - options: params[:request_options] - ) - end - - # @deprecated - # - # @overload retrieve(request_options: {}) - # - # @param request_options [ModerationAPI::RequestOptions, Hash{Symbol=>Object}, nil] - # - # @return [ModerationAPI::Models::AuthRetrieveResponse] - # - # @see ModerationAPI::Models::AuthRetrieveParams - def retrieve(params = {}) - @client.request( - method: :get, - path: "auth", - model: ModerationAPI::Models::AuthRetrieveResponse, - options: params[:request_options] - ) - end - - # @api private - # - # @param client [ModerationAPI::Client] - def initialize(client:) - @client = client - end - end - end -end diff --git a/lib/moderation_api/resources/authors.rb b/lib/moderation_api/resources/authors.rb deleted file mode 100644 index e6a53593..00000000 --- a/lib/moderation_api/resources/authors.rb +++ /dev/null @@ -1,187 +0,0 @@ -# frozen_string_literal: true - -module ModerationAPI - module Resources - class Authors - # Some parameter documentations has been truncated, see - # {ModerationAPI::Models::AuthorCreateParams} for more details. - # - # Create a new author. Typically not needed as authors are created automatically - # when content is moderated. - # - # @overload create(external_id:, company: nil, email: nil, external_link: nil, first_seen: nil, last_seen: nil, manual_trust_level: nil, metadata: nil, name: nil, profile_picture: nil, request_options: {}) - # - # @param external_id [String] External ID of the user, typically the ID of the author in your database. - # - # @param company [String, nil] The author's company or organization - # - # @param email [String, nil] Author email address - # - # @param external_link [String, nil] URL of the author's external profile - # - # @param first_seen [Float] Timestamp when author first appeared - # - # @param last_seen [Float] Timestamp of last activity - # - # @param manual_trust_level [Float, nil] - # - # @param metadata [ModerationAPI::Models::AuthorCreateParams::Metadata] Additional metadata provided by your system. We recommend including any relevant - # - # @param name [String, nil] Author name or identifier - # - # @param profile_picture [String, nil] URL of the author's profile picture - # - # @param request_options [ModerationAPI::RequestOptions, Hash{Symbol=>Object}, nil] - # - # @return [ModerationAPI::Models::AuthorCreateResponse] - # - # @see ModerationAPI::Models::AuthorCreateParams - def create(params) - parsed, options = ModerationAPI::AuthorCreateParams.dump_request(params) - @client.request( - method: :post, - path: "authors", - body: parsed, - model: ModerationAPI::Models::AuthorCreateResponse, - options: options - ) - end - - # Get detailed information about a specific author including historical data and - # analysis - # - # @overload retrieve(id, request_options: {}) - # - # @param id [String] Either external ID or the ID assigned by moderation API. - # - # @param request_options [ModerationAPI::RequestOptions, Hash{Symbol=>Object}, nil] - # - # @return [ModerationAPI::Models::AuthorRetrieveResponse] - # - # @see ModerationAPI::Models::AuthorRetrieveParams - def retrieve(id, params = {}) - @client.request( - method: :get, - path: ["authors/%1$s", id], - model: ModerationAPI::Models::AuthorRetrieveResponse, - options: params[:request_options] - ) - end - - # Some parameter documentations has been truncated, see - # {ModerationAPI::Models::AuthorUpdateParams} for more details. - # - # Update the details of a specific author - # - # @overload update(id, company: nil, email: nil, external_link: nil, first_seen: nil, last_seen: nil, manual_trust_level: nil, metadata: nil, name: nil, profile_picture: nil, request_options: {}) - # - # @param id [String] Either external ID or the ID assigned by moderation API. - # - # @param company [String, nil] The author's company or organization - # - # @param email [String, nil] Author email address - # - # @param external_link [String, nil] URL of the author's external profile - # - # @param first_seen [Float] Timestamp when author first appeared - # - # @param last_seen [Float] Timestamp of last activity - # - # @param manual_trust_level [Float, nil] - # - # @param metadata [ModerationAPI::Models::AuthorUpdateParams::Metadata] Additional metadata provided by your system. We recommend including any relevant - # - # @param name [String, nil] Author name or identifier - # - # @param profile_picture [String, nil] URL of the author's profile picture - # - # @param request_options [ModerationAPI::RequestOptions, Hash{Symbol=>Object}, nil] - # - # @return [ModerationAPI::Models::AuthorUpdateResponse] - # - # @see ModerationAPI::Models::AuthorUpdateParams - def update(id, params = {}) - parsed, options = ModerationAPI::AuthorUpdateParams.dump_request(params) - @client.request( - method: :put, - path: ["authors/%1$s", id], - body: parsed, - model: ModerationAPI::Models::AuthorUpdateResponse, - options: options - ) - end - - # Get a paginated list of authors with their activity metrics and reputation - # - # @overload list(content_types: nil, last_active_date: nil, member_since_date: nil, page_number: nil, page_size: nil, sort_by: nil, sort_direction: nil, request_options: {}) - # - # @param content_types [String] - # - # @param last_active_date [String] - # - # @param member_since_date [String] - # - # @param page_number [Float] Page number to fetch - # - # @param page_size [Float] Number of authors per page - # - # @param sort_by [Symbol, ModerationAPI::Models::AuthorListParams::SortBy] - # - # @param sort_direction [Symbol, ModerationAPI::Models::AuthorListParams::SortDirection] Sort direction - # - # @param request_options [ModerationAPI::RequestOptions, Hash{Symbol=>Object}, nil] - # - # @return [ModerationAPI::Models::AuthorListResponse] - # - # @see ModerationAPI::Models::AuthorListParams - def list(params = {}) - parsed, options = ModerationAPI::AuthorListParams.dump_request(params) - query = ModerationAPI::Internal::Util.encode_query_params(parsed) - @client.request( - method: :get, - path: "authors", - query: query.transform_keys( - content_types: "contentTypes", - last_active_date: "lastActiveDate", - member_since_date: "memberSinceDate", - page_number: "pageNumber", - page_size: "pageSize", - sort_by: "sortBy", - sort_direction: "sortDirection" - ), - model: ModerationAPI::Models::AuthorListResponse, - options: options - ) - end - - # Delete a specific author. This resets the author: status, blocks, trust level, - # metrics and action history are removed. The author is created again with a clean - # record the next time content is moderated for the same ID. - # - # @overload delete(id, request_options: {}) - # - # @param id [String] Either external ID or the ID assigned by moderation API. - # - # @param request_options [ModerationAPI::RequestOptions, Hash{Symbol=>Object}, nil] - # - # @return [ModerationAPI::Models::AuthorDeleteResponse] - # - # @see ModerationAPI::Models::AuthorDeleteParams - def delete(id, params = {}) - @client.request( - method: :delete, - path: ["authors/%1$s", id], - model: ModerationAPI::Models::AuthorDeleteResponse, - options: params[:request_options] - ) - end - - # @api private - # - # @param client [ModerationAPI::Client] - def initialize(client:) - @client = client - end - end - end -end diff --git a/lib/moderation_api/resources/content.rb b/lib/moderation_api/resources/content.rb deleted file mode 100644 index 421d13a0..00000000 --- a/lib/moderation_api/resources/content.rb +++ /dev/null @@ -1,99 +0,0 @@ -# frozen_string_literal: true - -module ModerationAPI - module Resources - class Content - # Open a WebSocket to moderate live voice/call audio in real time. Speech is - # transcribed and each finalized utterance is moderated by your enabled text - # policies; you receive a verdict per utterance as it's spoken. - # - # **This is a WebSocket upgrade, not a regular HTTP call.** The request body below - # documents the frames you _send_ over the socket; the `101` response documents - # the events you _receive_. - # - # - **Auth:** `Authorization: Bearer ` on the upgrade. A missing/invalid - # key closes `4401`; voice not enabled on the plan/channel closes `4403`. - # - **Subprotocol:** request `moderationapi.v1`. - # - **Flow:** send one `start` frame, then `media` frames as audio arrives, then - # `stop` (or disconnect). You receive `session.started`, `utterance.final` per - # utterance, optional `utterance.partial`/`warning`, and `session.ended`. - # - **Close codes:** `1000` normal · `1011` server error · `4400` bad request · - # `4401` auth failed · `4403` voice not enabled · `4429` concurrency limit. - # - # See the - # [Real-time voice guide](https://docs.moderationapi.com/content-moderation/real-time-voice) - # for the full walkthrough and code examples. - # - # @overload stream(sec_web_socket_protocol:, request_options: {}) - # - # @param sec_web_socket_protocol [Symbol, ModerationAPI::Models::ContentStreamParams::SecWebSocketProtocol] Requested subprotocol. - # - # @param request_options [ModerationAPI::RequestOptions, Hash{Symbol=>Object}, nil] - # - # @return [nil] - # - # @see ModerationAPI::Models::ContentStreamParams - def stream(params) - parsed, options = ModerationAPI::ContentStreamParams.dump_request(params) - path = @client.base_url_overridden? ? "stream" : "wss://voice.moderationapi.com/v1/stream" - @client.request( - method: :get, - path: path, - headers: parsed.transform_keys(sec_web_socket_protocol: "sec-websocket-protocol"), - model: NilClass, - options: options - ) - end - - # Some parameter documentations has been truncated, see - # {ModerationAPI::Models::ContentSubmitParams} for more details. - # - # @overload submit(content:, author_id: nil, channel: nil, client_action: nil, content_id: nil, conversation_id: nil, do_not_store: nil, metadata: nil, meta_type: nil, policies: nil, timestamp: nil, request_options: {}) - # - # @param content [ModerationAPI::Models::ContentSubmitParams::Content::Text, ModerationAPI::Models::ContentSubmitParams::Content::Image, ModerationAPI::Models::ContentSubmitParams::Content::Video, ModerationAPI::Models::ContentSubmitParams::Content::Audio, ModerationAPI::Models::ContentSubmitParams::Content::Object] The content sent for moderation - # - # @param author_id [String] The author of the content. - # - # @param channel [String] Provide a channel ID or key. Will use the project's default channel if not provi - # - # @param client_action [ModerationAPI::Models::ContentSubmitParams::ClientAction] A recommendation from your own client-side flagging (e.g. a banned-IP list or a - # - # @param content_id [String] The unique ID of the content in your database. - # - # @param conversation_id [String] For example the ID of a chat room or a post - # - # @param do_not_store [Boolean] Do not store the content. The content won't enter the review queue - # - # @param metadata [Hash{Symbol=>Object}] Any metadata you want to store with the content - # - # @param meta_type [Symbol, ModerationAPI::Models::ContentSubmitParams::MetaType] The meta type of content being moderated - # - # @param policies [Array] (Enterprise) override the channel policies for this moderation request only. - # - # @param timestamp [Float] Unix timestamp (in milliseconds) of when the content was created. Use if content - # - # @param request_options [ModerationAPI::RequestOptions, Hash{Symbol=>Object}, nil] - # - # @return [ModerationAPI::Models::ContentSubmitResponse] - # - # @see ModerationAPI::Models::ContentSubmitParams - def submit(params) - parsed, options = ModerationAPI::ContentSubmitParams.dump_request(params) - @client.request( - method: :post, - path: "moderate", - body: parsed, - model: ModerationAPI::Models::ContentSubmitResponse, - options: options - ) - end - - # @api private - # - # @param client [ModerationAPI::Client] - def initialize(client:) - @client = client - end - end - end -end diff --git a/lib/moderation_api/resources/queue.rb b/lib/moderation_api/resources/queue.rb deleted file mode 100644 index 4c91aa93..00000000 --- a/lib/moderation_api/resources/queue.rb +++ /dev/null @@ -1,64 +0,0 @@ -# frozen_string_literal: true - -module ModerationAPI - module Resources - class Queue - # @return [ModerationAPI::Resources::Queue::Items] - attr_reader :items - - # Get a queue - # - # @overload retrieve(id, request_options: {}) - # - # @param id [String] The queue ID - # - # @param request_options [ModerationAPI::RequestOptions, Hash{Symbol=>Object}, nil] - # - # @return [ModerationAPI::Models::QueueRetrieveResponse] - # - # @see ModerationAPI::Models::QueueRetrieveParams - def retrieve(id, params = {}) - @client.request( - method: :get, - path: ["queue/%1$s", id], - model: ModerationAPI::Models::QueueRetrieveResponse, - options: params[:request_options] - ) - end - - # Get detailed statistics about a moderation queue including review times, action - # counts, and trends - # - # @overload get_stats(id, within_days: nil, request_options: {}) - # - # @param id [String] The queue ID - # - # @param within_days [String] Number of days to analyze statistics for - # - # @param request_options [ModerationAPI::RequestOptions, Hash{Symbol=>Object}, nil] - # - # @return [ModerationAPI::Models::QueueGetStatsResponse] - # - # @see ModerationAPI::Models::QueueGetStatsParams - def get_stats(id, params = {}) - parsed, options = ModerationAPI::QueueGetStatsParams.dump_request(params) - query = ModerationAPI::Internal::Util.encode_query_params(parsed) - @client.request( - method: :get, - path: ["queue/%1$s/stats", id], - query: query.transform_keys(within_days: "withinDays"), - model: ModerationAPI::Models::QueueGetStatsResponse, - options: options - ) - end - - # @api private - # - # @param client [ModerationAPI::Client] - def initialize(client:) - @client = client - @items = ModerationAPI::Resources::Queue::Items.new(client: client) - end - end - end -end diff --git a/lib/moderation_api/resources/queue/items.rb b/lib/moderation_api/resources/queue/items.rb deleted file mode 100644 index cb9a0712..00000000 --- a/lib/moderation_api/resources/queue/items.rb +++ /dev/null @@ -1,132 +0,0 @@ -# frozen_string_literal: true - -module ModerationAPI - module Resources - class Queue - class Items - # Get paginated list of items in a moderation queue with filtering options - # - # @overload list(id, after_date: nil, author_id: nil, before_date: nil, conversation_ids: nil, filtered_action_ids: nil, include_resolved: nil, labels: nil, page_number: nil, page_size: nil, sort_direction: nil, sort_field: nil, request_options: {}) - # - # @param id [String] The queue ID - # - # @param after_date [String] - # - # @param author_id [String] - # - # @param before_date [String] - # - # @param conversation_ids [String] - # - # @param filtered_action_ids [String] - # - # @param include_resolved [String] - # - # @param labels [String] - # - # @param page_number [Float] Page number to fetch - # - # @param page_size [Float] Number of items per page - # - # @param sort_direction [Symbol, ModerationAPI::Models::Queue::ItemListParams::SortDirection] Sort direction - # - # @param sort_field [Symbol, ModerationAPI::Models::Queue::ItemListParams::SortField] - # - # @param request_options [ModerationAPI::RequestOptions, Hash{Symbol=>Object}, nil] - # - # @return [ModerationAPI::Models::Queue::ItemListResponse] - # - # @see ModerationAPI::Models::Queue::ItemListParams - def list(id, params = {}) - parsed, options = ModerationAPI::Queue::ItemListParams.dump_request(params) - query = ModerationAPI::Internal::Util.encode_query_params(parsed) - @client.request( - method: :get, - path: ["queue/%1$s/items", id], - query: query.transform_keys( - after_date: "afterDate", - author_id: "authorId", - before_date: "beforeDate", - conversation_ids: "conversationIds", - filtered_action_ids: "filteredActionIds", - include_resolved: "includeResolved", - page_number: "pageNumber", - page_size: "pageSize", - sort_direction: "sortDirection", - sort_field: "sortField" - ), - model: ModerationAPI::Models::Queue::ItemListResponse, - options: options - ) - end - - # Mark a queue item as resolved with a specific moderation action - # - # @overload resolve(item_id, id:, comment: nil, request_options: {}) - # - # @param item_id [String] Path param: The item ID to resolve - # - # @param id [String] Path param: The queue ID - # - # @param comment [String] Body param: Optional comment - # - # @param request_options [ModerationAPI::RequestOptions, Hash{Symbol=>Object}, nil] - # - # @return [ModerationAPI::Models::Queue::ItemResolveResponse] - # - # @see ModerationAPI::Models::Queue::ItemResolveParams - def resolve(item_id, params) - parsed, options = ModerationAPI::Queue::ItemResolveParams.dump_request(params) - id = - parsed.delete(:id) do - raise ArgumentError.new("missing required path argument #{_1}") - end - @client.request( - method: :post, - path: ["queue/%1$s/items/%2$s/resolve", id, item_id], - body: parsed, - model: ModerationAPI::Models::Queue::ItemResolveResponse, - options: options - ) - end - - # Mark a previously resolved queue item as unresolved/pending - # - # @overload unresolve(item_id, id:, comment: nil, request_options: {}) - # - # @param item_id [String] Path param: The item ID to unresolve - # - # @param id [String] Path param: The queue ID - # - # @param comment [String] Body param: Optional reason for unresolving the item - # - # @param request_options [ModerationAPI::RequestOptions, Hash{Symbol=>Object}, nil] - # - # @return [ModerationAPI::Models::Queue::ItemUnresolveResponse] - # - # @see ModerationAPI::Models::Queue::ItemUnresolveParams - def unresolve(item_id, params) - parsed, options = ModerationAPI::Queue::ItemUnresolveParams.dump_request(params) - id = - parsed.delete(:id) do - raise ArgumentError.new("missing required path argument #{_1}") - end - @client.request( - method: :post, - path: ["queue/%1$s/items/%2$s/unresolve", id, item_id], - body: parsed, - model: ModerationAPI::Models::Queue::ItemUnresolveResponse, - options: options - ) - end - - # @api private - # - # @param client [ModerationAPI::Client] - def initialize(client:) - @client = client - end - end - end - end -end diff --git a/lib/moderation_api/resources/webhook_secret.rb b/lib/moderation_api/resources/webhook_secret.rb deleted file mode 100644 index 8561dbf6..00000000 --- a/lib/moderation_api/resources/webhook_secret.rb +++ /dev/null @@ -1,34 +0,0 @@ -# frozen_string_literal: true - -module ModerationAPI - module Resources - class WebhookSecret - # Get the signing secret used to sign webhook deliveries for this project, - # creating one if none exists yet. Verify deliveries by comparing the - # `modapi-signature` header to HMAC-SHA256(raw request body, secret) hex-encoded. - # - # @overload retrieve(request_options: {}) - # - # @param request_options [ModerationAPI::RequestOptions, Hash{Symbol=>Object}, nil] - # - # @return [ModerationAPI::Models::WebhookSecretRetrieveResponse] - # - # @see ModerationAPI::Models::WebhookSecretRetrieveParams - def retrieve(params = {}) - @client.request( - method: :get, - path: "webhook-secret", - model: ModerationAPI::Models::WebhookSecretRetrieveResponse, - options: params[:request_options] - ) - end - - # @api private - # - # @param client [ModerationAPI::Client] - def initialize(client:) - @client = client - end - end - end -end diff --git a/lib/moderation_api/resources/webhooks.rb b/lib/moderation_api/resources/webhooks.rb deleted file mode 100644 index 02fb123d..00000000 --- a/lib/moderation_api/resources/webhooks.rb +++ /dev/null @@ -1,139 +0,0 @@ -# frozen_string_literal: true - -module ModerationAPI - module Resources - class Webhooks - # Some parameter documentations has been truncated, see - # {ModerationAPI::Models::WebhookCreateParams} for more details. - # - # Create a webhook subscribed to one or more event types. Deliveries use the v2 - # envelope and are signed with the project signing secret (see the signing secret - # endpoint). - # - # @overload create(event_types:, name:, url:, description: nil, request_options: {}) - # - # @param event_types [Array] Event types this webhook subscribes to. One webhook URL receives all events you - # - # @param name [String] The webhook's name, used to identify it in the dashboard - # - # @param url [String] The webhook's URL. We'll call this URL when an event occurs. - # - # @param description [String, nil] The webhook's description - # - # @param request_options [ModerationAPI::RequestOptions, Hash{Symbol=>Object}, nil] - # - # @return [ModerationAPI::Models::WebhookCreateResponse] - # - # @see ModerationAPI::Models::WebhookCreateParams - def create(params) - parsed, options = ModerationAPI::WebhookCreateParams.dump_request(params) - @client.request( - method: :post, - path: "webhooks", - body: parsed, - model: ModerationAPI::Models::WebhookCreateResponse, - options: options - ) - end - - # Get a webhook by ID. - # - # @overload retrieve(id, request_options: {}) - # - # @param id [String] The ID of the webhook to get. - # - # @param request_options [ModerationAPI::RequestOptions, Hash{Symbol=>Object}, nil] - # - # @return [ModerationAPI::Models::WebhookRetrieveResponse] - # - # @see ModerationAPI::Models::WebhookRetrieveParams - def retrieve(id, params = {}) - @client.request( - method: :get, - path: ["webhooks/%1$s", id], - model: ModerationAPI::Models::WebhookRetrieveResponse, - options: params[:request_options] - ) - end - - # Some parameter documentations has been truncated, see - # {ModerationAPI::Models::WebhookUpdateParams} for more details. - # - # Update a webhook. Legacy v1 webhooks are read-only: delete them and create a new - # webhook instead. - # - # @overload update(id, description: nil, event_types: nil, name: nil, url: nil, request_options: {}) - # - # @param id [String] The ID of the webhook to update. - # - # @param description [String, nil] The webhook's description - # - # @param event_types [Array] Event types this webhook subscribes to. One webhook URL receives all events you - # - # @param name [String] The webhook's name, used to identify it in the dashboard - # - # @param url [String] The webhook's URL. We'll call this URL when an event occurs. - # - # @param request_options [ModerationAPI::RequestOptions, Hash{Symbol=>Object}, nil] - # - # @return [ModerationAPI::Models::WebhookUpdateResponse] - # - # @see ModerationAPI::Models::WebhookUpdateParams - def update(id, params = {}) - parsed, options = ModerationAPI::WebhookUpdateParams.dump_request(params) - @client.request( - method: :put, - path: ["webhooks/%1$s", id], - body: parsed, - model: ModerationAPI::Models::WebhookUpdateResponse, - options: options - ) - end - - # List all webhooks for the authenticated project. - # - # @overload list(request_options: {}) - # - # @param request_options [ModerationAPI::RequestOptions, Hash{Symbol=>Object}, nil] - # - # @return [Array] - # - # @see ModerationAPI::Models::WebhookListParams - def list(params = {}) - @client.request( - method: :get, - path: "webhooks", - model: ModerationAPI::Internal::Type::ArrayOf[ModerationAPI::Models::WebhookListResponseItem], - options: params[:request_options] - ) - end - - # Delete a webhook. - # - # @overload delete(id, request_options: {}) - # - # @param id [String] The ID of the webhook to delete. - # - # @param request_options [ModerationAPI::RequestOptions, Hash{Symbol=>Object}, nil] - # - # @return [ModerationAPI::Models::WebhookDeleteResponse] - # - # @see ModerationAPI::Models::WebhookDeleteParams - def delete(id, params = {}) - @client.request( - method: :delete, - path: ["webhooks/%1$s", id], - model: ModerationAPI::Models::WebhookDeleteResponse, - options: params[:request_options] - ) - end - - # @api private - # - # @param client [ModerationAPI::Client] - def initialize(client:) - @client = client - end - end - end -end diff --git a/lib/moderation_api/resources/wordlist.rb b/lib/moderation_api/resources/wordlist.rb deleted file mode 100644 index d54ce87e..00000000 --- a/lib/moderation_api/resources/wordlist.rb +++ /dev/null @@ -1,111 +0,0 @@ -# frozen_string_literal: true - -module ModerationAPI - module Resources - class Wordlist - # @return [ModerationAPI::Resources::Wordlist::Words] - attr_reader :words - - # Get a specific wordlist by ID - # - # @overload retrieve(id, request_options: {}) - # - # @param id [String] ID of the wordlist to get - # - # @param request_options [ModerationAPI::RequestOptions, Hash{Symbol=>Object}, nil] - # - # @return [ModerationAPI::Models::WordlistRetrieveResponse] - # - # @see ModerationAPI::Models::WordlistRetrieveParams - def retrieve(id, params = {}) - @client.request( - method: :get, - path: ["wordlist/%1$s", id], - model: ModerationAPI::Models::WordlistRetrieveResponse, - options: params[:request_options] - ) - end - - # Some parameter documentations has been truncated, see - # {ModerationAPI::Models::WordlistUpdateParams} for more details. - # - # Update a wordlist - # - # @overload update(id, description: nil, key: nil, name: nil, strict: nil, words: nil, request_options: {}) - # - # @param id [String] ID of the wordlist to update - # - # @param description [String] New description for the wordlist - # - # @param key [String] New key for the wordlist - # - # @param name [String] New name for the wordlist - # - # @param strict [Boolean] Deprecated. Now using threshold in project settings. - # - # @param words [Array] New words for the wordlist. Replace the existing words with these new ones. Dupl - # - # @param request_options [ModerationAPI::RequestOptions, Hash{Symbol=>Object}, nil] - # - # @return [ModerationAPI::Models::WordlistUpdateResponse] - # - # @see ModerationAPI::Models::WordlistUpdateParams - def update(id, params = {}) - parsed, options = ModerationAPI::WordlistUpdateParams.dump_request(params) - @client.request( - method: :put, - path: ["wordlist/%1$s", id], - body: parsed, - model: ModerationAPI::Models::WordlistUpdateResponse, - options: options - ) - end - - # List all wordlists for the authenticated organization - # - # @overload list(request_options: {}) - # - # @param request_options [ModerationAPI::RequestOptions, Hash{Symbol=>Object}, nil] - # - # @return [Array] - # - # @see ModerationAPI::Models::WordlistListParams - def list(params = {}) - @client.request( - method: :get, - path: "wordlist", - model: ModerationAPI::Internal::Type::ArrayOf[ModerationAPI::Models::WordlistListResponseItem], - options: params[:request_options] - ) - end - - # Get the current embedding progress status for a wordlist - # - # @overload get_embedding_status(id, request_options: {}) - # - # @param id [String] ID of the wordlist to check embedding status for - # - # @param request_options [ModerationAPI::RequestOptions, Hash{Symbol=>Object}, nil] - # - # @return [ModerationAPI::Models::WordlistGetEmbeddingStatusResponse] - # - # @see ModerationAPI::Models::WordlistGetEmbeddingStatusParams - def get_embedding_status(id, params = {}) - @client.request( - method: :get, - path: ["wordlist/%1$s/embedding-status", id], - model: ModerationAPI::Models::WordlistGetEmbeddingStatusResponse, - options: params[:request_options] - ) - end - - # @api private - # - # @param client [ModerationAPI::Client] - def initialize(client:) - @client = client - @words = ModerationAPI::Resources::Wordlist::Words.new(client: client) - end - end - end -end diff --git a/lib/moderation_api/resources/wordlist/words.rb b/lib/moderation_api/resources/wordlist/words.rb deleted file mode 100644 index 90b0b4c7..00000000 --- a/lib/moderation_api/resources/wordlist/words.rb +++ /dev/null @@ -1,65 +0,0 @@ -# frozen_string_literal: true - -module ModerationAPI - module Resources - class Wordlist - class Words - # Add words to an existing wordlist - # - # @overload add(id, words:, request_options: {}) - # - # @param id [String] ID of the wordlist to add words to - # - # @param words [Array] Array of words to add to the wordlist. Duplicate words will be ignored. - # - # @param request_options [ModerationAPI::RequestOptions, Hash{Symbol=>Object}, nil] - # - # @return [ModerationAPI::Models::Wordlist::WordAddResponse] - # - # @see ModerationAPI::Models::Wordlist::WordAddParams - def add(id, params) - parsed, options = ModerationAPI::Wordlist::WordAddParams.dump_request(params) - @client.request( - method: :post, - path: ["wordlist/%1$s/words", id], - body: parsed, - model: ModerationAPI::Models::Wordlist::WordAddResponse, - options: options - ) - end - - # Remove words from an existing wordlist - # - # @overload remove(id, words:, request_options: {}) - # - # @param id [String] ID of the wordlist to remove words from - # - # @param words [Array] Array of words to remove from the wordlist - # - # @param request_options [ModerationAPI::RequestOptions, Hash{Symbol=>Object}, nil] - # - # @return [ModerationAPI::Models::Wordlist::WordRemoveResponse] - # - # @see ModerationAPI::Models::Wordlist::WordRemoveParams - def remove(id, params) - parsed, options = ModerationAPI::Wordlist::WordRemoveParams.dump_request(params) - query = ModerationAPI::Internal::Util.encode_query_params(parsed) - @client.request( - method: :delete, - path: ["wordlist/%1$s/words", id], - query: query, - model: ModerationAPI::Models::Wordlist::WordRemoveResponse, - options: options - ) - end - - # @api private - # - # @param client [ModerationAPI::Client] - def initialize(client:) - @client = client - end - end - end - end -end diff --git a/lib/moderation_api/sdk_hooks/hooks.rb b/lib/moderation_api/sdk_hooks/hooks.rb new file mode 100644 index 00000000..bdd74480 --- /dev/null +++ b/lib/moderation_api/sdk_hooks/hooks.rb @@ -0,0 +1,97 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +require_relative "./types" + +module ModerationApi + module SDKHooks + class Hooks + extend T::Sig + + sig { void } + def initialize + @sdk_init_hooks = T.let([], T::Array[AbstractSDKHook]) + @before_request_hooks = T.let([], T::Array[AbstractSDKHook]) + @after_success_hooks = T.let([], T::Array[AbstractSDKHook]) + @after_error_hooks = T.let([], T::Array[AbstractSDKHook]) + end + + sig { params(hook: AbstractSDKHook).void } + def register_sdk_init_hook(hook) + @sdk_init_hooks << hook + end + + sig { params(hook: AbstractSDKHook).void } + def register_before_request_hook(hook) + @before_request_hooks << hook + end + + sig { params(hook: AbstractSDKHook).void } + def register_after_success_hook(hook) + @after_success_hooks << hook + end + + sig { params(hook: AbstractSDKHook).void } + def register_after_error_hook(hook) + @after_error_hooks << hook + end + + sig { params(config: SDKConfiguration).returns(SDKConfiguration) } + def sdk_init(config:) + @sdk_init_hooks.each do |hook| + config = hook.sdk_init(config: config) + end + + return config + end + + sig do + params( + hook_ctx: BeforeRequestHookContext, + request: Faraday::Request + ) + .returns(Faraday::Request) + end + def before_request(hook_ctx:, request:) + @before_request_hooks.each do |hook| + request = hook.before_request(hook_ctx: hook_ctx, request: request) + end + + request + end + + sig do + params( + hook_ctx: AfterSuccessHookContext, + response: Faraday::Response + ) + .returns(Faraday::Response) + end + def after_success(hook_ctx:, response:) + @after_success_hooks.each do |hook| + response = hook.after_success(hook_ctx: hook_ctx, response: response) + end + + response + end + + sig do + params( + error: T.nilable(StandardError), + hook_ctx: AfterErrorHookContext, + response: T.nilable(Faraday::Response) + ) + .returns(T.nilable(Faraday::Response)) + end + def after_error(error:, hook_ctx:, response:) + @after_error_hooks.each do |hook| + response = hook.after_error(error: error, hook_ctx: hook_ctx, response: response) + end + + response + end + end + end +end diff --git a/lib/moderation_api/sdk_hooks/types.rb b/lib/moderation_api/sdk_hooks/types.rb new file mode 100644 index 00000000..e5681c79 --- /dev/null +++ b/lib/moderation_api/sdk_hooks/types.rb @@ -0,0 +1,180 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +require_relative "../sdkconfiguration" + +module ModerationApi + module SDKHooks + class HookContext + extend T::Sig + + sig { returns(SDKConfiguration) } + attr_accessor :config + + sig { returns(String) } + attr_accessor :base_url + + sig { returns(T.nilable(T::Array[String])) } + attr_accessor :oauth2_scopes + + sig { returns(String) } + attr_accessor :operation_id + + sig { returns(T.nilable(T.proc.returns(T.untyped))) } + attr_accessor :security_source + + sig do + params( + config: SDKConfiguration, + base_url: String, + oauth2_scopes: T.nilable(T::Array[String]), + operation_id: String, + security_source: T.nilable(T.proc.returns(T.untyped)) + ) + .void + end + def initialize(config:, base_url:, oauth2_scopes:, operation_id:, security_source:) + @config = T.let(config, SDKConfiguration) + @base_url = T.let(base_url, String) + @oauth2_scopes = T.let(oauth2_scopes, T.nilable(T::Array[String])) + @operation_id = T.let(operation_id, String) + @security_source = T.let(security_source, T.nilable(T.proc.returns(T.untyped))) + end + end + + class BeforeRequestHookContext < HookContext + extend T::Sig + + sig do + params( + hook_ctx: HookContext + ) + .void + end + def initialize(hook_ctx:) + super( + config: hook_ctx.config, + base_url: hook_ctx.base_url, + operation_id: hook_ctx.operation_id, + oauth2_scopes: hook_ctx.oauth2_scopes, + security_source: hook_ctx.security_source + ) + end + end + + class AfterSuccessHookContext < HookContext + extend T::Sig + + sig do + params( + hook_ctx: HookContext + ) + .void + end + def initialize(hook_ctx:) + super( + config: hook_ctx.config, + base_url: hook_ctx.base_url, + operation_id: hook_ctx.operation_id, + oauth2_scopes: hook_ctx.oauth2_scopes, + security_source: hook_ctx.security_source + ) + end + end + + class AfterErrorHookContext < HookContext + extend T::Sig + + sig do + params( + hook_ctx: HookContext + ) + .void + end + def initialize(hook_ctx:) + super( + config: hook_ctx.config, + base_url: hook_ctx.base_url, + operation_id: hook_ctx.operation_id, + oauth2_scopes: hook_ctx.oauth2_scopes, + security_source: hook_ctx.security_source + ) + end + end + + module AbstractSDKInitHook + extend T::Sig + extend T::Helpers + abstract! + + sig { overridable.params(config: SDKConfiguration).returns(SDKConfiguration) } + def sdk_init(config:) + Kernel.raise NotImplementedError.new + end + end + + module AbstractBeforeRequestHook + extend T::Sig + extend T::Helpers + abstract! + + sig do + overridable + .params( + hook_ctx: BeforeRequestHookContext, + request: Faraday::Request + ) + .returns(Faraday::Request) + end + def before_request(hook_ctx:, request:) + Kernel.raise NotImplementedError.new + end + end + + module AbstractAfterSuccessHook + extend T::Sig + extend T::Helpers + abstract! + + sig do + overridable + .params( + hook_ctx: AfterSuccessHookContext, + response: Faraday::Response + ) + .returns(Faraday::Response) + end + def after_success(hook_ctx:, response:) + Kernel.raise NotImplementedError.new + end + end + + module AbstractAfterErrorHook + extend T::Sig + extend T::Helpers + abstract! + + sig do + overridable + .params( + error: T.nilable(StandardError), + hook_ctx: AfterErrorHookContext, + response: T.nilable(Faraday::Response) + ) + .returns(T.nilable(Faraday::Response)) + end + def after_error(error:, hook_ctx:, response:) + Kernel.raise NotImplementedError.new + end + end + + class AbstractSDKHook + include AbstractSDKInitHook + include AbstractBeforeRequestHook + include AbstractAfterSuccessHook + include AbstractAfterErrorHook + end + end +end diff --git a/lib/moderation_api/sdkconfiguration.rb b/lib/moderation_api/sdkconfiguration.rb new file mode 100644 index 00000000..339e54f5 --- /dev/null +++ b/lib/moderation_api/sdkconfiguration.rb @@ -0,0 +1,108 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +require "faraday" +require "faraday/multipart" +require "faraday/retry" +require "sorbet-runtime" + +require_relative "sdk_hooks/hooks" +require_relative "utils/retries" + +module ModerationApi + extend T::Sig + + SERVERS = T.let( + [ + "https://moderationapi.com/api/v1" + ].freeze, + T::Array[String] + ) + # Contains the list of servers available to the SDK + + class SDKConfiguration + extend T::Sig + + sig { returns(T.nilable(Faraday::Connection)) } + attr_accessor :client + + sig { returns(::ModerationApi::SDKHooks::Hooks) } + attr_accessor :hooks + + sig { returns(T.nilable(::ModerationApi::Utils::RetryConfig)) } + attr_accessor :retry_config + + sig { returns(T.nilable(Float)) } + attr_accessor :timeout + + sig { returns(T.nilable(T.proc.returns(T.nilable(Models::Components::Security)))) } + attr_accessor :security_source + + sig { returns(T.nilable(String)) } + attr_accessor :server_url + + sig { returns(T.nilable(Integer)) } + attr_accessor :server_idx + + sig { returns(String) } + attr_accessor :language + + sig { returns(String) } + attr_accessor :openapi_doc_version + + sig { returns(String) } + attr_accessor :sdk_version + + sig { returns(String) } + attr_accessor :gen_version + + sig { returns(String) } + attr_accessor :user_agent + + sig do + params( + client: T.nilable(Faraday::Connection), + hooks: ::ModerationApi::SDKHooks::Hooks, + retry_config: T.nilable(::ModerationApi::Utils::RetryConfig), + timeout_ms: T.nilable(Integer), + secret_key: T.nilable(::String), + security_source: T.nilable(T.proc.returns(Models::Components::Security)), + server_url: T.nilable(String), + server_idx: T.nilable(Integer) + ) + .void + end + def initialize(client, hooks, retry_config, timeout_ms, secret_key, security_source, server_url, server_idx) + @client = client + @hooks = hooks + @retry_config = retry_config + @server_url = server_url + @timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil? + @server_idx = server_idx.nil? ? 0 : server_idx + if @server_idx.negative? || @server_idx >= SERVERS.length + raise StandardError, "Invalid server index #{server_idx}" + end + + if !security_source.nil? + @security_source = security_source + elsif !secret_key.nil? + @security_source = -> { Models::Components::Security.new(secret_key: secret_key) } + end + + @language = "ruby" + @openapi_doc_version = "1.1.0" + @sdk_version = "3.0.0" + @gen_version = "internal" + @user_agent = "speakeasy-sdk/ruby 3.0.0 internal 1.1.0 moderation_api" + end + + sig { returns([String, T::Hash[Symbol, String]]) } + def get_server_details + return [@server_url.delete_suffix("/"), {}] if !@server_url.nil? + @server_idx = T.must(@server_idx) + [T.must(SERVERS[@server_idx]), {}] + end + end +end diff --git a/lib/moderation_api/sdkconfiguration.rbi b/lib/moderation_api/sdkconfiguration.rbi new file mode 100644 index 00000000..450c2913 --- /dev/null +++ b/lib/moderation_api/sdkconfiguration.rbi @@ -0,0 +1,83 @@ +# typed: true + +class ModerationApi::SDKConfiguration + extend ::Crystalline::MetadataFields::ClassMethods + + def client + end + + def client=(client) + end + + def gen_version + end + + def gen_version=(gen_version) + end + + def hooks + end + + def hooks=(hooks) + end + + def language + end + + def language=(language) + end + + def openapi_doc_version + end + + def openapi_doc_version=(openapi_doc_version) + end + + def retry_config + end + + def retry_config=(retry_config) + end + + def sdk_version + end + + def sdk_version=(sdk_version) + end + + def security_source + end + + def security_source=(security_source) + end + + def server_idx + end + + def server_idx=(server_idx) + end + + def server_params + end + + def server_params=(server_params) + end + + def server_url + end + + def server_url=(server_url) + end + + def timeout + end + + def timeout=(timeout) + end + + def user_agent + end + + def user_agent=(user_agent) + end +end diff --git a/lib/moderation_api/utils/forms.rb b/lib/moderation_api/utils/forms.rb new file mode 100644 index 00000000..193c8bc5 --- /dev/null +++ b/lib/moderation_api/utils/forms.rb @@ -0,0 +1,232 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +require "cgi" +require "date" +require "base64" +require "sorbet-runtime" + +module ModerationApi + module Utils + extend T::Sig + + sig do + params( + field_name: String, + explode: T::Boolean, + obj: Object, + delimiter: String, + get_field_name_lambda: T.proc.params(obj_field: ::Crystalline::MetadataFields::Field).returns(String) + ) + .returns(T::Hash[String, T::Array[String]]) + end + def self._populate_form(field_name, explode, obj, delimiter, &get_field_name_lambda) + params = {} + + return params if obj.nil? + + if obj.respond_to?(:fields) + items = [] + T.unsafe(obj).fields.each do |obj_field| + obj_field_name = get_field_name_lambda.call(obj_field) + next if obj_field_name == "" + + val = obj.send(obj_field.name.to_sym) + next if val.nil? + + if explode + params[obj_field_name] = [val_to_string(val)] + else + items.append("#{obj_field_name}#{delimiter}#{val_to_string(val)}") + end + end + + params[field_name] = [items.join(delimiter)] if !items.empty? + elsif obj.is_a?(Hash) + items = [] + obj.each do |key, value| + next if value.nil? + + if explode + params[key] = val_to_string(value) + else + items.append("#{key}#{delimiter}#{val_to_string(value)}") + end + end + + params[field_name] = [items.join(delimiter)] if !items.empty? + + elsif obj.is_a?(Array) + items = [] + obj.each do |value| + next if value.nil? + + if explode + params[field_name] = [] if !params.key?(field_name) + + params[field_name].append(val_to_string(value)) + else + items.append(val_to_string(value)) + end + end + + params[field_name] = items.map(&:to_s).join(delimiter) if !items.empty? + + else + params[field_name] = val_to_string(obj) + end + + params + end + + sig { + params(media_type: String, request: Object).returns( + [String, Object, T::Array[T::Array[T.any(T::Array[T.nilable(String)], String)]]] + ) + } + def self.serialize_multipart_form(media_type, request) + form = [] + T.unsafe(request).fields.each do |field| + val = request.send(field.name) + next if val.nil? + + field_metadata = field.metadata[:multipart_form] + next if field_metadata.nil? + + if field_metadata[:file] == true + field_name = field_metadata[:field_name] + + # Handle arrays of files + if val.is_a?(Array) + val.each do |file_obj| + file_name = T.let("", String) + content = nil + + T.must(file_obj).fields.each do |file_field| + file_metadata = file_field.metadata[:multipart_form] + next if file_metadata.nil? + + if file_metadata[:content] == true + content = T.let(file_obj.send(file_field.name), String) + else + file_name = T.let(file_obj.send(file_field.name), String) + end + end + + if T.unsafe(file_name) == "" || T.unsafe(content).nil? + raise StandardError, "invalid multipart/form-data file" + end + + form.append([field_name, [file_name, content]]) + end + else + # Handle single file + file_name = T.let("", String) + content = nil + + T.must(val).fields.each do |file_field| + file_metadata = file_field.metadata[:multipart_form] + next if file_metadata.nil? + + if file_metadata[:content] == true + content = T.let(val.send(file_field.name), String) + else + file_name = T.let(val.send(file_field.name), String) + end + end + + if T.unsafe(file_name) == "" || T.unsafe(content).nil? + raise StandardError, "invalid multipart/form-data file" + end + + form.append([field_name, [file_name, content]]) + end + elsif field_metadata[:json] == true + to_append = [ + field_metadata.fetch(:field_name, field.name), + [ + nil, + ::Crystalline.to_json(val), + "application/json" + ] + ] + form.append(to_append) + else + field_name = field_metadata.fetch( + :field_name, + field.name + ) + if val.is_a?(Array) + val.each do |value| + next if value.nil? + + form.append( + [field_name, [nil, val_to_string(value)]] + ) + end + else + form.append([field_name, [nil, val_to_string(val)]]) + end + end + end + + [media_type, nil, form] + end + + sig do + params(data: T.any(Object, T::Hash[String, String])) + .returns(T::Hash[T.any(String, Symbol), Object]) + end + def self.serialize_form_data(data) + get_form_field_name = lambda do |obj_field| + obj_param_metadata = obj_field.metadata[:form] + + return T.let({}, T::Hash[T.any(String, Symbol), Object]) if obj_param_metadata.nil? + + return obj_param_metadata.fetch(:field_name, obj_field.name) + end + + form = T.let({}, T::Hash[T.any(String, Symbol), Object]) + if data.respond_to?(:fields) + T.unsafe(data).fields.each do |field| + val = data.send(field.name) + next if val.nil? + + metadata = field.metadata[:form] + + next if metadata.nil? + + field_name = metadata.fetch(:field_name, field.name) + + if metadata[:json] + form[field_name] = ::Crystalline.to_json(val) + else + if metadata.fetch(:style, "form") == "form" + form = form.merge( + _populate_form( + field_name, + metadata.fetch(:explode, true), + val, + ",", + &get_form_field_name + ) + ) + else + raise StandardError, "Invalid form style for field #{field.name}" + end + end + end + elsif data.is_a?(Hash) + data.each do |key, value| + form[key] = [val_to_string(value)] + end + else + raise StandardError, "Invalid request body type #{data.class}" + end + + form + end + end +end diff --git a/lib/moderation_api/utils/headers.rb b/lib/moderation_api/utils/headers.rb new file mode 100644 index 00000000..89d88b96 --- /dev/null +++ b/lib/moderation_api/utils/headers.rb @@ -0,0 +1,82 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +require "cgi" +require "date" +require "base64" +require "sorbet-runtime" + +module ModerationApi + module Utils + extend T::Sig + + sig { + params(headers_params: Object, gbls: T.nilable(T::Hash[Symbol, T::Hash[Symbol, T::Hash[Symbol, Object]]])).returns( + T::Hash[Symbol, String] + ) + } + def self.get_headers(headers_params, gbls = nil) + return {} if headers_params.nil? + + headers = {} + T.unsafe(headers_params).fields.each do |f| + metadata = f.metadata[:header] + next if metadata.nil? + + value = _populate_from_globals(f.name, headers_params&.send(f.name), "header", gbls) + value = _serialize_header(metadata.fetch(:explode, false), value) + headers[metadata.fetch(:field_name, f.name)] = value if !T.must(value).empty? + end + + headers + end + + sig { params(explode: T::Boolean, obj: Object).returns(T.nilable(String)) } + def self._serialize_header(explode, obj) + return "" if obj.nil? + + if obj.respond_to?(:fields) + items = [] + T.unsafe(obj).fields.each do |obj_field| + obj_param_metadata = obj_field.metadata[:header] + next if obj_param_metadata.nil? + + obj_field_name = obj_param_metadata.fetch(:field_name, obj_field.name) + next if obj_field_name == "" + + val = obj.send(obj_field.name) + next if val.nil? + + if explode + items.append("#{obj_field_name}=#{val_to_string(val)}") + else + items.append(obj_field_name) + items.append(val_to_string(val)) + end + end + + items.join(",") if !items.empty? + elsif obj.is_a?(Hash) + items = [] + obj.each do |key, value| + next if value.nil? + + if explode + items.append("#{key}=#{val_to_string(value)}") + else + items.append(key) + items.append(val_to_string(value)) + end + end + + items.join(",") if !items.empty? + elsif obj.is_a?(Array) + items = obj.filter { |v| !v.nil? }.map { |v| val_to_string(v) }.join(",") + else + val_to_string(obj) + end + end + end +end diff --git a/lib/moderation_api/utils/query_params.rb b/lib/moderation_api/utils/query_params.rb new file mode 100644 index 00000000..e81f8ade --- /dev/null +++ b/lib/moderation_api/utils/query_params.rb @@ -0,0 +1,167 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +require "date" +require "base64" +require "sorbet-runtime" + +module ModerationApi + module Utils + extend T::Sig + + sig { + params( + clazz: Object, + query_params: Object, + url_override: T.nilable(::String), + gbls: T.nilable(T::Hash[Symbol, T::Hash[Symbol, T::Hash[Symbol, Object]]]) + ) + .returns(T::Hash[T.any(String, Symbol), T::Array[String]]) + } + def self.get_query_params(clazz, query_params, url_override = nil, gbls = nil) + parsed_params = T.let({}, T::Hash[T.any(String, Symbol), T::Array[String]]) + if !url_override.nil? + parsed_url = URI.parse(url_override) + URI.decode_www_form(parsed_url.query.to_s).each do |key, value| + parsed_params[key] ||= [] + T.must(parsed_params[key]) << value + end + end + + params = T.let({}, T::Hash[T.any(String, Symbol), T::Array[String]]) + T.unsafe(clazz).fields.each do |f| + request_metadata = f.metadata[:request] + next if !request_metadata.nil? + + metadata = f.metadata[:query_param] + next if metadata.nil? + + param_name = f.name + value = query_params&.send(param_name.to_sym) + value = _populate_from_globals(param_name, value, "queryParam", gbls) + + f_name = metadata[:field_name] + serialization = metadata.fetch(:serialization, "") + if serialization != "" + params = params.merge( + _get_serialized_params( + metadata, + f_name, + value + ) + ) + else + style = metadata.fetch(:style, "form") + case style + when "deepObject" + params = params.merge( + _get_deep_object_query_params( + metadata, + f_name, + value + ) + ) + when "form" + params = params.merge( + _get_delimited_query_params( + metadata, + f_name, + value, + "," + ) + ) + when "pipeDelimited" + params = params.merge( + _get_delimited_query_params( + metadata, + f_name, + value, + "|" + ) + ) + else + raise StandardError, "not yet implemented" + end + end + end + + params.merge(parsed_params) + end + + sig do + params(metadata: T::Hash[Symbol, String], field_name: String, obj: Object) + .returns(T::Hash[T.any(String, Symbol), T::Array[String]]) + end + def self._get_deep_object_query_params(metadata, field_name, obj) + params = T.let({}, T::Hash[T.any(String, Symbol), T::Array[String]]) + + return params if obj.nil? + + if obj.respond_to?(:fields) + T.unsafe(obj).fields.each do |obj_field| + obj_param_metadata = obj_field.metadata[:query_param] + next if obj_param_metadata.nil? + + val = obj.send(obj_field.name) + next if val.nil? + + key = "#{metadata.fetch(:field_name, field_name)}[#{obj_param_metadata.fetch(:field_name, obj_field.name)}]" + if val.is_a?(Array) + val.each do |v| + next if v.nil? + + params[key] = [] if !params.include?(key) + + T.must(params[key]) << val_to_string(v) + end + else + params[key] = [val_to_string(val)] + end + end + elsif obj.is_a?(Hash) + obj.each do |key, value| + next if value.nil? + + param_key = "#{metadata.fetch(:field_name, field_name)}[#{key}]" + if value.is_a?(Array) + value.each do |val| + next if val.nil? + + params[param_key] = [] if !params.include?(param_key) + + T.must(params[param_key]).append(val_to_string(val)) + end + else + params[param_key] = [val_to_string(value)] + end + end + end + + params + end + + sig do + params(metadata: T::Hash[Symbol, String], field_name: String, obj: Object, delimiter: String) + .returns(T::Hash[T.any(String, Symbol), T::Array[String]]) + end + def self._get_delimited_query_params(metadata, field_name, obj, delimiter) + get_query_param_field_name = lambda do |obj_field| + obj_param_metadata = obj_field.metadata[:query_param] + + return {} if obj_param_metadata.nil? + + return obj_param_metadata.fetch(:field_name, obj_field.name) + end + + _populate_form( + field_name, + T.cast(metadata.fetch(:explode, true), T::Boolean), + obj, + delimiter, + &get_query_param_field_name + ) + end + end +end diff --git a/lib/moderation_api/utils/request_bodies.rb b/lib/moderation_api/utils/request_bodies.rb new file mode 100644 index 00000000..a7e527c4 --- /dev/null +++ b/lib/moderation_api/utils/request_bodies.rb @@ -0,0 +1,79 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +require "cgi" +require "date" +require "base64" +require "sorbet-runtime" + +module ModerationApi + module Utils + extend T::Sig + + SERIALIZATION_METHOD_TO_CONTENT_TYPE = { + 'json': "application/json", + 'form': "application/x-www-form-urlencoded", + 'multipart': "multipart/form-data", + 'raw': "application/octet-stream", + 'string': "text/plain" + }.freeze + + sig do + params( + request: Object, + nullable: T::Boolean, + optional: T::Boolean, + request_field_name: Symbol, + serialization_method: Symbol + ) + .returns([String, Object, T.nilable(T::Array[T::Array[T.any(T::Array[T.nilable(String)], String)]])]) + end + def self.serialize_request_body(request, nullable, optional, request_field_name, serialization_method) + return ["", nil, nil] if request.nil? && !nullable && optional + + if !request.respond_to?(:fields) || !request.respond_to?(request_field_name) + return serialize_content_type(SERIALIZATION_METHOD_TO_CONTENT_TYPE[serialization_method], request) + end + + request_metadata = T.let(nil, T.nilable(T::Array[T::Array[T.any(T::Array[T.nilable(String)], String)]])) + T.unsafe(request).fields.each do |f| + if f.name == request_field_name + request_metadata = f.metadata[:request] + break + end + end + + if request_metadata.nil? + # Field name collision: model has a field matching request_field_name but without :request metadata. + # Serialize the entire object as the request body. + return serialize_content_type(SERIALIZATION_METHOD_TO_CONTENT_TYPE[serialization_method], request) + end + + request_val = request.send(request_field_name) + return ["", nil, nil] if request_val.nil? + + serialize_content_type( + request_metadata.fetch(:media_type, "application/octet-stream"), + request_val + ) + end + + sig do + params(media_type: String, request: Object) + .returns([String, Object, T.nilable(T::Array[T::Array[T.any(T::Array[T.nilable(String)], String)]])]) + end + def self.serialize_content_type(media_type, request) + if media_type.match("^(application|text)\\/([^+]+\\+)*json.*") + return media_type, ::Crystalline.to_json(request), nil + end + + return serialize_multipart_form(media_type, request) if media_type.match("^multipart\\/.*") + return media_type, serialize_form_data(request), nil if media_type.match("^application\\/x-www-form-urlencoded.*") + return media_type, request, nil if request.is_a?(String) || request.is_a?(Array) + + raise StandardError, "invalid request body type #{request.class} for mediaType #{media_type}" + end + end +end diff --git a/lib/moderation_api/utils/retries.rb b/lib/moderation_api/utils/retries.rb new file mode 100644 index 00000000..3dc5f685 --- /dev/null +++ b/lib/moderation_api/utils/retries.rb @@ -0,0 +1,139 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +require "faraday/retry" +require "time" +require "sorbet-runtime" + +module ModerationApi + module Utils + class BackoffStrategy + extend T::Sig + + sig { returns(T.nilable(::Float)) } + attr_accessor :exponent + + sig { returns(T.nilable(::Integer)) } + attr_accessor :initial_interval + + sig { returns(T.nilable(::Integer)) } + attr_accessor :max_elapsed_time + + sig { returns(T.nilable(::Integer)) } + attr_accessor :max_interval + + sig do + params( + exponent: T.nilable(::Float), + initial_interval: T.nilable(::Integer), + max_elapsed_time: T.nilable(::Integer), + max_interval: T.nilable(::Integer) + ) + .void + end + def initialize(exponent: nil, initial_interval: nil, max_elapsed_time: nil, max_interval: nil) + @exponent = T.let(exponent, T.nilable(::Float)) + @initial_interval = T.let(initial_interval, T.nilable(::Integer)) + @max_elapsed_time = T.let(max_elapsed_time, T.nilable(::Integer)) + @max_interval = T.let(max_interval, T.nilable(::Integer)) + end + end + + class RetryConfig + extend T::Sig + + sig { returns(T.nilable(BackoffStrategy)) } + attr_accessor :backoff + + sig { returns(T.nilable(T::Boolean)) } + attr_accessor :retry_connection_errors + + sig { returns(T.nilable(::String)) } + attr_accessor :strategy + + sig do + params( + backoff: T.nilable(BackoffStrategy), + retry_connection_errors: T.nilable(T::Boolean), + strategy: T.nilable(::String) + ) + .void + end + def initialize(backoff: nil, retry_connection_errors: nil, strategy: nil) + @backoff = T.let(backoff, T.nilable(BackoffStrategy)) + @retry_connection_errors = T.let(retry_connection_errors, T.nilable(T::Boolean)) + @strategy = T.let(strategy, T.nilable(::String)) + end + + sig { params(initial_time: ::Time).returns(::Hash) } + def to_faraday_retry_options(initial_time:) + retry_options = { + # must overwrite default max of 2 retries and it must be positive + max: 1_000_000_000, + # ensure all HTTP methods are retried, especially via retry_if + methods: [] + } + + if @retry_connection_errors + retry_options[:exceptions] = Faraday::Retry::Middleware::DEFAULT_EXCEPTIONS + [Faraday::ConnectionFailed] + end + + if @strategy == "backoff" && @backoff + retry_options[:backoff_factor] = @backoff.exponent unless @backoff.exponent.nil? + retry_options[:interval] = (@backoff.initial_interval.to_f / 1000) unless @backoff.initial_interval.nil? + retry_options[:max_interval] = (@backoff.max_interval.to_f / 1000) unless @backoff.max_interval.nil? + + unless @backoff.max_elapsed_time.nil? + stop_time = initial_time + (@backoff.max_elapsed_time.to_f / 1000) + retry_options[:retry_if] = -> (_env, _exc) { Time.now < stop_time } + end + + end + + retry_options + end + end + + class RetryMiddleware < Faraday::Retry::Middleware + extend T::Sig + + sig { params(retries: T.untyped, env: T.untyped).returns(T.untyped) } + def calculate_sleep_amount(retries, env) + retry_after = [calculate_retry_after(env), calculate_rate_limit_reset(env)].compact.max + retry_interval = calculate_retry_interval(retries) + return retry_interval if retry_after.nil? + + # unlike the stock middleware, cap server delays at max_interval rather + # than abandoning the retry + [[retry_after, @options.max_interval].min, retry_interval].max + end + + private + + sig { params(env: T.untyped).returns(T.untyped) } + def calculate_retry_after(env) + response_headers = env[:response_headers] + return unless response_headers + + ms_value = response_headers["retry-after-ms"] + return ms_value.to_f / 1000 if ms_value&.match?(/\A\s*\d+\s*\z/) + + value = response_headers["retry-after"] + return if value.nil? || value.strip.empty? + return value.to_f if value.match?(/\A\s*\d+\s*\z/) + + begin + Time.httpdate(value) - Time.now + rescue ArgumentError + begin + Time.iso8601(value) - Time.now + rescue ArgumentError + nil + end + end + end + end + end +end diff --git a/lib/moderation_api/utils/security.rb b/lib/moderation_api/utils/security.rb new file mode 100644 index 00000000..3ddc19c7 --- /dev/null +++ b/lib/moderation_api/utils/security.rb @@ -0,0 +1,158 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +require "cgi" +require "date" +require "base64" +require "sorbet-runtime" + +module ModerationApi + module Utils + extend T::Sig + + sig { params(req: Faraday::Request, security: Object, allowed_fields: T.nilable(T::Array[Symbol])).void } + def self.configure_request_security(req, security, allowed_fields = nil) + return if security.nil? + + sec_fields = if allowed_fields.nil? + T.unsafe(security).fields + else + allowed_fields.filter_map { |name| T.unsafe(security).fields.find { |f| f.name == name } } + end + + sec_fields.each do |sec_field| + value = security.send(sec_field.name) + next if value.nil? + + metadata = sec_field.metadata[:security] + next if metadata.nil? + + if metadata[:option] + _parse_security_option(req, value) + break unless metadata[:composite] + end + + next unless metadata[:scheme] + + # Special case for basic auth which could be a flattened struct + if metadata[:sub_type] == "basic" && !value.respond_to?(:fields) + _parse_security_scheme(req, metadata, security) + else + _parse_security_scheme(req, metadata, value) + end + + break unless metadata[:composite] + end + end + + sig { params(req: Faraday::Request, option: Object).void } + def self._parse_security_option(req, option) + # Check if this option uses basic auth (needs the whole object, not individual fields) + first_field = T.unsafe(option).fields.first + if first_field + first_meta = first_field.metadata[:security] + if first_meta && first_meta[:type] == "http" && first_meta[:sub_type] == "basic" + _parse_security_scheme(req, first_meta, option) + return + end + end + + T.unsafe(option).fields.each do |opt_field| + metadata = opt_field.metadata[:security] + next if metadata.nil? || !metadata.include?(:scheme) + + _parse_security_scheme(req, metadata, option.send(opt_field.name)) + end + end + + sig { params(req: Faraday::Request, scheme_metadata: T::Hash[Symbol, String], scheme: Object).void } + def self._parse_security_scheme(req, scheme_metadata, scheme) + scheme_type = scheme_metadata[:type] + sub_type = scheme_metadata[:sub_type] + + if scheme.respond_to?(:fields) + if scheme_type == "http" && sub_type == "basic" + _parse_basic_auth_scheme(req, scheme) + return + end + + T.unsafe(scheme).fields.each do |field| + metadata = field.metadata[:security] + next if metadata.nil? || metadata[:field_name].nil? + + value = scheme.send(field.name) + _parse_security_scheme_value(req, scheme_metadata, metadata, T.cast(value, String)) + end + else + _parse_security_scheme_value(req, scheme_metadata, scheme_metadata, T.cast(scheme, String)) + end + end + + sig do + params( + req: Faraday::Request, + scheme_metadata: T::Hash[Symbol, String], + security_metadata: T::Hash[Symbol, String], + value: String + ) + .void + end + def self._parse_security_scheme_value(req, scheme_metadata, security_metadata, value) + scheme_type = scheme_metadata[:type] + sub_type = scheme_metadata[:sub_type] + + header_name = security_metadata[:field_name] + + case scheme_type + when "apiKey" + case sub_type + when "header" + req.headers[header_name] = value + when "query" + req.params[header_name] = value + when "cookie" + req.headers["Cookie"][header_name] = value + else + raise StandardError, "not supported" + end + + when "openIdConnect" + req.headers[header_name] = value.downcase.start_with?("bearer ") ? value : "Bearer #{value}" + when "oauth2" + req.headers[header_name] = value.downcase.start_with?("bearer ") ? value : "Bearer #{value}" + when "http" + if sub_type == "bearer" + req.headers[header_name] = value.downcase.start_with?("bearer ") ? value : "Bearer #{value}" + elsif sub_type != "custom" + raise StandardError, "not supported" + end + else + raise StandardError, "not supported" + end + end + + sig { params(req: Faraday::Request, scheme: Object).void } + def self._parse_basic_auth_scheme(req, scheme) + username = T.let("", String) + password = T.let("", String) + + T.unsafe(scheme).fields.each do |scheme_field| + metadata = scheme_field.metadata[:security] + next if metadata.nil? || !metadata.include?(:field_name) + + field_name = metadata[:field_name] + value = scheme.send(scheme_field.name) + + username = T.let(value, String) if field_name == "username" + password = T.let(value, String) if field_name == "password" + end + + data = "#{username}:#{password}".encode + # Use strict_encode, because encode adds newlines after 60 chars + # https://docs.ruby-lang.org/en/3.0/Base64.html#method-i-encode64 + req.headers["Authorization"] = "Basic #{Base64.strict_encode64(data)}" + end + end +end diff --git a/lib/moderation_api/utils/url.rb b/lib/moderation_api/utils/url.rb new file mode 100644 index 00000000..1e8beb6b --- /dev/null +++ b/lib/moderation_api/utils/url.rb @@ -0,0 +1,124 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +require "faraday/retry" +require "sorbet-runtime" + +module ModerationApi + module Utils + sig { + params( + clazz: Object, + server_url: String, + path: String, + path_params: Object, + gbls: T.nilable(T::Hash[Symbol, T::Hash[Symbol, T::Hash[Symbol, Object]]]) + ) + .returns(String) + } + def self.generate_url(clazz, server_url, path, path_params, gbls = nil) + T.unsafe(clazz).fields.each do |f| + param_metadata = f.metadata[:path_param] + next if param_metadata.nil? + + if param_metadata.fetch(:style, "simple") == "simple" + param = path_params.send(f.name) if !path_params.nil? + param = _populate_from_globals(f.name, param, "pathParam", gbls) + end + + f_name = param_metadata.fetch(:field_name, f.name) + serialization = param_metadata.fetch(:serialization, "") + if serialization != "" + serialized_params = _get_serialized_params(param_metadata, f_name, param) + serialized_params.each do |k, v| + path = path.gsub("{#{k}}", v.join(", ")) + end + else + if param.is_a?(Array) + pp_vals = [] + param.each do |pp_val| + pp_vals.append(pp_val.to_s) + end + + path = path.gsub("{#{param_metadata.fetch(:field_name, f.name)}}", pp_vals.join(",")) + elsif param.is_a?(Hash) + pp_vals = [] + param.each do |pp_key, pp_val| + value = val_to_string(pp_val) + + if param_metadata.fetch(:explode, false) + pp_vals.append("#{pp_key}=#{value}") + else + pp_vals.append("#{pp_key},#{value}") + end + end + + path = path.gsub("{#{param_metadata.fetch(:field_name, f.name)}}", pp_vals.join(",")) + elsif param.class.include?(::Crystalline::MetadataFields) + pp_vals = [] + attrs = T + .unsafe(param) + .fields + .filter { |field| field.name && param.respond_to?(field.name.to_sym) } + .map(&:name) + attrs.each do |attr| + field = T.unsafe(param).field(attr) + + param_value_metadata = field.metadata[:path_param] + + next if param_value_metadata.nil? + + parm_name = param_value_metadata.fetch(:field_name, f.name) + + param_field_val = param.send(attr) + + if param_field_val.class.respond_to?(:enums) + param_field_val = param_field_val.serialize + elsif param_field_val.is_a?(DateTime) + param_field_val = param_field_val.strftime("%Y-%m-%dT%H:%M:%S.%NZ") + end + + if !field.nil? && ::Crystalline::Utils.nilable?(field.type) && param_field_val.nil? + next + elsif param_metadata.fetch(:explode, false) + pp_vals.append("#{parm_name}=#{param_field_val}") + else + pp_vals.append("#{parm_name},#{param_field_val}") + end + end + + path = path.gsub("{#{param_metadata.fetch(:field_name, f.name)}}", pp_vals.join(",")) + else + path = path.gsub("{#{param_metadata.fetch(:field_name, f.name)}}", _encode_path_param(val_to_string(param))) + end + end + end + + server_url.delete_suffix("/") + path + end + + # Percent-encode characters that are invalid in URI path segments + sig { params(value: String).returns(String) } + def self._encode_path_param(value) + value.gsub(/[<>{}\[\]|\\^`\s?#%]/) { |c| format("%%%02X", c.ord) } + end + + sig { params(url_with_params: String, params: T::Hash[Symbol, T.any(String, T::Enum)]).returns(String) } + def self.template_url(url_with_params, params) + params.each do |key, value| + if value.class.respond_to?(:enums) + val_str = T.cast(value, T::Enum).serialize + else + val_str = value + end + + url_with_params = url_with_params.gsub("{#{key}}", val_str) + end + + url_with_params + end + + end +end diff --git a/lib/moderation_api/utils/utils.rb b/lib/moderation_api/utils/utils.rb new file mode 100644 index 00000000..d6e996eb --- /dev/null +++ b/lib/moderation_api/utils/utils.rb @@ -0,0 +1,245 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +require "cgi" +require "date" +require "base64" +require "stringio" +require "sorbet-runtime" + +module ModerationApi + module Utils + include Kernel + extend T::Sig + + sig { params(val: Object).returns(String) } + def self.val_to_string(val) + if val.class.respond_to?(:enums) + T.unsafe(val).serialize.to_s + elsif val.is_a?(DateTime) + val.strftime("%Y-%m-%dT%H:%M:%S.%NZ").sub(/(\.\d*[1-9])0+Z\z/, "\\1Z").sub(/\.0+Z\z/, "Z") + else + val.to_s + + end + end + + MIME_TYPES = { + ".json" => "application/json", + ".xml" => "application/xml", + ".pdf" => "application/pdf", + ".zip" => "application/zip", + ".gz" => "application/gzip", + ".csv" => "text/csv", + ".txt" => "text/plain", + ".html" => "text/html", + ".htm" => "text/html", + ".css" => "text/css", + ".js" => "application/javascript", + ".png" => "image/png", + ".jpg" => "image/jpeg", + ".jpeg" => "image/jpeg", + ".gif" => "image/gif", + ".svg" => "image/svg+xml", + ".webp" => "image/webp", + ".mp3" => "audio/mpeg", + ".mp4" => "video/mp4", + ".yaml" => "application/yaml", + ".yml" => "application/yaml" + }.freeze + + sig { params(filename: String).returns(String) } + def self.mime_type_for_filename(filename) + ext = File.extname(filename).downcase + MIME_TYPES.fetch(ext, "application/octet-stream") + end + + sig do + params(metadata: T::Hash[Symbol, String], field_name: String, obj: Object) + .returns(T::Hash[Symbol, T::Array[String]]) + end + def self._get_serialized_params(metadata, field_name, obj) + params = {} + + serialization = metadata.fetch(:serialization, "") + params[metadata.fetch(:field_name, field_name)] = [obj.to_json] if serialization == "json" + + params + end + + sig { params(status: Integer).returns(T::Boolean) } + def self.error_status?(status) + status_major = status / 100 + return true if status_major == 4 + return true if status_major == 5 + + false + end + + sig { params(content_type: String, pattern: String).returns(T::Boolean) } + def self.match_content_type(content_type, pattern) + return true if ["*", "*/*"].include?(pattern) + + # Media types are case-insensitive (RFC 9110 section 8.3.1). + pattern = pattern.strip.downcase + return true if content_type.strip.downcase == pattern + + pieces = content_type.split(";") + pieces.each do |piece| + return true if pattern == piece.strip.downcase + end + + false + end + + sig { params(status_code: Integer, status_codes: T::Array[String]).returns(T::Boolean) } + def self.match_status_code(status_code, status_codes) + return true if status_codes.include?("default") + status_code = status_code.to_s + status_codes.each do |code| + return true if code == status_code + return true if code.downcase.end_with?("xx") && status_code[0] == code[0] + end + + false + end + + sig { params(optional: T::Boolean).returns(T.proc.params(s: String).returns(T.nilable(DateTime))) } + def self.datetime_from_iso_format(optional) + Kernel.lambda do |s| + return nil if optional && s.nil? + + return DateTime.strptime(s, "%Y-%m-%dT%H:%M:%S.%NZ") + end + end + + sig { params(optional: T::Boolean).returns(T.proc.params(s: String).returns(T.nilable(Date))) } + def self.date_from_iso_format(optional) + Kernel.lambda do |s| + return nil if optional && s.nil? + + return Date.iso8601(s) + end + end + + sig do + params(enum_type: T.class_of(T::Enum), optional: T::Boolean) + .returns(T.nilable(T.proc.params(s: String).returns(T.nilable(T::Enum)))) + end + def self.enum_from_string(enum_type, optional) + Kernel.lambda do |s| + return nil if optional && s.nil? + + return enum_type.deserialize(s) + end + end + + sig do + params(enum_type: Module, optional: T::Boolean) + .returns(T.proc.params(s: String).returns(T.untyped)) + end + def self.open_enum_from_string(enum_type, optional) + Kernel.lambda do |s| + return nil if optional && s.nil? + + return T.unsafe(enum_type).deserialize(s) + end + end + + sig { params(name: String).returns(T.proc.returns(String)) } + def self.field_name(name) + T.let(proc { name }, T.proc.returns(String)) + end + + sig { params(field: ::Crystalline::MetadataFields::Field, data_class: Object).returns(Object) } + def self.parse_field(field, data_class) + field_metadata = field.metadata[:metadata_string] + return nil if field_metadata.nil? + + field_value = data_class.send(field.name) + return nil if field_value.nil? + + field_value + end + + sig do + params(form: T::Array[T::Array[T.any(String, T::Array[T.nilable(String)])]]) + .returns(T::Hash[Symbol, Object]) + end + def self.encode_form(form) + payload = {} + form.each do |field_name, field| + field = T.must(field) + if field.length == 2 + if field[0].nil? + # Handle multiple values for the same field name (arrays) + if payload.key?(field_name) + # Convert to array if not already + unless payload[field_name].is_a?(Array) + payload[field_name] = [payload[field_name]] + end + + payload[field_name] << field[1] + else + payload[field_name] = field[1] + end + else + # Handle file uploads + file_part = Faraday::Multipart::FilePart.new( + StringIO.new(T.must(field[1])), + mime_type_for_filename(T.must(field[0])), + field[0] + ) + + # Handle multiple files for the same field name (arrays) + if payload.key?(field_name) + unless payload[field_name].is_a?(Array) + payload[field_name] = [payload[field_name]] + end + + payload[field_name] << file_part + else + payload[field_name] = file_part + end + end + elsif field.length == 3 + param_part = Faraday::Multipart::ParamPart.new(field[1], field[2]) + + # Handle multiple values for the same field name (arrays) + if payload.key?(field_name) + unless payload[field_name].is_a?(Array) + payload[field_name] = [payload[field_name]] + end + + payload[field_name] << param_part + else + payload[field_name] = param_part + end + end + end + + payload + end + + sig { + params( + param_name: Symbol, + value: Object, + param_type: String, + gbls: T.nilable(T::Hash[Symbol, T::Hash[Symbol, T::Hash[Symbol, Object]]]) + ) + .returns(Object) + } + def self._populate_from_globals(param_name, value, param_type, gbls) + if value.nil? && !gbls.nil? + global_value = gbls.dig(:parameters, param_type.to_sym, param_name.to_sym) + value = global_value if !global_value.nil? + end + + value + end + + end +end diff --git a/lib/moderation_api/version.rb b/lib/moderation_api/version.rb deleted file mode 100644 index 0dfb5558..00000000 --- a/lib/moderation_api/version.rb +++ /dev/null @@ -1,5 +0,0 @@ -# frozen_string_literal: true - -module ModerationAPI - VERSION = "2.41.0" -end diff --git a/lib/moderation_api/webhook_signature.rb b/lib/moderation_api/webhook_signature.rb new file mode 100644 index 00000000..2e62ef7f --- /dev/null +++ b/lib/moderation_api/webhook_signature.rb @@ -0,0 +1,55 @@ +# frozen_string_literal: true + +# Verify webhook deliveries from Moderation API. +# +# Every delivery is signed with HMAC-SHA256 over the raw request body, using +# your project's webhook signing secret. The hex-encoded signature is in the +# `modapi-signature` header. +# +# Maintained by hand in moderation-api/sdk-generator (custom/ruby), not generated. + +require "json" +require "openssl" + +module ModerationApi + module WebhookSignature + HEADER = "modapi-signature" + SECRET_ENV_VAR = "MODAPI_WEBHOOK_SECRET" + + # The webhook signature is missing or does not match the payload. + class VerificationError < StandardError; end + + module_function + + # Return the hex HMAC-SHA256 signature for a raw payload. + def compute_signature(payload, secret) + OpenSSL::HMAC.hexdigest("SHA256", secret, payload) + end + + # Return true if signature matches the raw payload. + # secret defaults to the MODAPI_WEBHOOK_SECRET environment variable. + def verify(payload, signature, secret = nil) + secret = ENV.fetch(SECRET_ENV_VAR, nil) if secret.nil? || secret.empty? + return false if signature.nil? || signature.empty? || secret.nil? || secret.empty? + + expected = compute_signature(payload, secret) + given = signature.strip.downcase + return false unless expected.bytesize == given.bytesize + + OpenSSL.fixed_length_secure_compare(expected, given) + end + + # Verify a delivery and return the parsed event (a Hash). + # + # Pass the raw request body exactly as received and the value of the + # `modapi-signature` header. secret defaults to the MODAPI_WEBHOOK_SECRET + # environment variable. + # + # Raises VerificationError when the signature does not match. + def construct_event(payload, signature, secret = nil) + raise VerificationError, "Webhook signature does not match the payload" unless verify(payload, signature, secret) + + JSON.parse(payload) + end + end +end diff --git a/lib/moderation_api/webhooks.rb b/lib/moderation_api/webhooks.rb new file mode 100644 index 00000000..711132fa --- /dev/null +++ b/lib/moderation_api/webhooks.rb @@ -0,0 +1,1164 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +require "faraday" +require "faraday/multipart" +require "faraday/retry" +require "sorbet-runtime" +require "janeway" + +require_relative "sdk_hooks/hooks" +require_relative "utils/retries" + +module ModerationApi + extend T::Sig + + class Webhooks + extend T::Sig + + sig { params(sdk_config: SDKConfiguration).void } + def initialize(sdk_config) + @sdk_configuration = sdk_config + end + + sig { params(base_url: String, url_variables: T.nilable(T::Hash[Symbol, T.any(String, T::Enum)])).returns(String) } + def get_url(base_url:, url_variables: nil) + sd_base_url, sd_options = @sdk_configuration.get_server_details + + if base_url.nil? + base_url = sd_base_url + end + + if url_variables.nil? + url_variables = sd_options + end + + return Utils.template_url(base_url, url_variables) + end + + sig { + params( + page: T.nilable(::Integer), + page_size: T.nilable(::Integer), + timeout_ms: T.nilable(Integer), + http_headers: T.nilable(T::Hash[T.any(String, Symbol), String]) + ) + .returns(Models::Operations::ListWebhooksResponse) + } + def list(page: nil, page_size: nil, timeout_ms: nil, http_headers: nil) + # list - List webhooks + # List the webhooks of the project. The list is paginated. + request = Models::Operations::ListWebhooksRequest.new( + page: page, + page_size: page_size + ) + url, params = @sdk_configuration.get_server_details + base_url = Utils.template_url(url, params) + url = "#{base_url}/webhooks" + headers = {} + headers = T.cast(headers, T::Hash[String, String]) + query_params = Utils.get_query_params(Models::Operations::ListWebhooksRequest, request, nil) + headers["Accept"] = "application/json" + headers["user-agent"] = @sdk_configuration.user_agent + + security = @sdk_configuration.security_source&.call + + timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil? + timeout ||= @sdk_configuration.timeout + + connection = @sdk_configuration.client + + hook_ctx = SDKHooks::HookContext.new( + config: @sdk_configuration, + base_url: base_url, + oauth2_scopes: nil, + operation_id: "listWebhooks", + security_source: @sdk_configuration.security_source + ) + + error = T.let(nil, T.nilable(StandardError)) + http_response = T.let(nil, T.nilable(Faraday::Response)) + + begin + http_response = T.must(connection).get(url) do |req| + req.headers.merge!(headers) + req.options.timeout = timeout unless timeout.nil? + req.params = query_params + Utils.configure_request_security(req, security) + http_headers&.each do |key, value| + req.headers[key.to_s] = value + end + + @sdk_configuration.hooks.before_request( + hook_ctx: SDKHooks::BeforeRequestHookContext.new( + hook_ctx: hook_ctx + ), + request: req + ) + end + + rescue StandardError => e + error = e + ensure + if http_response.nil? || Utils.error_status?(http_response.status) + http_response = @sdk_configuration.hooks.after_error( + error: error, + hook_ctx: SDKHooks::AfterErrorHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + else + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + end + + if http_response.nil? + raise error if !error.nil? + raise "no response" + end + end + + content_type = http_response.headers.fetch("Content-Type", "application/octet-stream") + if Utils.match_status_code(http_response.status, ["200"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Operations::ListWebhooksResponseBody) + response = Models::Operations::ListWebhooksResponse.new( + status_code: http_response.status, + content_type: content_type, + raw_response: http_response, + object: T.unsafe(obj) + ) + sdk = self + + response.next_page = proc do + request_page = T.must(!request.page.nil? ? request.page : 1) + next_page = request_page + 1 + num_pages = Janeway.enum_for("$.pagination.totalPages", JSON.parse(response_data)).search + if num_pages.nil? || num_pages[0] <= request_page + next nil + end + + if !response_data + next nil + end + + results = Janeway.enum_for("$.data", JSON.parse(response_data)).search + if results.is_a?(Array) + results = results[0] + end + + if results.count.zero? + next nil + end + + request_limit = !request.page_size.nil? ? request.page_size : 20 + if results.count < request_limit + next nil + end + + sdk.list( + page: next_page, + page_size: request.page_size, + http_headers: http_headers + ) + end + + return response + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["401"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::AuthenticationError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["429"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::RateLimitError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["4XX"]) + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "API error occurred" + ) + elsif Utils.match_status_code(http_response.status, ["5XX"]) + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "API error occurred" + ) + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown status code received" + ) + + end + end + + sig { + params( + request: Models::Operations::CreateWebhookRequest, + timeout_ms: T.nilable(Integer), + http_headers: T.nilable(T::Hash[T.any(String, Symbol), String]) + ) + .returns(Models::Operations::CreateWebhookResponse) + } + def create(request:, timeout_ms: nil, http_headers: nil) + # create - Create a webhook + # Create a webhook subscribed to one or more event types. Deliveries use the v2 envelope and are signed with the project signing secret (see the signing secret endpoint). + url, params = @sdk_configuration.get_server_details + base_url = Utils.template_url(url, params) + url = "#{base_url}/webhooks" + headers = {} + headers = T.cast(headers, T::Hash[String, String]) + req_content_type, data, form = Utils.serialize_request_body(request, false, false, :request, :json) + headers["content-type"] = req_content_type + raise StandardError, "request body is required" if data.nil? && form.nil? + + if form && !form.empty? + body = Utils.encode_form(form) + elsif Utils.match_content_type(req_content_type, "application/x-www-form-urlencoded") + body = URI.encode_www_form(T.cast(data, T::Hash[Symbol, Object])) + else + body = data + end + + headers["Accept"] = "application/json" + headers["user-agent"] = @sdk_configuration.user_agent + + security = @sdk_configuration.security_source&.call + + timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil? + timeout ||= @sdk_configuration.timeout + + connection = @sdk_configuration.client + + hook_ctx = SDKHooks::HookContext.new( + config: @sdk_configuration, + base_url: base_url, + oauth2_scopes: nil, + operation_id: "createWebhook", + security_source: @sdk_configuration.security_source + ) + + error = T.let(nil, T.nilable(StandardError)) + http_response = T.let(nil, T.nilable(Faraday::Response)) + + begin + http_response = T.must(connection).post(url) do |req| + req.body = body + req.headers.merge!(headers) + req.options.timeout = timeout unless timeout.nil? + Utils.configure_request_security(req, security) + http_headers&.each do |key, value| + req.headers[key.to_s] = value + end + + @sdk_configuration.hooks.before_request( + hook_ctx: SDKHooks::BeforeRequestHookContext.new( + hook_ctx: hook_ctx + ), + request: req + ) + end + + rescue StandardError => e + error = e + ensure + if http_response.nil? || Utils.error_status?(http_response.status) + http_response = @sdk_configuration.hooks.after_error( + error: error, + hook_ctx: SDKHooks::AfterErrorHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + else + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + end + + if http_response.nil? + raise error if !error.nil? + raise "no response" + end + end + + content_type = http_response.headers.fetch("Content-Type", "application/octet-stream") + if Utils.match_status_code(http_response.status, ["200"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Operations::CreateWebhookResponseBody) + response = Models::Operations::CreateWebhookResponse.new( + status_code: http_response.status, + content_type: content_type, + raw_response: http_response, + object: T.unsafe(obj) + ) + + return response + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["400"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::BadRequestError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["401"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::AuthenticationError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["429"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::RateLimitError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["4XX"]) + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "API error occurred" + ) + elsif Utils.match_status_code(http_response.status, ["5XX"]) + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "API error occurred" + ) + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown status code received" + ) + + end + end + + sig { + params( + id: ::String, + timeout_ms: T.nilable(Integer), + http_headers: T.nilable(T::Hash[T.any(String, Symbol), String]) + ) + .returns(Models::Operations::GetWebhookResponse) + } + def retrieve(id:, timeout_ms: nil, http_headers: nil) + # retrieve - Get a webhook + # Get a webhook by ID. + request = Models::Operations::GetWebhookRequest.new( + id: id + ) + url, params = @sdk_configuration.get_server_details + base_url = Utils.template_url(url, params) + url = Utils.generate_url( + Models::Operations::GetWebhookRequest, + base_url, + "/webhooks/{id}", + request + ) + headers = {} + headers = T.cast(headers, T::Hash[String, String]) + headers["Accept"] = "application/json" + headers["user-agent"] = @sdk_configuration.user_agent + + security = @sdk_configuration.security_source&.call + + timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil? + timeout ||= @sdk_configuration.timeout + + connection = @sdk_configuration.client + + hook_ctx = SDKHooks::HookContext.new( + config: @sdk_configuration, + base_url: base_url, + oauth2_scopes: nil, + operation_id: "getWebhook", + security_source: @sdk_configuration.security_source + ) + + error = T.let(nil, T.nilable(StandardError)) + http_response = T.let(nil, T.nilable(Faraday::Response)) + + begin + http_response = T.must(connection).get(url) do |req| + req.headers.merge!(headers) + req.options.timeout = timeout unless timeout.nil? + Utils.configure_request_security(req, security) + http_headers&.each do |key, value| + req.headers[key.to_s] = value + end + + @sdk_configuration.hooks.before_request( + hook_ctx: SDKHooks::BeforeRequestHookContext.new( + hook_ctx: hook_ctx + ), + request: req + ) + end + + rescue StandardError => e + error = e + ensure + if http_response.nil? || Utils.error_status?(http_response.status) + http_response = @sdk_configuration.hooks.after_error( + error: error, + hook_ctx: SDKHooks::AfterErrorHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + else + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + end + + if http_response.nil? + raise error if !error.nil? + raise "no response" + end + end + + content_type = http_response.headers.fetch("Content-Type", "application/octet-stream") + if Utils.match_status_code(http_response.status, ["200"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Operations::GetWebhookResponseBody) + response = Models::Operations::GetWebhookResponse.new( + status_code: http_response.status, + content_type: content_type, + raw_response: http_response, + object: T.unsafe(obj) + ) + + return response + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["401"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::AuthenticationError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["404"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::NotFoundError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["429"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::RateLimitError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["4XX"]) + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "API error occurred" + ) + elsif Utils.match_status_code(http_response.status, ["5XX"]) + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "API error occurred" + ) + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown status code received" + ) + + end + end + + sig { + params( + body: Models::Operations::UpdateWebhookRequestBody, + id: ::String, + timeout_ms: T.nilable(Integer), + http_headers: T.nilable(T::Hash[T.any(String, Symbol), String]) + ) + .returns(Models::Operations::UpdateWebhookResponse) + } + def update(body:, id:, timeout_ms: nil, http_headers: nil) + # update - Update a webhook + # Update a webhook. Legacy v1 webhooks are read-only: delete them and create a new webhook instead. + request = Models::Operations::UpdateWebhookRequest.new( + id: id, + body: body + ) + url, params = @sdk_configuration.get_server_details + base_url = Utils.template_url(url, params) + url = Utils.generate_url( + Models::Operations::UpdateWebhookRequest, + base_url, + "/webhooks/{id}", + request + ) + headers = {} + headers = T.cast(headers, T::Hash[String, String]) + req_content_type, data, form = Utils.serialize_request_body(request, false, false, :body, :json) + headers["content-type"] = req_content_type + raise StandardError, "request body is required" if data.nil? && form.nil? + + if form && !form.empty? + body = Utils.encode_form(form) + elsif Utils.match_content_type(req_content_type, "application/x-www-form-urlencoded") + body = URI.encode_www_form(T.cast(data, T::Hash[Symbol, Object])) + else + body = data + end + + headers["Accept"] = "application/json" + headers["user-agent"] = @sdk_configuration.user_agent + + security = @sdk_configuration.security_source&.call + + timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil? + timeout ||= @sdk_configuration.timeout + + connection = @sdk_configuration.client + + hook_ctx = SDKHooks::HookContext.new( + config: @sdk_configuration, + base_url: base_url, + oauth2_scopes: nil, + operation_id: "updateWebhook", + security_source: @sdk_configuration.security_source + ) + + error = T.let(nil, T.nilable(StandardError)) + http_response = T.let(nil, T.nilable(Faraday::Response)) + + begin + http_response = T.must(connection).put(url) do |req| + req.body = body + req.headers.merge!(headers) + req.options.timeout = timeout unless timeout.nil? + Utils.configure_request_security(req, security) + http_headers&.each do |key, value| + req.headers[key.to_s] = value + end + + @sdk_configuration.hooks.before_request( + hook_ctx: SDKHooks::BeforeRequestHookContext.new( + hook_ctx: hook_ctx + ), + request: req + ) + end + + rescue StandardError => e + error = e + ensure + if http_response.nil? || Utils.error_status?(http_response.status) + http_response = @sdk_configuration.hooks.after_error( + error: error, + hook_ctx: SDKHooks::AfterErrorHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + else + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + end + + if http_response.nil? + raise error if !error.nil? + raise "no response" + end + end + + content_type = http_response.headers.fetch("Content-Type", "application/octet-stream") + if Utils.match_status_code(http_response.status, ["200"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Operations::UpdateWebhookResponseBody) + response = Models::Operations::UpdateWebhookResponse.new( + status_code: http_response.status, + content_type: content_type, + raw_response: http_response, + object: T.unsafe(obj) + ) + + return response + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["400"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::BadRequestError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["401"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::AuthenticationError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["404"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::NotFoundError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["429"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::RateLimitError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["4XX"]) + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "API error occurred" + ) + elsif Utils.match_status_code(http_response.status, ["5XX"]) + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "API error occurred" + ) + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown status code received" + ) + + end + end + + sig { + params( + id: ::String, + timeout_ms: T.nilable(Integer), + http_headers: T.nilable(T::Hash[T.any(String, Symbol), String]) + ) + .returns(Models::Operations::DeleteWebhookResponse) + } + def delete(id:, timeout_ms: nil, http_headers: nil) + # delete - Delete a webhook + # Delete a webhook. + request = Models::Operations::DeleteWebhookRequest.new( + id: id + ) + url, params = @sdk_configuration.get_server_details + base_url = Utils.template_url(url, params) + url = Utils.generate_url( + Models::Operations::DeleteWebhookRequest, + base_url, + "/webhooks/{id}", + request + ) + headers = {} + headers = T.cast(headers, T::Hash[String, String]) + headers["Accept"] = "application/json" + headers["user-agent"] = @sdk_configuration.user_agent + + security = @sdk_configuration.security_source&.call + + timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil? + timeout ||= @sdk_configuration.timeout + + connection = @sdk_configuration.client + + hook_ctx = SDKHooks::HookContext.new( + config: @sdk_configuration, + base_url: base_url, + oauth2_scopes: nil, + operation_id: "deleteWebhook", + security_source: @sdk_configuration.security_source + ) + + error = T.let(nil, T.nilable(StandardError)) + http_response = T.let(nil, T.nilable(Faraday::Response)) + + begin + http_response = T.must(connection).delete(url) do |req| + req.headers.merge!(headers) + req.options.timeout = timeout unless timeout.nil? + Utils.configure_request_security(req, security) + http_headers&.each do |key, value| + req.headers[key.to_s] = value + end + + @sdk_configuration.hooks.before_request( + hook_ctx: SDKHooks::BeforeRequestHookContext.new( + hook_ctx: hook_ctx + ), + request: req + ) + end + + rescue StandardError => e + error = e + ensure + if http_response.nil? || Utils.error_status?(http_response.status) + http_response = @sdk_configuration.hooks.after_error( + error: error, + hook_ctx: SDKHooks::AfterErrorHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + else + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + end + + if http_response.nil? + raise error if !error.nil? + raise "no response" + end + end + + content_type = http_response.headers.fetch("Content-Type", "application/octet-stream") + if Utils.match_status_code(http_response.status, ["200"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Operations::DeleteWebhookResponseBody) + response = Models::Operations::DeleteWebhookResponse.new( + status_code: http_response.status, + content_type: content_type, + raw_response: http_response, + object: T.unsafe(obj) + ) + + return response + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["401"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::AuthenticationError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["404"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::NotFoundError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["429"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::RateLimitError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["4XX"]) + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "API error occurred" + ) + elsif Utils.match_status_code(http_response.status, ["5XX"]) + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "API error occurred" + ) + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown status code received" + ) + + end + end + end +end diff --git a/lib/moderation_api/webhooksecret.rb b/lib/moderation_api/webhooksecret.rb new file mode 100644 index 00000000..2740bb05 --- /dev/null +++ b/lib/moderation_api/webhooksecret.rb @@ -0,0 +1,221 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +require "faraday" +require "faraday/multipart" +require "faraday/retry" +require "sorbet-runtime" + +require_relative "sdk_hooks/hooks" +require_relative "utils/retries" + +module ModerationApi + extend T::Sig + + class WebhookSecret + extend T::Sig + + sig { params(sdk_config: SDKConfiguration).void } + def initialize(sdk_config) + @sdk_configuration = sdk_config + end + + sig { params(base_url: String, url_variables: T.nilable(T::Hash[Symbol, T.any(String, T::Enum)])).returns(String) } + def get_url(base_url:, url_variables: nil) + sd_base_url, sd_options = @sdk_configuration.get_server_details + + if base_url.nil? + base_url = sd_base_url + end + + if url_variables.nil? + url_variables = sd_options + end + + return Utils.template_url(base_url, url_variables) + end + + sig { + params(timeout_ms: T.nilable(Integer), http_headers: T.nilable(T::Hash[T.any(String, Symbol), String])).returns( + Models::Operations::GetWebhookSecretResponse + ) + } + def retrieve(timeout_ms: nil, http_headers: nil) + # retrieve - Get the webhook signing secret + # Get the signing secret used to sign webhook deliveries for this project, creating one if none exists yet. Verify deliveries by comparing the `modapi-signature` header to HMAC-SHA256(raw request body, secret) hex-encoded. + url, params = @sdk_configuration.get_server_details + base_url = Utils.template_url(url, params) + url = "#{base_url}/webhook-secret" + headers = {} + headers = T.cast(headers, T::Hash[String, String]) + headers["Accept"] = "application/json" + headers["user-agent"] = @sdk_configuration.user_agent + + security = @sdk_configuration.security_source&.call + + timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil? + timeout ||= @sdk_configuration.timeout + + connection = @sdk_configuration.client + + hook_ctx = SDKHooks::HookContext.new( + config: @sdk_configuration, + base_url: base_url, + oauth2_scopes: nil, + operation_id: "getWebhookSecret", + security_source: @sdk_configuration.security_source + ) + + error = T.let(nil, T.nilable(StandardError)) + http_response = T.let(nil, T.nilable(Faraday::Response)) + + begin + http_response = T.must(connection).get(url) do |req| + req.headers.merge!(headers) + req.options.timeout = timeout unless timeout.nil? + Utils.configure_request_security(req, security) + http_headers&.each do |key, value| + req.headers[key.to_s] = value + end + + @sdk_configuration.hooks.before_request( + hook_ctx: SDKHooks::BeforeRequestHookContext.new( + hook_ctx: hook_ctx + ), + request: req + ) + end + + rescue StandardError => e + error = e + ensure + if http_response.nil? || Utils.error_status?(http_response.status) + http_response = @sdk_configuration.hooks.after_error( + error: error, + hook_ctx: SDKHooks::AfterErrorHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + else + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + end + + if http_response.nil? + raise error if !error.nil? + raise "no response" + end + end + + content_type = http_response.headers.fetch("Content-Type", "application/octet-stream") + if Utils.match_status_code(http_response.status, ["200"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Operations::GetWebhookSecretResponseBody) + response = Models::Operations::GetWebhookSecretResponse.new( + status_code: http_response.status, + content_type: content_type, + raw_response: http_response, + object: T.unsafe(obj) + ) + + return response + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["401"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::AuthenticationError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["429"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::RateLimitError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["4XX"]) + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "API error occurred" + ) + elsif Utils.match_status_code(http_response.status, ["5XX"]) + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "API error occurred" + ) + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown status code received" + ) + + end + end + end +end diff --git a/lib/moderation_api/wordlist.rb b/lib/moderation_api/wordlist.rb new file mode 100644 index 00000000..aa2a5393 --- /dev/null +++ b/lib/moderation_api/wordlist.rb @@ -0,0 +1,1175 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +require "faraday" +require "faraday/multipart" +require "faraday/retry" +require "sorbet-runtime" +require "janeway" + +require_relative "sdk_hooks/hooks" +require_relative "utils/retries" + +module ModerationApi + extend T::Sig + + class Wordlist + extend T::Sig + attr_accessor :words + + sig { params(sdk_config: SDKConfiguration).void } + def initialize(sdk_config) + @sdk_configuration = sdk_config + init_sdks + end + + sig { void } + def init_sdks + @words = ::ModerationApi::Words.new(@sdk_configuration) + end + + sig { params(base_url: String, url_variables: T.nilable(T::Hash[Symbol, T.any(String, T::Enum)])).returns(String) } + def get_url(base_url:, url_variables: nil) + sd_base_url, sd_options = @sdk_configuration.get_server_details + + if base_url.nil? + base_url = sd_base_url + end + + if url_variables.nil? + url_variables = sd_options + end + + return Utils.template_url(base_url, url_variables) + end + + sig { + params( + page: T.nilable(::Integer), + page_size: T.nilable(::Integer), + timeout_ms: T.nilable(Integer), + http_headers: T.nilable(T::Hash[T.any(String, Symbol), String]) + ) + .returns(Models::Operations::ListWordlistsResponse) + } + def list(page: nil, page_size: nil, timeout_ms: nil, http_headers: nil) + # list - List wordlists + # List the wordlists of the organization. The list is paginated. + request = Models::Operations::ListWordlistsRequest.new( + page: page, + page_size: page_size + ) + url, params = @sdk_configuration.get_server_details + base_url = Utils.template_url(url, params) + url = "#{base_url}/wordlist" + headers = {} + headers = T.cast(headers, T::Hash[String, String]) + query_params = Utils.get_query_params(Models::Operations::ListWordlistsRequest, request, nil) + headers["Accept"] = "application/json" + headers["user-agent"] = @sdk_configuration.user_agent + + security = @sdk_configuration.security_source&.call + + timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil? + timeout ||= @sdk_configuration.timeout + + connection = @sdk_configuration.client + + hook_ctx = SDKHooks::HookContext.new( + config: @sdk_configuration, + base_url: base_url, + oauth2_scopes: nil, + operation_id: "listWordlists", + security_source: @sdk_configuration.security_source + ) + + error = T.let(nil, T.nilable(StandardError)) + http_response = T.let(nil, T.nilable(Faraday::Response)) + + begin + http_response = T.must(connection).get(url) do |req| + req.headers.merge!(headers) + req.options.timeout = timeout unless timeout.nil? + req.params = query_params + Utils.configure_request_security(req, security) + http_headers&.each do |key, value| + req.headers[key.to_s] = value + end + + @sdk_configuration.hooks.before_request( + hook_ctx: SDKHooks::BeforeRequestHookContext.new( + hook_ctx: hook_ctx + ), + request: req + ) + end + + rescue StandardError => e + error = e + ensure + if http_response.nil? || Utils.error_status?(http_response.status) + http_response = @sdk_configuration.hooks.after_error( + error: error, + hook_ctx: SDKHooks::AfterErrorHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + else + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + end + + if http_response.nil? + raise error if !error.nil? + raise "no response" + end + end + + content_type = http_response.headers.fetch("Content-Type", "application/octet-stream") + if Utils.match_status_code(http_response.status, ["200"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Operations::ListWordlistsResponseBody) + response = Models::Operations::ListWordlistsResponse.new( + status_code: http_response.status, + content_type: content_type, + raw_response: http_response, + object: T.unsafe(obj) + ) + sdk = self + + response.next_page = proc do + request_page = T.must(!request.page.nil? ? request.page : 1) + next_page = request_page + 1 + num_pages = Janeway.enum_for("$.pagination.totalPages", JSON.parse(response_data)).search + if num_pages.nil? || num_pages[0] <= request_page + next nil + end + + if !response_data + next nil + end + + results = Janeway.enum_for("$.data", JSON.parse(response_data)).search + if results.is_a?(Array) + results = results[0] + end + + if results.count.zero? + next nil + end + + request_limit = !request.page_size.nil? ? request.page_size : 20 + if results.count < request_limit + next nil + end + + sdk.list( + page: next_page, + page_size: request.page_size, + http_headers: http_headers + ) + end + + return response + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["400"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::BadRequestError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["401"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::AuthenticationError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["403"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::PermissionDeniedError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["404"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::NotFoundError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["429"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::RateLimitError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["500"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::InternalServerError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["4XX"]) + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "API error occurred" + ) + elsif Utils.match_status_code(http_response.status, ["5XX"]) + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "API error occurred" + ) + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown status code received" + ) + + end + end + + sig { + params( + id: ::String, + timeout_ms: T.nilable(Integer), + http_headers: T.nilable(T::Hash[T.any(String, Symbol), String]) + ) + .returns(Models::Operations::GetWordlistResponse) + } + def retrieve(id:, timeout_ms: nil, http_headers: nil) + # retrieve - Get wordlist + # Get a specific wordlist by ID + request = Models::Operations::GetWordlistRequest.new( + id: id + ) + url, params = @sdk_configuration.get_server_details + base_url = Utils.template_url(url, params) + url = Utils.generate_url( + Models::Operations::GetWordlistRequest, + base_url, + "/wordlist/{id}", + request + ) + headers = {} + headers = T.cast(headers, T::Hash[String, String]) + headers["Accept"] = "application/json" + headers["user-agent"] = @sdk_configuration.user_agent + + security = @sdk_configuration.security_source&.call + + timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil? + timeout ||= @sdk_configuration.timeout + + connection = @sdk_configuration.client + + hook_ctx = SDKHooks::HookContext.new( + config: @sdk_configuration, + base_url: base_url, + oauth2_scopes: nil, + operation_id: "getWordlist", + security_source: @sdk_configuration.security_source + ) + + error = T.let(nil, T.nilable(StandardError)) + http_response = T.let(nil, T.nilable(Faraday::Response)) + + begin + http_response = T.must(connection).get(url) do |req| + req.headers.merge!(headers) + req.options.timeout = timeout unless timeout.nil? + Utils.configure_request_security(req, security) + http_headers&.each do |key, value| + req.headers[key.to_s] = value + end + + @sdk_configuration.hooks.before_request( + hook_ctx: SDKHooks::BeforeRequestHookContext.new( + hook_ctx: hook_ctx + ), + request: req + ) + end + + rescue StandardError => e + error = e + ensure + if http_response.nil? || Utils.error_status?(http_response.status) + http_response = @sdk_configuration.hooks.after_error( + error: error, + hook_ctx: SDKHooks::AfterErrorHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + else + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + end + + if http_response.nil? + raise error if !error.nil? + raise "no response" + end + end + + content_type = http_response.headers.fetch("Content-Type", "application/octet-stream") + if Utils.match_status_code(http_response.status, ["200"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Operations::GetWordlistResponseBody) + response = Models::Operations::GetWordlistResponse.new( + status_code: http_response.status, + content_type: content_type, + raw_response: http_response, + object: T.unsafe(obj) + ) + + return response + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["400"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::BadRequestError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["401"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::AuthenticationError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["403"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::PermissionDeniedError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["404"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::NotFoundError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["429"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::RateLimitError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["500"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::InternalServerError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["4XX"]) + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "API error occurred" + ) + elsif Utils.match_status_code(http_response.status, ["5XX"]) + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "API error occurred" + ) + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown status code received" + ) + + end + end + + sig { + params( + body: Models::Operations::UpdateWordlistRequestBody, + id: ::String, + timeout_ms: T.nilable(Integer), + http_headers: T.nilable(T::Hash[T.any(String, Symbol), String]) + ) + .returns(Models::Operations::UpdateWordlistResponse) + } + def update(body:, id:, timeout_ms: nil, http_headers: nil) + # update - Update wordlist + # Update a wordlist + request = Models::Operations::UpdateWordlistRequest.new( + id: id, + body: body + ) + url, params = @sdk_configuration.get_server_details + base_url = Utils.template_url(url, params) + url = Utils.generate_url( + Models::Operations::UpdateWordlistRequest, + base_url, + "/wordlist/{id}", + request + ) + headers = {} + headers = T.cast(headers, T::Hash[String, String]) + req_content_type, data, form = Utils.serialize_request_body(request, false, false, :body, :json) + headers["content-type"] = req_content_type + raise StandardError, "request body is required" if data.nil? && form.nil? + + if form && !form.empty? + body = Utils.encode_form(form) + elsif Utils.match_content_type(req_content_type, "application/x-www-form-urlencoded") + body = URI.encode_www_form(T.cast(data, T::Hash[Symbol, Object])) + else + body = data + end + + headers["Accept"] = "application/json" + headers["user-agent"] = @sdk_configuration.user_agent + + security = @sdk_configuration.security_source&.call + + timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil? + timeout ||= @sdk_configuration.timeout + + connection = @sdk_configuration.client + + hook_ctx = SDKHooks::HookContext.new( + config: @sdk_configuration, + base_url: base_url, + oauth2_scopes: nil, + operation_id: "updateWordlist", + security_source: @sdk_configuration.security_source + ) + + error = T.let(nil, T.nilable(StandardError)) + http_response = T.let(nil, T.nilable(Faraday::Response)) + + begin + http_response = T.must(connection).put(url) do |req| + req.body = body + req.headers.merge!(headers) + req.options.timeout = timeout unless timeout.nil? + Utils.configure_request_security(req, security) + http_headers&.each do |key, value| + req.headers[key.to_s] = value + end + + @sdk_configuration.hooks.before_request( + hook_ctx: SDKHooks::BeforeRequestHookContext.new( + hook_ctx: hook_ctx + ), + request: req + ) + end + + rescue StandardError => e + error = e + ensure + if http_response.nil? || Utils.error_status?(http_response.status) + http_response = @sdk_configuration.hooks.after_error( + error: error, + hook_ctx: SDKHooks::AfterErrorHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + else + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + end + + if http_response.nil? + raise error if !error.nil? + raise "no response" + end + end + + content_type = http_response.headers.fetch("Content-Type", "application/octet-stream") + if Utils.match_status_code(http_response.status, ["200"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Operations::UpdateWordlistResponseBody) + response = Models::Operations::UpdateWordlistResponse.new( + status_code: http_response.status, + content_type: content_type, + raw_response: http_response, + object: T.unsafe(obj) + ) + + return response + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["400"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::BadRequestError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["401"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::AuthenticationError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["404"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::NotFoundError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["429"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::RateLimitError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["4XX"]) + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "API error occurred" + ) + elsif Utils.match_status_code(http_response.status, ["5XX"]) + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "API error occurred" + ) + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown status code received" + ) + + end + end + + sig { + params( + id: ::String, + timeout_ms: T.nilable(Integer), + http_headers: T.nilable(T::Hash[T.any(String, Symbol), String]) + ) + .returns(Models::Operations::GetWordlistEmbeddingStatusResponse) + } + def get_embedding_status(id:, timeout_ms: nil, http_headers: nil) + # get_embedding_status - Get embedding status + # Get the current embedding progress status for a wordlist + request = Models::Operations::GetWordlistEmbeddingStatusRequest.new( + id: id + ) + url, params = @sdk_configuration.get_server_details + base_url = Utils.template_url(url, params) + url = Utils.generate_url( + Models::Operations::GetWordlistEmbeddingStatusRequest, + base_url, + "/wordlist/{id}/embedding-status", + request + ) + headers = {} + headers = T.cast(headers, T::Hash[String, String]) + headers["Accept"] = "application/json" + headers["user-agent"] = @sdk_configuration.user_agent + + security = @sdk_configuration.security_source&.call + + timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil? + timeout ||= @sdk_configuration.timeout + + connection = @sdk_configuration.client + + hook_ctx = SDKHooks::HookContext.new( + config: @sdk_configuration, + base_url: base_url, + oauth2_scopes: nil, + operation_id: "getWordlistEmbeddingStatus", + security_source: @sdk_configuration.security_source + ) + + error = T.let(nil, T.nilable(StandardError)) + http_response = T.let(nil, T.nilable(Faraday::Response)) + + begin + http_response = T.must(connection).get(url) do |req| + req.headers.merge!(headers) + req.options.timeout = timeout unless timeout.nil? + Utils.configure_request_security(req, security) + http_headers&.each do |key, value| + req.headers[key.to_s] = value + end + + @sdk_configuration.hooks.before_request( + hook_ctx: SDKHooks::BeforeRequestHookContext.new( + hook_ctx: hook_ctx + ), + request: req + ) + end + + rescue StandardError => e + error = e + ensure + if http_response.nil? || Utils.error_status?(http_response.status) + http_response = @sdk_configuration.hooks.after_error( + error: error, + hook_ctx: SDKHooks::AfterErrorHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + else + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + end + + if http_response.nil? + raise error if !error.nil? + raise "no response" + end + end + + content_type = http_response.headers.fetch("Content-Type", "application/octet-stream") + if Utils.match_status_code(http_response.status, ["200"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json( + JSON.parse(response_data), + Models::Operations::GetWordlistEmbeddingStatusResponseBody + ) + response = Models::Operations::GetWordlistEmbeddingStatusResponse.new( + status_code: http_response.status, + content_type: content_type, + raw_response: http_response, + object: T.unsafe(obj) + ) + + return response + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["400"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::BadRequestError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["401"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::AuthenticationError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["403"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::PermissionDeniedError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["404"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::NotFoundError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["429"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::RateLimitError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["500"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::InternalServerError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["4XX"]) + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "API error occurred" + ) + elsif Utils.match_status_code(http_response.status, ["5XX"]) + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "API error occurred" + ) + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown status code received" + ) + + end + end + end +end diff --git a/lib/moderation_api/words.rb b/lib/moderation_api/words.rb new file mode 100644 index 00000000..09e85bd2 --- /dev/null +++ b/lib/moderation_api/words.rb @@ -0,0 +1,534 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +require "faraday" +require "faraday/multipart" +require "faraday/retry" +require "sorbet-runtime" + +require_relative "sdk_hooks/hooks" +require_relative "utils/retries" + +module ModerationApi + extend T::Sig + + class Words + extend T::Sig + + sig { params(sdk_config: SDKConfiguration).void } + def initialize(sdk_config) + @sdk_configuration = sdk_config + end + + sig { params(base_url: String, url_variables: T.nilable(T::Hash[Symbol, T.any(String, T::Enum)])).returns(String) } + def get_url(base_url:, url_variables: nil) + sd_base_url, sd_options = @sdk_configuration.get_server_details + + if base_url.nil? + base_url = sd_base_url + end + + if url_variables.nil? + url_variables = sd_options + end + + return Utils.template_url(base_url, url_variables) + end + + sig { + params( + body: Models::Operations::AddWordlistWordsRequestBody, + id: ::String, + timeout_ms: T.nilable(Integer), + http_headers: T.nilable(T::Hash[T.any(String, Symbol), String]) + ) + .returns(Models::Operations::AddWordlistWordsResponse) + } + def add(body:, id:, timeout_ms: nil, http_headers: nil) + # add - Add words to wordlist + # Add words to an existing wordlist + request = Models::Operations::AddWordlistWordsRequest.new( + id: id, + body: body + ) + url, params = @sdk_configuration.get_server_details + base_url = Utils.template_url(url, params) + url = Utils.generate_url( + Models::Operations::AddWordlistWordsRequest, + base_url, + "/wordlist/{id}/words", + request + ) + headers = {} + headers = T.cast(headers, T::Hash[String, String]) + req_content_type, data, form = Utils.serialize_request_body(request, false, false, :body, :json) + headers["content-type"] = req_content_type + raise StandardError, "request body is required" if data.nil? && form.nil? + + if form && !form.empty? + body = Utils.encode_form(form) + elsif Utils.match_content_type(req_content_type, "application/x-www-form-urlencoded") + body = URI.encode_www_form(T.cast(data, T::Hash[Symbol, Object])) + else + body = data + end + + headers["Accept"] = "application/json" + headers["user-agent"] = @sdk_configuration.user_agent + + security = @sdk_configuration.security_source&.call + + timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil? + timeout ||= @sdk_configuration.timeout + + connection = @sdk_configuration.client + + hook_ctx = SDKHooks::HookContext.new( + config: @sdk_configuration, + base_url: base_url, + oauth2_scopes: nil, + operation_id: "addWordlistWords", + security_source: @sdk_configuration.security_source + ) + + error = T.let(nil, T.nilable(StandardError)) + http_response = T.let(nil, T.nilable(Faraday::Response)) + + begin + http_response = T.must(connection).post(url) do |req| + req.body = body + req.headers.merge!(headers) + req.options.timeout = timeout unless timeout.nil? + Utils.configure_request_security(req, security) + http_headers&.each do |key, value| + req.headers[key.to_s] = value + end + + @sdk_configuration.hooks.before_request( + hook_ctx: SDKHooks::BeforeRequestHookContext.new( + hook_ctx: hook_ctx + ), + request: req + ) + end + + rescue StandardError => e + error = e + ensure + if http_response.nil? || Utils.error_status?(http_response.status) + http_response = @sdk_configuration.hooks.after_error( + error: error, + hook_ctx: SDKHooks::AfterErrorHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + else + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + end + + if http_response.nil? + raise error if !error.nil? + raise "no response" + end + end + + content_type = http_response.headers.fetch("Content-Type", "application/octet-stream") + if Utils.match_status_code(http_response.status, ["200"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Operations::AddWordlistWordsResponseBody) + response = Models::Operations::AddWordlistWordsResponse.new( + status_code: http_response.status, + content_type: content_type, + raw_response: http_response, + object: T.unsafe(obj) + ) + + return response + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["400"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::BadRequestError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["401"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::AuthenticationError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["404"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::NotFoundError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["429"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::RateLimitError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["4XX"]) + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "API error occurred" + ) + elsif Utils.match_status_code(http_response.status, ["5XX"]) + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "API error occurred" + ) + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown status code received" + ) + + end + end + + sig { + params( + id: ::String, + words: T::Array[::String], + timeout_ms: T.nilable(Integer), + http_headers: T.nilable(T::Hash[T.any(String, Symbol), String]) + ) + .returns(Models::Operations::RemoveWordlistWordsResponse) + } + def remove(id:, words:, timeout_ms: nil, http_headers: nil) + # remove - Remove words from wordlist + # Remove words from an existing wordlist + request = Models::Operations::RemoveWordlistWordsRequest.new( + id: id, + words: words + ) + url, params = @sdk_configuration.get_server_details + base_url = Utils.template_url(url, params) + url = Utils.generate_url( + Models::Operations::RemoveWordlistWordsRequest, + base_url, + "/wordlist/{id}/words", + request + ) + headers = {} + headers = T.cast(headers, T::Hash[String, String]) + query_params = Utils.get_query_params(Models::Operations::RemoveWordlistWordsRequest, request, nil) + headers["Accept"] = "application/json" + headers["user-agent"] = @sdk_configuration.user_agent + + security = @sdk_configuration.security_source&.call + + timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil? + timeout ||= @sdk_configuration.timeout + + connection = @sdk_configuration.client + + hook_ctx = SDKHooks::HookContext.new( + config: @sdk_configuration, + base_url: base_url, + oauth2_scopes: nil, + operation_id: "removeWordlistWords", + security_source: @sdk_configuration.security_source + ) + + error = T.let(nil, T.nilable(StandardError)) + http_response = T.let(nil, T.nilable(Faraday::Response)) + + begin + http_response = T.must(connection).delete(url) do |req| + req.headers.merge!(headers) + req.options.timeout = timeout unless timeout.nil? + req.params = query_params + Utils.configure_request_security(req, security) + http_headers&.each do |key, value| + req.headers[key.to_s] = value + end + + @sdk_configuration.hooks.before_request( + hook_ctx: SDKHooks::BeforeRequestHookContext.new( + hook_ctx: hook_ctx + ), + request: req + ) + end + + rescue StandardError => e + error = e + ensure + if http_response.nil? || Utils.error_status?(http_response.status) + http_response = @sdk_configuration.hooks.after_error( + error: error, + hook_ctx: SDKHooks::AfterErrorHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + else + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + end + + if http_response.nil? + raise error if !error.nil? + raise "no response" + end + end + + content_type = http_response.headers.fetch("Content-Type", "application/octet-stream") + if Utils.match_status_code(http_response.status, ["200"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json( + JSON.parse(response_data), + Models::Operations::RemoveWordlistWordsResponseBody + ) + response = Models::Operations::RemoveWordlistWordsResponse.new( + status_code: http_response.status, + content_type: content_type, + raw_response: http_response, + object: T.unsafe(obj) + ) + + return response + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["400"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::BadRequestError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["401"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::AuthenticationError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["404"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::NotFoundError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["429"]) + if Utils.match_content_type(content_type, "application/json") + http_response = @sdk_configuration.hooks.after_success( + hook_ctx: SDKHooks::AfterSuccessHookContext.new( + hook_ctx: hook_ctx + ), + response: http_response + ) + response_data = http_response.env.response_body + obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::RateLimitError) + obj.raw_response = http_response + raise obj + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown content type received" + ) + end + elsif Utils.match_status_code(http_response.status, ["4XX"]) + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "API error occurred" + ) + elsif Utils.match_status_code(http_response.status, ["5XX"]) + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "API error occurred" + ) + else + raise( + ::ModerationApi::Models::Errors::APIError.new( + status_code: http_response.status, + body: http_response.env.response_body, + raw_response: http_response + ), + "Unknown status code received" + ) + + end + end + end +end diff --git a/manifest.yaml b/manifest.yaml deleted file mode 100644 index a1fd74a9..00000000 --- a/manifest.yaml +++ /dev/null @@ -1,17 +0,0 @@ -dependencies: - - English - - base64 - - cgi - - date - - erb - - etc - - json - - net/http - - openssl - - pathname - - rbconfig - - securerandom - - set - - stringio - - time - - uri diff --git a/moderation_api.gemspec b/moderation_api.gemspec index 7def28f2..7dc1ed1c 100644 --- a/moderation_api.gemspec +++ b/moderation_api.gemspec @@ -1,29 +1,40 @@ # frozen_string_literal: true -require_relative "lib/moderation_api/version" +$LOAD_PATH.push File.expand_path('lib', __dir__) Gem::Specification.new do |s| - s.name = "moderation_api" - s.version = ModerationAPI::VERSION - s.summary = "Ruby library to access the Moderation API" - s.authors = ["Moderation API"] - s.email = "support@moderationapi.com" - s.homepage = "https://gemdocs.org/gems/moderation_api" - s.metadata["homepage_uri"] = s.homepage - s.metadata["source_code_uri"] = "https://github.com/moderation-api/sdk-ruby" - s.metadata["rubygems_mfa_required"] = false.to_s - s.required_ruby_version = ">= 3.2.0" + s.name = 'moderation_api' + s.version = '3.0.0' + s.platform = Gem::Platform::RUBY + s.licenses = ['Apache-2.0'] + s.summary = '' + s.homepage = 'https://github.com/moderation-api/sdk-ruby' + s.description = 'The official Ruby library for the Moderation API' + s.authors = ['Moderation API'] + s.metadata = { + 'homepage_uri' => 'https://github.com/moderation-api/sdk-ruby', + 'documentation_uri' => 'https://github.com/moderation-api/sdk-ruby', + 'source_code_uri' => 'https://github.com/moderation-api/sdk-ruby' + } - s.files = Dir[ - "lib/**/*.rb", - "rbi/**/*.rbi", - "sig/**/*.rbs", - "manifest.yaml", - "SECURITY.md", - "CHANGELOG.md", - ".ignore" - ] - s.extra_rdoc_files = ["README.md"] - s.add_dependency "cgi" - s.add_dependency "connection_pool" + s.files = Dir['{lib,test}/**/*'].reject { |f| f.start_with?('test/mockserver') } + s.require_paths = ['lib'] + s.required_ruby_version = '>= 3.2' + + s.add_dependency('base64', '>= 0.2.0', '< 1.0') + s.add_dependency('faraday', '>= 2.14.3') + s.add_dependency('faraday-multipart', '~> 1.2.0') + s.add_dependency('faraday-retry', '~> 2.4.0') + s.add_dependency('janeway-jsonpath', '~> 0.6.0') + s.add_dependency('sorbet-runtime', '~> 0.6.12872') + s.add_development_dependency('irb') + s.add_development_dependency('minitest', '>= 5.27.0') + s.add_development_dependency('minitest-focus', '~> 1.4.1') + s.add_development_dependency('minitest-reporters', '~> 1.7.1') + s.add_development_dependency('rake') + s.add_development_dependency('rubocop', '~> 1.73.2') + s.add_development_dependency('rubocop-minitest', '~> 0.37.1') + s.add_development_dependency('sorbet', '~> 0.6.12872') + s.add_development_dependency('tapioca', '~> 0.17.10') + s.add_development_dependency('tsort', '~> 0.2.0') end diff --git a/rbi/moderation_api/client.rbi b/rbi/moderation_api/client.rbi deleted file mode 100644 index b1474fa7..00000000 --- a/rbi/moderation_api/client.rbi +++ /dev/null @@ -1,78 +0,0 @@ -# typed: strong - -module ModerationAPI - class Client < ModerationAPI::Internal::Transport::BaseClient - DEFAULT_MAX_RETRIES = 2 - - DEFAULT_TIMEOUT_IN_SECONDS = T.let(60.0, Float) - - DEFAULT_INITIAL_RETRY_DELAY = T.let(0.5, Float) - - DEFAULT_MAX_RETRY_DELAY = T.let(8.0, Float) - - sig { returns(String) } - attr_reader :secret_key - - sig { returns(ModerationAPI::Resources::Authors) } - attr_reader :authors - - sig { returns(ModerationAPI::Resources::Queue) } - attr_reader :queue - - sig { returns(ModerationAPI::Resources::Actions) } - attr_reader :actions - - sig { returns(ModerationAPI::Resources::Content) } - attr_reader :content - - sig { returns(ModerationAPI::Resources::Account) } - attr_reader :account - - sig { returns(ModerationAPI::Resources::Auth) } - attr_reader :auth - - sig { returns(ModerationAPI::Resources::Wordlist) } - attr_reader :wordlist - - sig { returns(ModerationAPI::Resources::Webhooks) } - attr_reader :webhooks - - sig { returns(ModerationAPI::Resources::WebhookSecret) } - attr_reader :webhook_secret - - # @api private - sig { override.returns(T::Hash[String, String]) } - private def auth_headers - end - - # @api private - sig { returns(T::Boolean) } - def base_url_overridden? - end - - # Creates and returns a new client for interacting with the API. - sig do - params( - secret_key: T.nilable(String), - base_url: T.nilable(String), - max_retries: Integer, - timeout: Float, - initial_retry_delay: Float, - max_retry_delay: Float - ).returns(T.attached_class) - end - def self.new( - # Defaults to `ENV["MODAPI_SECRET_KEY"]` - secret_key: ENV["MODAPI_SECRET_KEY"], - # Override the default base URL for the API, e.g., - # `"https://api.example.com/v2/"`. Defaults to `ENV["MODERATION_API_BASE_URL"]` - base_url: ENV["MODERATION_API_BASE_URL"], - # Max number of retries to attempt after a failed retryable request. - max_retries: ModerationAPI::Client::DEFAULT_MAX_RETRIES, - timeout: ModerationAPI::Client::DEFAULT_TIMEOUT_IN_SECONDS, - initial_retry_delay: ModerationAPI::Client::DEFAULT_INITIAL_RETRY_DELAY, - max_retry_delay: ModerationAPI::Client::DEFAULT_MAX_RETRY_DELAY - ) - end - end -end diff --git a/rbi/moderation_api/errors.rbi b/rbi/moderation_api/errors.rbi deleted file mode 100644 index 776022c6..00000000 --- a/rbi/moderation_api/errors.rbi +++ /dev/null @@ -1,205 +0,0 @@ -# typed: strong - -module ModerationAPI - module Errors - class Error < StandardError - sig { returns(T.nilable(StandardError)) } - attr_accessor :cause - end - - class ConversionError < ModerationAPI::Errors::Error - sig { returns(T.nilable(StandardError)) } - def cause - end - - # @api private - sig do - params( - on: T::Class[StandardError], - method: Symbol, - target: T.anything, - value: T.anything, - cause: T.nilable(StandardError) - ).returns(T.attached_class) - end - def self.new(on:, method:, target:, value:, cause: nil) - end - end - - class APIError < ModerationAPI::Errors::Error - sig { returns(URI::Generic) } - attr_accessor :url - - sig { returns(T.nilable(Integer)) } - attr_accessor :status - - sig { returns(T.nilable(T::Hash[String, String])) } - attr_accessor :headers - - sig { returns(T.nilable(T.anything)) } - attr_accessor :body - - # @api private - sig do - params( - url: URI::Generic, - status: T.nilable(Integer), - headers: T.nilable(T::Hash[String, String]), - body: T.nilable(Object), - request: NilClass, - response: NilClass, - message: T.nilable(String) - ).returns(T.attached_class) - end - def self.new( - url:, - status: nil, - headers: nil, - body: nil, - request: nil, - response: nil, - message: nil - ) - end - end - - class APIConnectionError < ModerationAPI::Errors::APIError - sig { returns(NilClass) } - attr_accessor :status - - sig { returns(NilClass) } - attr_accessor :body - - # @api private - sig do - params( - url: URI::Generic, - status: NilClass, - headers: T.nilable(T::Hash[String, String]), - body: NilClass, - request: NilClass, - response: NilClass, - message: T.nilable(String) - ).returns(T.attached_class) - end - def self.new( - url:, - status: nil, - headers: nil, - body: nil, - request: nil, - response: nil, - message: "Connection error." - ) - end - end - - class APITimeoutError < ModerationAPI::Errors::APIConnectionError - # @api private - sig do - params( - url: URI::Generic, - status: NilClass, - headers: T.nilable(T::Hash[String, String]), - body: NilClass, - request: NilClass, - response: NilClass, - message: T.nilable(String) - ).returns(T.attached_class) - end - def self.new( - url:, - status: nil, - headers: nil, - body: nil, - request: nil, - response: nil, - message: "Request timed out." - ) - end - end - - class APIStatusError < ModerationAPI::Errors::APIError - # @api private - sig do - params( - url: URI::Generic, - status: Integer, - headers: T.nilable(T::Hash[String, String]), - body: T.nilable(Object), - request: NilClass, - response: NilClass, - message: T.nilable(String) - ).returns(T.attached_class) - end - def self.for( - url:, - status:, - headers:, - body:, - request:, - response:, - message: nil - ) - end - - sig { returns(Integer) } - attr_accessor :status - - # @api private - sig do - params( - url: URI::Generic, - status: Integer, - headers: T.nilable(T::Hash[String, String]), - body: T.nilable(Object), - request: NilClass, - response: NilClass, - message: T.nilable(String) - ).returns(T.attached_class) - end - def self.new( - url:, - status:, - headers:, - body:, - request:, - response:, - message: nil - ) - end - end - - class BadRequestError < ModerationAPI::Errors::APIStatusError - HTTP_STATUS = 400 - end - - class AuthenticationError < ModerationAPI::Errors::APIStatusError - HTTP_STATUS = 401 - end - - class PermissionDeniedError < ModerationAPI::Errors::APIStatusError - HTTP_STATUS = 403 - end - - class NotFoundError < ModerationAPI::Errors::APIStatusError - HTTP_STATUS = 404 - end - - class ConflictError < ModerationAPI::Errors::APIStatusError - HTTP_STATUS = 409 - end - - class UnprocessableEntityError < ModerationAPI::Errors::APIStatusError - HTTP_STATUS = 422 - end - - class RateLimitError < ModerationAPI::Errors::APIStatusError - HTTP_STATUS = 429 - end - - class InternalServerError < ModerationAPI::Errors::APIStatusError - HTTP_STATUS = T.let((500..), T::Range[Integer]) - end - end -end diff --git a/rbi/moderation_api/file_part.rbi b/rbi/moderation_api/file_part.rbi deleted file mode 100644 index a0d33317..00000000 --- a/rbi/moderation_api/file_part.rbi +++ /dev/null @@ -1,37 +0,0 @@ -# typed: strong - -module ModerationAPI - class FilePart - sig { returns(T.any(Pathname, StringIO, IO, String)) } - attr_reader :content - - sig { returns(T.nilable(String)) } - attr_reader :content_type - - sig { returns(T.nilable(String)) } - attr_reader :filename - - # @api private - sig { returns(String) } - private def read - end - - sig { params(a: T.anything).returns(String) } - def to_json(*a) - end - - sig { params(a: T.anything).returns(String) } - def to_yaml(*a) - end - - sig do - params( - content: T.any(Pathname, StringIO, IO, String), - filename: T.nilable(T.any(Pathname, String)), - content_type: T.nilable(String) - ).returns(T.attached_class) - end - def self.new(content, filename: nil, content_type: nil) - end - end -end diff --git a/rbi/moderation_api/internal.rbi b/rbi/moderation_api/internal.rbi deleted file mode 100644 index fb3d8fa2..00000000 --- a/rbi/moderation_api/internal.rbi +++ /dev/null @@ -1,18 +0,0 @@ -# typed: strong - -module ModerationAPI - module Internal - extend ModerationAPI::Internal::Util::SorbetRuntimeSupport - - # Due to the current WIP status of Shapes support in Sorbet, types referencing - # this alias might be refined in the future. - AnyHash = T.type_alias { T::Hash[Symbol, T.anything] } - - FileInput = - T.type_alias do - T.any(Pathname, StringIO, IO, String, ModerationAPI::FilePart) - end - - OMIT = T.let(Object.new.freeze, T.anything) - end -end diff --git a/rbi/moderation_api/internal/transport/base_client.rbi b/rbi/moderation_api/internal/transport/base_client.rbi deleted file mode 100644 index 51736187..00000000 --- a/rbi/moderation_api/internal/transport/base_client.rbi +++ /dev/null @@ -1,305 +0,0 @@ -# typed: strong - -module ModerationAPI - module Internal - module Transport - # @api private - class BaseClient - extend ModerationAPI::Internal::Util::SorbetRuntimeSupport - - abstract! - - RequestComponents = - T.type_alias do - { - method: Symbol, - path: T.any(String, T::Array[String]), - query: - T.nilable( - T::Hash[String, T.nilable(T.any(T::Array[String], String))] - ), - headers: - T.nilable( - T::Hash[ - String, - T.nilable( - T.any( - String, - Integer, - T::Array[T.nilable(T.any(String, Integer))] - ) - ) - ] - ), - body: T.nilable(T.anything), - unwrap: - T.nilable( - T.any( - Symbol, - Integer, - T::Array[T.any(Symbol, Integer)], - T.proc.params(arg0: T.anything).returns(T.anything) - ) - ), - page: - T.nilable( - T::Class[ - ModerationAPI::Internal::Type::BasePage[ - ModerationAPI::Internal::Type::BaseModel - ] - ] - ), - stream: T.nilable(T::Class[T.anything]), - model: T.nilable(ModerationAPI::Internal::Type::Converter::Input), - options: T.nilable(ModerationAPI::RequestOptions::OrHash) - } - end - - RequestInput = - T.type_alias do - { - method: Symbol, - url: URI::Generic, - headers: T::Hash[String, String], - body: T.anything, - max_retries: Integer, - timeout: Float - } - end - - # from whatwg fetch spec - MAX_REDIRECTS = 20 - - PLATFORM_HEADERS = T::Hash[String, String] - - class << self - # @api private - sig do - params( - req: - ModerationAPI::Internal::Transport::BaseClient::RequestComponents - ).void - end - def validate!(req) - end - - # @api private - sig do - params(status: Integer, headers: T::Hash[String, String]).returns( - T::Boolean - ) - end - def should_retry?(status, headers:) - end - - # @api private - sig do - params( - request: - ModerationAPI::Internal::Transport::BaseClient::RequestInput, - status: Integer, - response_headers: T::Hash[String, String] - ).returns( - ModerationAPI::Internal::Transport::BaseClient::RequestInput - ) - end - def follow_redirect(request, status:, response_headers:) - end - - # @api private - sig do - params( - status: T.any(Integer, ModerationAPI::Errors::APIConnectionError), - stream: T.nilable(T::Enumerable[String]) - ).void - end - def reap_connection!(status, stream:) - end - end - - sig { returns(URI::Generic) } - attr_reader :base_url - - sig { returns(Float) } - attr_reader :timeout - - sig { returns(Integer) } - attr_reader :max_retries - - sig { returns(Float) } - attr_reader :initial_retry_delay - - sig { returns(Float) } - attr_reader :max_retry_delay - - sig { returns(T::Hash[String, String]) } - attr_reader :headers - - sig { returns(T.nilable(String)) } - attr_reader :idempotency_header - - # @api private - sig { returns(ModerationAPI::Internal::Transport::PooledNetRequester) } - attr_reader :requester - - # @api private - sig do - params( - base_url: String, - timeout: Float, - max_retries: Integer, - initial_retry_delay: Float, - max_retry_delay: Float, - headers: - T::Hash[ - String, - T.nilable( - T.any( - String, - Integer, - T::Array[T.nilable(T.any(String, Integer))] - ) - ) - ], - idempotency_header: T.nilable(String) - ).returns(T.attached_class) - end - def self.new( - base_url:, - timeout: 0.0, - max_retries: 0, - initial_retry_delay: 0.0, - max_retry_delay: 0.0, - headers: {}, - idempotency_header: nil - ) - end - - # @api private - sig { overridable.returns(T::Hash[String, String]) } - private def auth_headers - end - - # @api private - sig { returns(String) } - private def user_agent - end - - # @api private - sig { returns(String) } - private def generate_idempotency_key - end - - # @api private - sig do - overridable - .params( - req: - ModerationAPI::Internal::Transport::BaseClient::RequestComponents, - opts: ModerationAPI::Internal::AnyHash - ) - .returns( - ModerationAPI::Internal::Transport::BaseClient::RequestInput - ) - end - private def build_request(req, opts) - end - - # @api private - sig do - params( - headers: T::Hash[String, String], - retry_count: Integer - ).returns(Float) - end - private def retry_delay(headers, retry_count:) - end - - # @api private - sig do - params( - request: - ModerationAPI::Internal::Transport::BaseClient::RequestInput, - redirect_count: Integer, - retry_count: Integer, - send_retry_header: T::Boolean - ).returns([Integer, Net::HTTPResponse, T::Enumerable[String]]) - end - def send_request( - request, - redirect_count:, - retry_count:, - send_retry_header: - ) - end - - # Execute the request specified by `req`. This is the method that all resource - # methods call into. - # - # @overload request(method, path, query: {}, headers: {}, body: nil, unwrap: nil, page: nil, stream: nil, model: ModerationAPI::Internal::Type::Unknown, options: {}) - sig do - params( - method: Symbol, - path: T.any(String, T::Array[String]), - query: - T.nilable( - T::Hash[String, T.nilable(T.any(T::Array[String], String))] - ), - headers: - T.nilable( - T::Hash[ - String, - T.nilable( - T.any( - String, - Integer, - T::Array[T.nilable(T.any(String, Integer))] - ) - ) - ] - ), - body: T.nilable(T.anything), - unwrap: - T.nilable( - T.any( - Symbol, - Integer, - T::Array[T.any(Symbol, Integer)], - T.proc.params(arg0: T.anything).returns(T.anything) - ) - ), - page: - T.nilable( - T::Class[ - ModerationAPI::Internal::Type::BasePage[ - ModerationAPI::Internal::Type::BaseModel - ] - ] - ), - stream: T.nilable(T::Class[T.anything]), - model: T.nilable(ModerationAPI::Internal::Type::Converter::Input), - options: T.nilable(ModerationAPI::RequestOptions::OrHash) - ).returns(T.anything) - end - def request( - method, - path, - query: {}, - headers: {}, - body: nil, - unwrap: nil, - page: nil, - stream: nil, - model: ModerationAPI::Internal::Type::Unknown, - options: {} - ) - end - - # @api private - sig { returns(String) } - def inspect - end - end - end - end -end diff --git a/rbi/moderation_api/internal/transport/pooled_net_requester.rbi b/rbi/moderation_api/internal/transport/pooled_net_requester.rbi deleted file mode 100644 index 1b7afaeb..00000000 --- a/rbi/moderation_api/internal/transport/pooled_net_requester.rbi +++ /dev/null @@ -1,84 +0,0 @@ -# typed: strong - -module ModerationAPI - module Internal - module Transport - # @api private - class PooledNetRequester - extend ModerationAPI::Internal::Util::SorbetRuntimeSupport - - Request = - T.type_alias do - { - method: Symbol, - url: URI::Generic, - headers: T::Hash[String, String], - body: T.anything, - deadline: Float - } - end - - # from the golang stdlib - # https://github.com/golang/go/blob/c8eced8580028328fde7c03cbfcb720ce15b2358/src/net/http/transport.go#L49 - KEEP_ALIVE_TIMEOUT = 30 - - DEFAULT_MAX_CONNECTIONS = T.let(T.unsafe(nil), Integer) - - class << self - # @api private - sig do - params(cert_store: OpenSSL::X509::Store, url: URI::Generic).returns( - Net::HTTP - ) - end - def connect(cert_store:, url:) - end - - # @api private - sig { params(conn: Net::HTTP, deadline: Float).void } - def calibrate_socket_timeout(conn, deadline) - end - - # @api private - sig do - params( - request: - ModerationAPI::Internal::Transport::PooledNetRequester::Request, - blk: T.proc.params(arg0: String).void - ).returns([Net::HTTPGenericRequest, T.proc.void]) - end - def build_request(request, &blk) - end - end - - # @api private - sig do - params( - url: URI::Generic, - deadline: Float, - blk: T.proc.params(arg0: Net::HTTP).void - ).void - end - private def with_pool(url, deadline:, &blk) - end - - # @api private - sig do - params( - request: - ModerationAPI::Internal::Transport::PooledNetRequester::Request - ).returns([Integer, Net::HTTPResponse, T::Enumerable[String]]) - end - def execute(request) - end - - # @api private - sig { params(size: Integer).returns(T.attached_class) } - def self.new( - size: ModerationAPI::Internal::Transport::PooledNetRequester::DEFAULT_MAX_CONNECTIONS - ) - end - end - end - end -end diff --git a/rbi/moderation_api/internal/type/array_of.rbi b/rbi/moderation_api/internal/type/array_of.rbi deleted file mode 100644 index 12483e19..00000000 --- a/rbi/moderation_api/internal/type/array_of.rbi +++ /dev/null @@ -1,104 +0,0 @@ -# typed: strong - -module ModerationAPI - module Internal - module Type - # @api private - # - # Array of items of a given type. - class ArrayOf - include ModerationAPI::Internal::Type::Converter - include ModerationAPI::Internal::Util::SorbetRuntimeSupport - - abstract! - - Elem = type_member(:out) - - sig do - params( - type_info: - T.any( - ModerationAPI::Internal::AnyHash, - T.proc.returns(ModerationAPI::Internal::Type::Converter::Input), - ModerationAPI::Internal::Type::Converter::Input - ), - spec: ModerationAPI::Internal::AnyHash - ).returns(T.attached_class) - end - def self.[](type_info, spec = {}) - end - - sig { params(other: T.anything).returns(T::Boolean) } - def ===(other) - end - - sig { params(other: T.anything).returns(T::Boolean) } - def ==(other) - end - - sig { returns(Integer) } - def hash - end - - # @api private - sig do - override - .params( - value: T.any(T::Array[T.anything], T.anything), - state: ModerationAPI::Internal::Type::Converter::CoerceState - ) - .returns(T.any(T::Array[T.anything], T.anything)) - end - def coerce(value, state:) - end - - # @api private - sig do - override - .params( - value: T.any(T::Array[T.anything], T.anything), - state: ModerationAPI::Internal::Type::Converter::DumpState - ) - .returns(T.any(T::Array[T.anything], T.anything)) - end - def dump(value, state:) - end - - # @api private - sig { returns(T.anything) } - def to_sorbet_type - end - - # @api private - sig { returns(Elem) } - protected def item_type - end - - # @api private - sig { returns(T::Boolean) } - protected def nilable? - end - - # @api private - sig do - params( - type_info: - T.any( - ModerationAPI::Internal::AnyHash, - T.proc.returns(ModerationAPI::Internal::Type::Converter::Input), - ModerationAPI::Internal::Type::Converter::Input - ), - spec: ModerationAPI::Internal::AnyHash - ).void - end - def initialize(type_info, spec = {}) - end - - # @api private - sig { params(depth: Integer).returns(String) } - def inspect(depth: 0) - end - end - end - end -end diff --git a/rbi/moderation_api/internal/type/base_model.rbi b/rbi/moderation_api/internal/type/base_model.rbi deleted file mode 100644 index 188390cf..00000000 --- a/rbi/moderation_api/internal/type/base_model.rbi +++ /dev/null @@ -1,314 +0,0 @@ -# typed: strong - -module ModerationAPI - module Internal - module Type - class BaseModel - extend ModerationAPI::Internal::Type::Converter - extend ModerationAPI::Internal::Util::SorbetRuntimeSupport - - abstract! - - KnownField = - T.type_alias do - { - mode: T.nilable(Symbol), - required: T::Boolean, - nilable: T::Boolean - } - end - - OrHash = - T.type_alias do - T.any( - ModerationAPI::Internal::Type::BaseModel, - ModerationAPI::Internal::AnyHash - ) - end - - class << self - # @api private - # - # Assumes superclass fields are totally defined before fields are accessed / - # defined on subclasses. - sig { params(child: ModerationAPI::Internal::Type::BaseModel).void } - def inherited(child) - end - - # @api private - sig do - returns( - T::Hash[ - Symbol, - T.all( - ModerationAPI::Internal::Type::BaseModel::KnownField, - { - type_fn: - T.proc.returns( - ModerationAPI::Internal::Type::Converter::Input - ) - } - ) - ] - ) - end - def known_fields - end - - # @api private - sig do - returns( - T::Hash[ - Symbol, - T.all( - ModerationAPI::Internal::Type::BaseModel::KnownField, - { type: ModerationAPI::Internal::Type::Converter::Input } - ) - ] - ) - end - def fields - end - - # @api private - sig do - params( - name_sym: Symbol, - required: T::Boolean, - type_info: - T.any( - { - const: - T.nilable( - T.any(NilClass, T::Boolean, Integer, Float, Symbol) - ), - enum: - T.nilable( - T.proc.returns( - ModerationAPI::Internal::Type::Converter::Input - ) - ), - union: - T.nilable( - T.proc.returns( - ModerationAPI::Internal::Type::Converter::Input - ) - ), - api_name: Symbol, - nil?: T::Boolean - }, - T.proc.returns( - ModerationAPI::Internal::Type::Converter::Input - ), - ModerationAPI::Internal::Type::Converter::Input - ), - spec: ModerationAPI::Internal::AnyHash - ).void - end - private def add_field(name_sym, required:, type_info:, spec:) - end - - # @api private - sig do - params( - name_sym: Symbol, - type_info: - T.any( - ModerationAPI::Internal::AnyHash, - T.proc.returns( - ModerationAPI::Internal::Type::Converter::Input - ), - ModerationAPI::Internal::Type::Converter::Input - ), - spec: ModerationAPI::Internal::AnyHash - ).void - end - def required(name_sym, type_info, spec = {}) - end - - # @api private - sig do - params( - name_sym: Symbol, - type_info: - T.any( - ModerationAPI::Internal::AnyHash, - T.proc.returns( - ModerationAPI::Internal::Type::Converter::Input - ), - ModerationAPI::Internal::Type::Converter::Input - ), - spec: ModerationAPI::Internal::AnyHash - ).void - end - def optional(name_sym, type_info, spec = {}) - end - - # @api private - # - # `request_only` attributes not excluded from `.#coerce` when receiving responses - # even if well behaved servers should not send them - sig { params(blk: T.proc.void).void } - private def request_only(&blk) - end - - # @api private - # - # `response_only` attributes are omitted from `.#dump` when making requests - sig { params(blk: T.proc.void).void } - private def response_only(&blk) - end - - sig { params(other: T.anything).returns(T::Boolean) } - def ==(other) - end - - sig { returns(Integer) } - def hash - end - end - - sig { params(other: T.anything).returns(T::Boolean) } - def ==(other) - end - - sig { returns(Integer) } - def hash - end - - class << self - # @api private - sig do - override - .params( - value: - T.any( - ModerationAPI::Internal::Type::BaseModel, - T::Hash[T.anything, T.anything], - T.anything - ), - state: ModerationAPI::Internal::Type::Converter::CoerceState - ) - .returns(T.any(T.attached_class, T.anything)) - end - def coerce(value, state:) - end - - # @api private - sig do - override - .params( - value: T.any(T.attached_class, T.anything), - state: ModerationAPI::Internal::Type::Converter::DumpState - ) - .returns(T.any(T::Hash[T.anything, T.anything], T.anything)) - end - def dump(value, state:) - end - - # @api private - sig { returns(T.anything) } - def to_sorbet_type - end - end - - class << self - # @api private - sig do - params( - model: ModerationAPI::Internal::Type::BaseModel, - convert: T::Boolean - ).returns(ModerationAPI::Internal::AnyHash) - end - def recursively_to_h(model, convert:) - end - end - - # Returns the raw value associated with the given key, if found. Otherwise, nil is - # returned. - # - # It is valid to lookup keys that are not in the API spec, for example to access - # undocumented features. This method does not parse response data into - # higher-level types. Lookup by anything other than a Symbol is an ArgumentError. - sig { params(key: Symbol).returns(T.nilable(T.anything)) } - def [](key) - end - - # Returns a Hash of the data underlying this object. O(1) - # - # Keys are Symbols and values are the raw values from the response. The return - # value indicates which values were ever set on the object. i.e. there will be a - # key in this hash if they ever were, even if the set value was nil. - # - # This method is not recursive. The returned value is shared by the object, so it - # should not be mutated. - sig { overridable.returns(ModerationAPI::Internal::AnyHash) } - def to_h - end - - # Returns a Hash of the data underlying this object. O(1) - # - # Keys are Symbols and values are the raw values from the response. The return - # value indicates which values were ever set on the object. i.e. there will be a - # key in this hash if they ever were, even if the set value was nil. - # - # This method is not recursive. The returned value is shared by the object, so it - # should not be mutated. - sig { overridable.returns(ModerationAPI::Internal::AnyHash) } - def to_hash - end - - # In addition to the behaviour of `#to_h`, this method will recursively call - # `#to_h` on nested models. - sig { overridable.returns(ModerationAPI::Internal::AnyHash) } - def deep_to_h - end - - sig do - params(keys: T.nilable(T::Array[Symbol])).returns( - ModerationAPI::Internal::AnyHash - ) - end - def deconstruct_keys(keys) - end - - sig { params(a: T.anything).returns(String) } - def to_json(*a) - end - - sig { params(a: T.anything).returns(String) } - def to_yaml(*a) - end - - # Create a new instance of a model. - sig do - params( - data: - T.any( - T::Hash[Symbol, T.anything], - ModerationAPI::Internal::Type::BaseModel - ) - ).returns(T.attached_class) - end - def self.new(data = {}) - end - - class << self - # @api private - sig { params(depth: Integer).returns(String) } - def inspect(depth: 0) - end - end - - sig { returns(String) } - def to_s - end - - # @api private - sig { returns(String) } - def inspect - end - end - end - end -end diff --git a/rbi/moderation_api/internal/type/base_page.rbi b/rbi/moderation_api/internal/type/base_page.rbi deleted file mode 100644 index 262b320f..00000000 --- a/rbi/moderation_api/internal/type/base_page.rbi +++ /dev/null @@ -1,43 +0,0 @@ -# typed: strong - -module ModerationAPI - module Internal - module Type - # @api private - # - # This module provides a base implementation for paginated responses in the SDK. - module BasePage - Elem = type_member(:out) - - sig { overridable.returns(T::Boolean) } - def next_page? - end - - sig { overridable.returns(T.self_type) } - def next_page - end - - sig { overridable.params(blk: T.proc.params(arg0: Elem).void).void } - def auto_paging_each(&blk) - end - - sig { returns(T::Enumerable[Elem]) } - def to_enum - end - - # @api private - sig do - params( - client: ModerationAPI::Internal::Transport::BaseClient, - req: - ModerationAPI::Internal::Transport::BaseClient::RequestComponents, - headers: T::Hash[String, String], - page_data: T.anything - ).void - end - def initialize(client:, req:, headers:, page_data:) - end - end - end - end -end diff --git a/rbi/moderation_api/internal/type/boolean.rbi b/rbi/moderation_api/internal/type/boolean.rbi deleted file mode 100644 index dae3ec63..00000000 --- a/rbi/moderation_api/internal/type/boolean.rbi +++ /dev/null @@ -1,58 +0,0 @@ -# typed: strong - -module ModerationAPI - module Internal - module Type - # @api private - # - # Ruby has no Boolean class; this is something for models to refer to. - class Boolean - extend ModerationAPI::Internal::Type::Converter - extend ModerationAPI::Internal::Util::SorbetRuntimeSupport - - abstract! - - sig { params(other: T.anything).returns(T::Boolean) } - def self.===(other) - end - - sig { params(other: T.anything).returns(T::Boolean) } - def self.==(other) - end - - class << self - # @api private - # - # Coerce value to Boolean if possible, otherwise return the original value. - sig do - override - .params( - value: T.any(T::Boolean, T.anything), - state: ModerationAPI::Internal::Type::Converter::CoerceState - ) - .returns(T.any(T::Boolean, T.anything)) - end - def coerce(value, state:) - end - - # @api private - sig do - override - .params( - value: T.any(T::Boolean, T.anything), - state: ModerationAPI::Internal::Type::Converter::DumpState - ) - .returns(T.any(T::Boolean, T.anything)) - end - def dump(value, state:) - end - - # @api private - sig { returns(T.anything) } - def to_sorbet_type - end - end - end - end - end -end diff --git a/rbi/moderation_api/internal/type/converter.rbi b/rbi/moderation_api/internal/type/converter.rbi deleted file mode 100644 index 3a12ae91..00000000 --- a/rbi/moderation_api/internal/type/converter.rbi +++ /dev/null @@ -1,225 +0,0 @@ -# typed: strong - -module ModerationAPI - module Internal - module Type - # @api private - module Converter - extend ModerationAPI::Internal::Util::SorbetRuntimeSupport - - Input = - T.type_alias do - T.any( - ModerationAPI::Internal::Type::Converter, - T::Class[T.anything] - ) - end - - CoerceState = - T.type_alias do - { - translate_names: T::Boolean, - strictness: T::Boolean, - exactness: { - yes: Integer, - no: Integer, - maybe: Integer - }, - error: T::Class[StandardError], - branched: Integer - } - end - - DumpState = T.type_alias { { can_retry: T::Boolean } } - - # @api private - sig do - overridable - .params( - value: T.anything, - state: ModerationAPI::Internal::Type::Converter::CoerceState - ) - .returns(T.anything) - end - def coerce(value, state:) - end - - # @api private - sig do - overridable - .params( - value: T.anything, - state: ModerationAPI::Internal::Type::Converter::DumpState - ) - .returns(T.anything) - end - def dump(value, state:) - end - - # @api private - sig { params(depth: Integer).returns(String) } - def inspect(depth: 0) - end - - class << self - # @api private - sig do - params( - spec: - T.any( - { - const: - T.nilable( - T.any(NilClass, T::Boolean, Integer, Float, Symbol) - ), - enum: - T.nilable( - T.proc.returns( - ModerationAPI::Internal::Type::Converter::Input - ) - ), - union: - T.nilable( - T.proc.returns( - ModerationAPI::Internal::Type::Converter::Input - ) - ) - }, - T.proc.returns( - ModerationAPI::Internal::Type::Converter::Input - ), - ModerationAPI::Internal::Type::Converter::Input - ) - ).returns(T.proc.returns(T.anything)) - end - def self.type_info(spec) - end - - # @api private - sig do - params( - type_info: - T.any( - { - const: - T.nilable( - T.any(NilClass, T::Boolean, Integer, Float, Symbol) - ), - enum: - T.nilable( - T.proc.returns( - ModerationAPI::Internal::Type::Converter::Input - ) - ), - union: - T.nilable( - T.proc.returns( - ModerationAPI::Internal::Type::Converter::Input - ) - ) - }, - T.proc.returns( - ModerationAPI::Internal::Type::Converter::Input - ), - ModerationAPI::Internal::Type::Converter::Input - ), - spec: - T.any( - { - const: - T.nilable( - T.any(NilClass, T::Boolean, Integer, Float, Symbol) - ), - enum: - T.nilable( - T.proc.returns( - ModerationAPI::Internal::Type::Converter::Input - ) - ), - union: - T.nilable( - T.proc.returns( - ModerationAPI::Internal::Type::Converter::Input - ) - ) - }, - T.proc.returns( - ModerationAPI::Internal::Type::Converter::Input - ), - ModerationAPI::Internal::Type::Converter::Input - ) - ).returns(ModerationAPI::Internal::AnyHash) - end - def self.meta_info(type_info, spec) - end - - # @api private - sig do - params(translate_names: T::Boolean).returns( - ModerationAPI::Internal::Type::Converter::CoerceState - ) - end - def self.new_coerce_state(translate_names: true) - end - - # @api private - # - # Based on `target`, transform `value` into `target`, to the extent possible: - # - # 1. if the given `value` conforms to `target` already, return the given `value` - # 2. if it's possible and safe to convert the given `value` to `target`, then the - # converted value - # 3. otherwise, the given `value` unaltered - # - # The coercion process is subject to improvement between minor release versions. - # See https://docs.pydantic.dev/latest/concepts/unions/#smart-mode - sig do - params( - target: ModerationAPI::Internal::Type::Converter::Input, - value: T.anything, - state: ModerationAPI::Internal::Type::Converter::CoerceState - ).returns(T.anything) - end - def self.coerce( - target, - value, - # The `strictness` is one of `true`, `false`. This informs the coercion strategy - # when we have to decide between multiple possible conversion targets: - # - # - `true`: the conversion must be exact, with minimum coercion. - # - `false`: the conversion can be approximate, with some coercion. - # - # The `exactness` is `Hash` with keys being one of `yes`, `no`, or `maybe`. For - # any given conversion attempt, the exactness will be updated based on how closely - # the value recursively matches the target type: - # - # - `yes`: the value can be converted to the target type with minimum coercion. - # - `maybe`: the value can be converted to the target type with some reasonable - # coercion. - # - `no`: the value cannot be converted to the target type. - # - # See implementation below for more details. - state: ModerationAPI::Internal::Type::Converter.new_coerce_state - ) - end - - # @api private - sig do - params( - target: ModerationAPI::Internal::Type::Converter::Input, - value: T.anything, - state: ModerationAPI::Internal::Type::Converter::DumpState - ).returns(T.anything) - end - def self.dump(target, value, state: { can_retry: true }) - end - - # @api private - sig { params(target: T.anything, depth: Integer).returns(String) } - def self.inspect(target, depth:) - end - end - end - end - end -end diff --git a/rbi/moderation_api/internal/type/enum.rbi b/rbi/moderation_api/internal/type/enum.rbi deleted file mode 100644 index cc6549f4..00000000 --- a/rbi/moderation_api/internal/type/enum.rbi +++ /dev/null @@ -1,82 +0,0 @@ -# typed: strong - -module ModerationAPI - module Internal - module Type - # @api private - # - # A value from among a specified list of options. OpenAPI enum values map to Ruby - # values in the SDK as follows: - # - # 1. boolean => true | false - # 2. integer => Integer - # 3. float => Float - # 4. string => Symbol - # - # We can therefore convert string values to Symbols, but can't convert other - # values safely. - module Enum - include ModerationAPI::Internal::Type::Converter - include ModerationAPI::Internal::Util::SorbetRuntimeSupport - - # All of the valid Symbol values for this enum. - sig do - overridable.returns( - T::Array[T.any(NilClass, T::Boolean, Integer, Float, Symbol)] - ) - end - def values - end - - sig { params(other: T.anything).returns(T::Boolean) } - def ===(other) - end - - sig { params(other: T.anything).returns(T::Boolean) } - def ==(other) - end - - sig { returns(Integer) } - def hash - end - - # @api private - # - # Unlike with primitives, `Enum` additionally validates that the value is a member - # of the enum. - sig do - override - .params( - value: T.any(String, Symbol, T.anything), - state: ModerationAPI::Internal::Type::Converter::CoerceState - ) - .returns(T.any(Symbol, T.anything)) - end - def coerce(value, state:) - end - - # @api private - sig do - override - .params( - value: T.any(Symbol, T.anything), - state: ModerationAPI::Internal::Type::Converter::DumpState - ) - .returns(T.any(Symbol, T.anything)) - end - def dump(value, state:) - end - - # @api private - sig { returns(T.anything) } - def to_sorbet_type - end - - # @api private - sig { params(depth: Integer).returns(String) } - def inspect(depth: 0) - end - end - end - end -end diff --git a/rbi/moderation_api/internal/type/file_input.rbi b/rbi/moderation_api/internal/type/file_input.rbi deleted file mode 100644 index a5a8d9be..00000000 --- a/rbi/moderation_api/internal/type/file_input.rbi +++ /dev/null @@ -1,59 +0,0 @@ -# typed: strong - -module ModerationAPI - module Internal - module Type - # @api private - # - # Either `Pathname` or `StringIO`, or `IO`, or - # `ModerationAPI::Internal::Type::FileInput`. - # - # Note: when `IO` is used, all retries are disabled, since many IO` streams are - # not rewindable. - class FileInput - extend ModerationAPI::Internal::Type::Converter - - abstract! - - sig { params(other: T.anything).returns(T::Boolean) } - def self.===(other) - end - - sig { params(other: T.anything).returns(T::Boolean) } - def self.==(other) - end - - class << self - # @api private - sig do - override - .params( - value: T.any(StringIO, String, T.anything), - state: ModerationAPI::Internal::Type::Converter::CoerceState - ) - .returns(T.any(StringIO, T.anything)) - end - def coerce(value, state:) - end - - # @api private - sig do - override - .params( - value: T.any(Pathname, StringIO, IO, String, T.anything), - state: ModerationAPI::Internal::Type::Converter::DumpState - ) - .returns(T.any(Pathname, StringIO, IO, String, T.anything)) - end - def dump(value, state:) - end - - # @api private - sig { returns(T.anything) } - def to_sorbet_type - end - end - end - end - end -end diff --git a/rbi/moderation_api/internal/type/hash_of.rbi b/rbi/moderation_api/internal/type/hash_of.rbi deleted file mode 100644 index 0e9dc0ce..00000000 --- a/rbi/moderation_api/internal/type/hash_of.rbi +++ /dev/null @@ -1,104 +0,0 @@ -# typed: strong - -module ModerationAPI - module Internal - module Type - # @api private - # - # Hash of items of a given type. - class HashOf - include ModerationAPI::Internal::Type::Converter - include ModerationAPI::Internal::Util::SorbetRuntimeSupport - - abstract! - - Elem = type_member(:out) - - sig do - params( - type_info: - T.any( - ModerationAPI::Internal::AnyHash, - T.proc.returns(ModerationAPI::Internal::Type::Converter::Input), - ModerationAPI::Internal::Type::Converter::Input - ), - spec: ModerationAPI::Internal::AnyHash - ).returns(T.attached_class) - end - def self.[](type_info, spec = {}) - end - - sig { params(other: T.anything).returns(T::Boolean) } - def ===(other) - end - - sig { params(other: T.anything).returns(T::Boolean) } - def ==(other) - end - - sig { returns(Integer) } - def hash - end - - # @api private - sig do - override - .params( - value: T.any(T::Hash[T.anything, T.anything], T.anything), - state: ModerationAPI::Internal::Type::Converter::CoerceState - ) - .returns(T.any(ModerationAPI::Internal::AnyHash, T.anything)) - end - def coerce(value, state:) - end - - # @api private - sig do - override - .params( - value: T.any(T::Hash[T.anything, T.anything], T.anything), - state: ModerationAPI::Internal::Type::Converter::DumpState - ) - .returns(T.any(ModerationAPI::Internal::AnyHash, T.anything)) - end - def dump(value, state:) - end - - # @api private - sig { returns(T.anything) } - def to_sorbet_type - end - - # @api private - sig { returns(Elem) } - protected def item_type - end - - # @api private - sig { returns(T::Boolean) } - protected def nilable? - end - - # @api private - sig do - params( - type_info: - T.any( - ModerationAPI::Internal::AnyHash, - T.proc.returns(ModerationAPI::Internal::Type::Converter::Input), - ModerationAPI::Internal::Type::Converter::Input - ), - spec: ModerationAPI::Internal::AnyHash - ).void - end - def initialize(type_info, spec = {}) - end - - # @api private - sig { params(depth: Integer).returns(String) } - def inspect(depth: 0) - end - end - end - end -end diff --git a/rbi/moderation_api/internal/type/request_parameters.rbi b/rbi/moderation_api/internal/type/request_parameters.rbi deleted file mode 100644 index 38b88d43..00000000 --- a/rbi/moderation_api/internal/type/request_parameters.rbi +++ /dev/null @@ -1,31 +0,0 @@ -# typed: strong - -module ModerationAPI - module Internal - module Type - # @api private - module RequestParameters - # Options to specify HTTP behaviour for this request. - sig { returns(ModerationAPI::RequestOptions) } - attr_reader :request_options - - sig do - params(request_options: ModerationAPI::RequestOptions::OrHash).void - end - attr_writer :request_options - - # @api private - module Converter - # @api private - sig do - params(params: T.anything).returns( - [T.anything, ModerationAPI::Internal::AnyHash] - ) - end - def dump_request(params) - end - end - end - end - end -end diff --git a/rbi/moderation_api/internal/type/union.rbi b/rbi/moderation_api/internal/type/union.rbi deleted file mode 100644 index 9a38113f..00000000 --- a/rbi/moderation_api/internal/type/union.rbi +++ /dev/null @@ -1,128 +0,0 @@ -# typed: strong - -module ModerationAPI - module Internal - module Type - # @api private - module Union - include ModerationAPI::Internal::Type::Converter - include ModerationAPI::Internal::Util::SorbetRuntimeSupport - - # @api private - # - # All of the specified variant info for this union. - sig do - returns( - T::Array[ - [ - T.nilable(Symbol), - T.proc.returns(ModerationAPI::Internal::Type::Converter::Input), - ModerationAPI::Internal::AnyHash - ] - ] - ) - end - private def known_variants - end - - # @api private - sig do - returns( - T::Array[ - [T.nilable(Symbol), T.anything, ModerationAPI::Internal::AnyHash] - ] - ) - end - protected def derefed_variants - end - - # All of the specified variants for this union. - sig { overridable.returns(T::Array[T.anything]) } - def variants - end - - # @api private - sig { params(property: Symbol).void } - private def discriminator(property) - end - - # @api private - sig do - params( - key: - T.any( - Symbol, - ModerationAPI::Internal::AnyHash, - T.proc.returns(T.anything), - T.anything - ), - spec: - T.any( - ModerationAPI::Internal::AnyHash, - T.proc.returns(T.anything), - T.anything - ) - ).void - end - private def variant(key, spec = nil) - end - - # @api private - sig { params(value: T.anything).returns(T.nilable(T.anything)) } - private def resolve_variant(value) - end - - sig { params(other: T.anything).returns(T::Boolean) } - def ===(other) - end - - sig { params(other: T.anything).returns(T::Boolean) } - def ==(other) - end - - sig { returns(Integer) } - def hash - end - - # @api private - # - # Tries to efficiently coerce the given value to one of the known variants. - # - # If the value cannot match any of the known variants, the coercion is considered - # non-viable and returns the original value. - sig do - override - .params( - value: T.anything, - state: ModerationAPI::Internal::Type::Converter::CoerceState - ) - .returns(T.anything) - end - def coerce(value, state:) - end - - # @api private - sig do - override - .params( - value: T.anything, - state: ModerationAPI::Internal::Type::Converter::DumpState - ) - .returns(T.anything) - end - def dump(value, state:) - end - - # @api private - sig { returns(T.anything) } - def to_sorbet_type - end - - # @api private - sig { params(depth: Integer).returns(String) } - def inspect(depth: 0) - end - end - end - end -end diff --git a/rbi/moderation_api/internal/type/unknown.rbi b/rbi/moderation_api/internal/type/unknown.rbi deleted file mode 100644 index 931751db..00000000 --- a/rbi/moderation_api/internal/type/unknown.rbi +++ /dev/null @@ -1,58 +0,0 @@ -# typed: strong - -module ModerationAPI - module Internal - module Type - # @api private - # - # When we don't know what to expect for the value. - class Unknown - extend ModerationAPI::Internal::Type::Converter - extend ModerationAPI::Internal::Util::SorbetRuntimeSupport - - abstract! - - sig { params(other: T.anything).returns(T::Boolean) } - def self.===(other) - end - - sig { params(other: T.anything).returns(T::Boolean) } - def self.==(other) - end - - class << self - # @api private - # - # No coercion needed for Unknown type. - sig do - override - .params( - value: T.anything, - state: ModerationAPI::Internal::Type::Converter::CoerceState - ) - .returns(T.anything) - end - def coerce(value, state:) - end - - # @api private - sig do - override - .params( - value: T.anything, - state: ModerationAPI::Internal::Type::Converter::DumpState - ) - .returns(T.anything) - end - def dump(value, state:) - end - - # @api private - sig { returns(T.anything) } - def to_sorbet_type - end - end - end - end - end -end diff --git a/rbi/moderation_api/internal/util.rbi b/rbi/moderation_api/internal/util.rbi deleted file mode 100644 index 9acf9e11..00000000 --- a/rbi/moderation_api/internal/util.rbi +++ /dev/null @@ -1,515 +0,0 @@ -# typed: strong - -module ModerationAPI - module Internal - # @api private - module Util - extend ModerationAPI::Internal::Util::SorbetRuntimeSupport - - # @api private - sig { returns(Float) } - def self.monotonic_secs - end - - # @api private - sig do - params(ns: T.any(Module, T::Class[T.anything])).returns( - T::Enumerable[T.any(Module, T::Class[T.anything])] - ) - end - def self.walk_namespaces(ns) - end - - class << self - # @api private - sig { returns(String) } - def arch - end - - # @api private - sig { returns(String) } - def os - end - end - - class << self - # @api private - sig { params(input: T.anything).returns(T::Boolean) } - def primitive?(input) - end - - # @api private - sig do - params(input: T.any(String, T::Boolean)).returns( - T.any(T::Boolean, T.anything) - ) - end - def coerce_boolean(input) - end - - # @api private - sig do - params(input: T.any(String, T::Boolean)).returns( - T.nilable(T::Boolean) - ) - end - def coerce_boolean!(input) - end - - # @api private - sig do - params(input: T.any(String, Integer)).returns( - T.any(Integer, T.anything) - ) - end - def coerce_integer(input) - end - - # @api private - sig do - params(input: T.any(String, Integer, Float)).returns( - T.any(Float, T.anything) - ) - end - def coerce_float(input) - end - - # @api private - sig do - params(input: T.anything).returns( - T.any(T::Hash[T.anything, T.anything], T.anything) - ) - end - def coerce_hash(input) - end - - # @api private - sig do - params(input: T.anything).returns( - T.nilable(T::Hash[T.anything, T.anything]) - ) - end - def coerce_hash!(input) - end - end - - class << self - # @api private - sig do - params(lhs: T.anything, rhs: T.anything, concat: T::Boolean).returns( - T.anything - ) - end - private def deep_merge_lr(lhs, rhs, concat: false) - end - - # @api private - # - # Recursively merge one hash with another. If the values at a given key are not - # both hashes, just take the new value. - sig do - params( - values: T::Array[T.anything], - sentinel: T.nilable(T.anything), - concat: T::Boolean - ).returns(T.anything) - end - def deep_merge( - *values, - # the value to return if no values are provided. - sentinel: nil, - # whether to merge sequences by concatenation. - concat: false - ) - end - - # @api private - sig do - params( - data: - T.any( - ModerationAPI::Internal::AnyHash, - T::Array[T.anything], - T.anything - ), - pick: - T.nilable( - T.any( - Symbol, - Integer, - T::Array[T.any(Symbol, Integer)], - T.proc.params(arg0: T.anything).returns(T.anything) - ) - ), - blk: T.nilable(T.proc.returns(T.anything)) - ).returns(T.nilable(T.anything)) - end - def dig(data, pick, &blk) - end - end - - # https://www.rfc-editor.org/rfc/rfc3986.html#section-3.3 - RFC_3986_NOT_PCHARS = T.let(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/, Regexp) - - class << self - # @api private - sig { params(uri: URI::Generic).returns(String) } - def uri_origin(uri) - end - - # @api private - sig { params(path: T.any(String, Integer)).returns(String) } - def encode_path(path) - end - - # @api private - sig { params(path: T.any(String, T::Array[String])).returns(String) } - def interpolate_path(path) - end - end - - class << self - # @api private - sig do - params(query: T.nilable(String)).returns( - T::Hash[String, T::Array[String]] - ) - end - def decode_query(query) - end - - # @api private - sig do - params( - query: - T.nilable( - T::Hash[String, T.nilable(T.any(T::Array[String], String))] - ) - ).returns(T.nilable(String)) - end - def encode_query(query) - end - end - - ParsedUri = - T.type_alias do - { - scheme: T.nilable(String), - host: T.nilable(String), - port: T.nilable(Integer), - path: T.nilable(String), - query: T::Hash[String, T::Array[String]] - } - end - - class << self - # @api private - sig do - params(url: T.any(URI::Generic, String)).returns( - ModerationAPI::Internal::Util::ParsedUri - ) - end - def parse_uri(url) - end - - # @api private - sig do - params(parsed: ModerationAPI::Internal::Util::ParsedUri).returns( - URI::Generic - ) - end - def unparse_uri(parsed) - end - - # @api private - sig do - params( - lhs: ModerationAPI::Internal::Util::ParsedUri, - rhs: ModerationAPI::Internal::Util::ParsedUri - ).returns(URI::Generic) - end - def join_parsed_uri(lhs, rhs) - end - end - - class << self - # @api private - sig do - params( - headers: - T::Hash[ - String, - T.nilable( - T.any( - String, - Integer, - T::Array[T.nilable(T.any(String, Integer))] - ) - ) - ] - ).returns(T::Hash[String, String]) - end - def normalized_headers(*headers) - end - end - - # @api private - # - # An adapter that satisfies the IO interface required by `::IO.copy_stream` - class ReadIOAdapter - # @api private - sig { returns(T.nilable(T::Boolean)) } - def close? - end - - # @api private - sig { void } - def close - end - - # @api private - sig { params(max_len: T.nilable(Integer)).returns(String) } - private def read_enum(max_len) - end - - # @api private - sig do - params( - max_len: T.nilable(Integer), - out_string: T.nilable(String) - ).returns(T.nilable(String)) - end - def read(max_len = nil, out_string = nil) - end - - # @api private - sig do - params( - src: T.any(String, Pathname, StringIO, T::Enumerable[String]), - blk: T.proc.params(arg0: String).void - ).returns(T.attached_class) - end - def self.new(src, &blk) - end - end - - class << self - sig do - params(blk: T.proc.params(y: Enumerator::Yielder).void).returns( - T::Enumerable[String] - ) - end - def writable_enum(&blk) - end - end - - JSON_CONTENT = - T.let(%r{^application/(?:[a-zA-Z0-9.-]+\+)?json(?!l)}, Regexp) - JSONL_CONTENT = - T.let(%r{^application/(:?x-(?:n|l)djson)|(:?(?:x-)?jsonl)}, Regexp) - - class << self - # @api private - sig do - params(query: ModerationAPI::Internal::AnyHash).returns( - ModerationAPI::Internal::AnyHash - ) - end - def encode_query_params(query) - end - - # @api private - sig do - params( - collection: ModerationAPI::Internal::AnyHash, - key: String, - element: T.anything - ).void - end - private def write_query_param_element!(collection, key, element) - end - - # @api private - sig do - params( - y: Enumerator::Yielder, - val: T.anything, - closing: T::Array[T.proc.void], - content_type: T.nilable(String) - ).void - end - private def write_multipart_content( - y, - val:, - closing:, - content_type: nil - ) - end - - # @api private - sig do - params( - y: Enumerator::Yielder, - boundary: String, - key: T.any(Symbol, String), - val: T.anything, - closing: T::Array[T.proc.void] - ).void - end - private def write_multipart_chunk(y, boundary:, key:, val:, closing:) - end - - # @api private - # - # https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.1.md#special-considerations-for-multipart-content - sig do - params(body: T.anything).returns([String, T::Enumerable[String]]) - end - private def encode_multipart_streaming(body) - end - - # @api private - sig do - params(headers: T::Hash[String, String], body: T.anything).returns( - T.anything - ) - end - def encode_content(headers, body) - end - - # @api private - # - # https://www.iana.org/assignments/character-sets/character-sets.xhtml - sig { params(content_type: String, text: String).void } - def force_charset!(content_type, text:) - end - - # @api private - # - # Assumes each chunk in stream has `Encoding::BINARY`. - sig do - params( - headers: T::Hash[String, String], - stream: T::Enumerable[String], - suppress_error: T::Boolean - ).returns(T.anything) - end - def decode_content(headers, stream:, suppress_error: false) - end - end - - class << self - # @api private - # - # https://doc.rust-lang.org/std/iter/trait.FusedIterator.html - sig do - params( - enum: T::Enumerable[T.anything], - external: T::Boolean, - close: T.proc.void - ).returns(T::Enumerable[T.anything]) - end - def fused_enum(enum, external: false, &close) - end - - # @api private - sig { params(enum: T.nilable(T::Enumerable[T.anything])).void } - def close_fused!(enum) - end - - # @api private - sig do - params( - enum: T.nilable(T::Enumerable[T.anything]), - blk: T.proc.params(arg0: Enumerator::Yielder).void - ).returns(T::Enumerable[T.anything]) - end - def chain_fused(enum, &blk) - end - end - - ServerSentEvent = - T.type_alias do - { - event: T.nilable(String), - data: T.nilable(String), - id: T.nilable(String), - retry: T.nilable(Integer) - } - end - - class << self - # @api private - # - # Assumes Strings have been forced into having `Encoding::BINARY`. - # - # This decoder is responsible for reassembling lines split across multiple - # fragments. - sig do - params(enum: T::Enumerable[String]).returns(T::Enumerable[String]) - end - def decode_lines(enum) - end - - # @api private - # - # https://html.spec.whatwg.org/multipage/server-sent-events.html#parsing-an-event-stream - # - # Assumes that `lines` has been decoded with `#decode_lines`. - sig do - params(lines: T::Enumerable[String]).returns( - T::Enumerable[ModerationAPI::Internal::Util::ServerSentEvent] - ) - end - def decode_sse(lines) - end - end - - # @api private - module SorbetRuntimeSupport - class MissingSorbetRuntimeError < ::RuntimeError - end - - # @api private - sig { returns(T::Hash[Symbol, T.anything]) } - private def sorbet_runtime_constants - end - - # @api private - sig { params(name: Symbol).void } - def const_missing(name) - end - - # @api private - sig { params(name: Symbol).returns(T::Boolean) } - def sorbet_constant_defined?(name) - end - - # @api private - sig { params(name: Symbol, blk: T.proc.returns(T.anything)).void } - def define_sorbet_constant!(name, &blk) - end - - # @api private - sig { returns(T.anything) } - def to_sorbet_type - end - - class << self - # @api private - sig do - params( - type: - T.any( - ModerationAPI::Internal::Util::SorbetRuntimeSupport, - T.anything - ) - ).returns(T.anything) - end - def to_sorbet_type(type) - end - end - end - end - end -end diff --git a/rbi/moderation_api/models.rbi b/rbi/moderation_api/models.rbi deleted file mode 100644 index 37744ea0..00000000 --- a/rbi/moderation_api/models.rbi +++ /dev/null @@ -1,67 +0,0 @@ -# typed: strong - -module ModerationAPI - AccountListParams = ModerationAPI::Models::AccountListParams - - ActionCreateParams = ModerationAPI::Models::ActionCreateParams - - ActionDeleteParams = ModerationAPI::Models::ActionDeleteParams - - ActionListParams = ModerationAPI::Models::ActionListParams - - ActionRetrieveParams = ModerationAPI::Models::ActionRetrieveParams - - Actions = ModerationAPI::Models::Actions - - ActionUpdateParams = ModerationAPI::Models::ActionUpdateParams - - AuthCreateParams = ModerationAPI::Models::AuthCreateParams - - AuthorCreateParams = ModerationAPI::Models::AuthorCreateParams - - AuthorDeleteParams = ModerationAPI::Models::AuthorDeleteParams - - AuthorListParams = ModerationAPI::Models::AuthorListParams - - AuthorRetrieveParams = ModerationAPI::Models::AuthorRetrieveParams - - AuthorUpdateParams = ModerationAPI::Models::AuthorUpdateParams - - AuthRetrieveParams = ModerationAPI::Models::AuthRetrieveParams - - ContentStreamParams = ModerationAPI::Models::ContentStreamParams - - ContentSubmitParams = ModerationAPI::Models::ContentSubmitParams - - Queue = ModerationAPI::Models::Queue - - QueueGetStatsParams = ModerationAPI::Models::QueueGetStatsParams - - QueueRetrieveParams = ModerationAPI::Models::QueueRetrieveParams - - WebhookCreateParams = ModerationAPI::Models::WebhookCreateParams - - WebhookDeleteParams = ModerationAPI::Models::WebhookDeleteParams - - WebhookEvent = ModerationAPI::Models::WebhookEvent - - WebhookListParams = ModerationAPI::Models::WebhookListParams - - WebhookRetrieveParams = ModerationAPI::Models::WebhookRetrieveParams - - WebhookSecretRetrieveParams = - ModerationAPI::Models::WebhookSecretRetrieveParams - - WebhookUpdateParams = ModerationAPI::Models::WebhookUpdateParams - - Wordlist = ModerationAPI::Models::Wordlist - - WordlistGetEmbeddingStatusParams = - ModerationAPI::Models::WordlistGetEmbeddingStatusParams - - WordlistListParams = ModerationAPI::Models::WordlistListParams - - WordlistRetrieveParams = ModerationAPI::Models::WordlistRetrieveParams - - WordlistUpdateParams = ModerationAPI::Models::WordlistUpdateParams -end diff --git a/rbi/moderation_api/models/account_list_params.rbi b/rbi/moderation_api/models/account_list_params.rbi deleted file mode 100644 index 113bb8f5..00000000 --- a/rbi/moderation_api/models/account_list_params.rbi +++ /dev/null @@ -1,32 +0,0 @@ -# typed: strong - -module ModerationAPI - module Models - class AccountListParams < ModerationAPI::Internal::Type::BaseModel - extend ModerationAPI::Internal::Type::RequestParameters::Converter - include ModerationAPI::Internal::Type::RequestParameters - - OrHash = - T.type_alias do - T.any( - ModerationAPI::AccountListParams, - ModerationAPI::Internal::AnyHash - ) - end - - sig do - params(request_options: ModerationAPI::RequestOptions::OrHash).returns( - T.attached_class - ) - end - def self.new(request_options: {}) - end - - sig do - override.returns({ request_options: ModerationAPI::RequestOptions }) - end - def to_hash - end - end - end -end diff --git a/rbi/moderation_api/models/account_list_response.rbi b/rbi/moderation_api/models/account_list_response.rbi deleted file mode 100644 index dde55a82..00000000 --- a/rbi/moderation_api/models/account_list_response.rbi +++ /dev/null @@ -1,115 +0,0 @@ -# typed: strong - -module ModerationAPI - module Models - class AccountListResponse < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::Models::AccountListResponse, - ModerationAPI::Internal::AnyHash - ) - end - - # ID of the account - sig { returns(String) } - attr_accessor :id - - # Name of the paid plan - sig { returns(String) } - attr_accessor :paid_plan_name - - # Remaining quota - sig { returns(Float) } - attr_accessor :remaining_quota - - # Text API quota - sig { returns(Float) } - attr_accessor :text_api_quota - - sig do - returns( - T.nilable(ModerationAPI::Models::AccountListResponse::CurrentProject) - ) - end - attr_reader :current_project - - sig do - params( - current_project: - ModerationAPI::Models::AccountListResponse::CurrentProject::OrHash - ).void - end - attr_writer :current_project - - sig do - params( - id: String, - paid_plan_name: String, - remaining_quota: Float, - text_api_quota: Float, - current_project: - ModerationAPI::Models::AccountListResponse::CurrentProject::OrHash - ).returns(T.attached_class) - end - def self.new( - # ID of the account - id:, - # Name of the paid plan - paid_plan_name:, - # Remaining quota - remaining_quota:, - # Text API quota - text_api_quota:, - current_project: nil - ) - end - - sig do - override.returns( - { - id: String, - paid_plan_name: String, - remaining_quota: Float, - text_api_quota: Float, - current_project: - ModerationAPI::Models::AccountListResponse::CurrentProject - } - ) - end - def to_hash - end - - class CurrentProject < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::Models::AccountListResponse::CurrentProject, - ModerationAPI::Internal::AnyHash - ) - end - - # ID of the current project - sig { returns(String) } - attr_accessor :id - - # Name of the current project - sig { returns(String) } - attr_accessor :name - - sig { params(id: String, name: String).returns(T.attached_class) } - def self.new( - # ID of the current project - id:, - # Name of the current project - name: - ) - end - - sig { override.returns({ id: String, name: String }) } - def to_hash - end - end - end - end -end diff --git a/rbi/moderation_api/models/action_create_params.rbi b/rbi/moderation_api/models/action_create_params.rbi deleted file mode 100644 index 21339a95..00000000 --- a/rbi/moderation_api/models/action_create_params.rbi +++ /dev/null @@ -1,353 +0,0 @@ -# typed: strong - -module ModerationAPI - module Models - class ActionCreateParams < ModerationAPI::Internal::Type::BaseModel - extend ModerationAPI::Internal::Type::RequestParameters::Converter - include ModerationAPI::Internal::Type::RequestParameters - - OrHash = - T.type_alias do - T.any( - ModerationAPI::ActionCreateParams, - ModerationAPI::Internal::AnyHash - ) - end - - # The name of the action. - sig { returns(String) } - attr_accessor :name - - # Whether the action is a built-in action or a custom one. - sig { returns(T.nilable(T::Boolean)) } - attr_accessor :built_in - - # The description of the action. - sig { returns(T.nilable(String)) } - attr_accessor :description - - # The IDs of the queues the action is available in. - sig { returns(T.nilable(T::Array[String])) } - attr_reader :filter_in_queue_ids - - sig { params(filter_in_queue_ids: T::Array[String]).void } - attr_writer :filter_in_queue_ids - - # Whether the action allows any text to be entered as a value or if it must be one - # of the possible values. - sig { returns(T.nilable(T::Boolean)) } - attr_reader :free_text - - sig { params(free_text: T::Boolean).void } - attr_writer :free_text - - # User defined key of the action. - sig { returns(T.nilable(String)) } - attr_accessor :key - - # Show the action in all queues, selected queues or no queues (to use via API - # only). - sig do - returns( - T.nilable(ModerationAPI::ActionCreateParams::Position::OrSymbol) - ) - end - attr_reader :position - - sig do - params( - position: ModerationAPI::ActionCreateParams::Position::OrSymbol - ).void - end - attr_writer :position - - # The possible values of the action. The user will be prompted to select one of - # these values when executing the action. - sig do - returns( - T.nilable(T::Array[ModerationAPI::ActionCreateParams::PossibleValue]) - ) - end - attr_reader :possible_values - - sig do - params( - possible_values: - T::Array[ModerationAPI::ActionCreateParams::PossibleValue::OrHash] - ).void - end - attr_writer :possible_values - - # Whether the action resolves and removes the item, unresolves and re-add it to - # the queue, or does not change the resolve status. - sig do - returns( - T.nilable(ModerationAPI::ActionCreateParams::QueueBehaviour::OrSymbol) - ) - end - attr_reader :queue_behaviour - - sig do - params( - queue_behaviour: - ModerationAPI::ActionCreateParams::QueueBehaviour::OrSymbol - ).void - end - attr_writer :queue_behaviour - - # The type of the action. - sig do - returns(T.nilable(ModerationAPI::ActionCreateParams::Type::OrSymbol)) - end - attr_accessor :type - - # Whether the action requires a value to be executed. - sig { returns(T.nilable(T::Boolean)) } - attr_reader :value_required - - sig { params(value_required: T::Boolean).void } - attr_writer :value_required - - sig do - params( - name: String, - built_in: T.nilable(T::Boolean), - description: T.nilable(String), - filter_in_queue_ids: T::Array[String], - free_text: T::Boolean, - key: T.nilable(String), - position: ModerationAPI::ActionCreateParams::Position::OrSymbol, - possible_values: - T::Array[ModerationAPI::ActionCreateParams::PossibleValue::OrHash], - queue_behaviour: - ModerationAPI::ActionCreateParams::QueueBehaviour::OrSymbol, - type: T.nilable(ModerationAPI::ActionCreateParams::Type::OrSymbol), - value_required: T::Boolean, - request_options: ModerationAPI::RequestOptions::OrHash - ).returns(T.attached_class) - end - def self.new( - # The name of the action. - name:, - # Whether the action is a built-in action or a custom one. - built_in: nil, - # The description of the action. - description: nil, - # The IDs of the queues the action is available in. - filter_in_queue_ids: nil, - # Whether the action allows any text to be entered as a value or if it must be one - # of the possible values. - free_text: nil, - # User defined key of the action. - key: nil, - # Show the action in all queues, selected queues or no queues (to use via API - # only). - position: nil, - # The possible values of the action. The user will be prompted to select one of - # these values when executing the action. - possible_values: nil, - # Whether the action resolves and removes the item, unresolves and re-add it to - # the queue, or does not change the resolve status. - queue_behaviour: nil, - # The type of the action. - type: nil, - # Whether the action requires a value to be executed. - value_required: nil, - request_options: {} - ) - end - - sig do - override.returns( - { - name: String, - built_in: T.nilable(T::Boolean), - description: T.nilable(String), - filter_in_queue_ids: T::Array[String], - free_text: T::Boolean, - key: T.nilable(String), - position: ModerationAPI::ActionCreateParams::Position::OrSymbol, - possible_values: - T::Array[ModerationAPI::ActionCreateParams::PossibleValue], - queue_behaviour: - ModerationAPI::ActionCreateParams::QueueBehaviour::OrSymbol, - type: T.nilable(ModerationAPI::ActionCreateParams::Type::OrSymbol), - value_required: T::Boolean, - request_options: ModerationAPI::RequestOptions - } - ) - end - def to_hash - end - - # Show the action in all queues, selected queues or no queues (to use via API - # only). - module Position - extend ModerationAPI::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all(Symbol, ModerationAPI::ActionCreateParams::Position) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - ALL_QUEUES = - T.let( - :ALL_QUEUES, - ModerationAPI::ActionCreateParams::Position::TaggedSymbol - ) - SOME_QUEUES = - T.let( - :SOME_QUEUES, - ModerationAPI::ActionCreateParams::Position::TaggedSymbol - ) - HIDDEN = - T.let( - :HIDDEN, - ModerationAPI::ActionCreateParams::Position::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ModerationAPI::ActionCreateParams::Position::TaggedSymbol] - ) - end - def self.values - end - end - - class PossibleValue < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::ActionCreateParams::PossibleValue, - ModerationAPI::Internal::AnyHash - ) - end - - # The value of the action. - sig { returns(String) } - attr_accessor :value - - sig { params(value: String).returns(T.attached_class) } - def self.new( - # The value of the action. - value: - ) - end - - sig { override.returns({ value: String }) } - def to_hash - end - end - - # Whether the action resolves and removes the item, unresolves and re-add it to - # the queue, or does not change the resolve status. - module QueueBehaviour - extend ModerationAPI::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all(Symbol, ModerationAPI::ActionCreateParams::QueueBehaviour) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - REMOVE = - T.let( - :REMOVE, - ModerationAPI::ActionCreateParams::QueueBehaviour::TaggedSymbol - ) - ADD = - T.let( - :ADD, - ModerationAPI::ActionCreateParams::QueueBehaviour::TaggedSymbol - ) - NO_CHANGE = - T.let( - :NO_CHANGE, - ModerationAPI::ActionCreateParams::QueueBehaviour::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - ModerationAPI::ActionCreateParams::QueueBehaviour::TaggedSymbol - ] - ) - end - def self.values - end - end - - # The type of the action. - module Type - extend ModerationAPI::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all(Symbol, ModerationAPI::ActionCreateParams::Type) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - AUTHOR_BLOCK = - T.let( - :AUTHOR_BLOCK, - ModerationAPI::ActionCreateParams::Type::TaggedSymbol - ) - AUTHOR_BLOCK_TEMP = - T.let( - :AUTHOR_BLOCK_TEMP, - ModerationAPI::ActionCreateParams::Type::TaggedSymbol - ) - AUTHOR_UNBLOCK = - T.let( - :AUTHOR_UNBLOCK, - ModerationAPI::ActionCreateParams::Type::TaggedSymbol - ) - AUTHOR_DELETE = - T.let( - :AUTHOR_DELETE, - ModerationAPI::ActionCreateParams::Type::TaggedSymbol - ) - AUTHOR_REPORT = - T.let( - :AUTHOR_REPORT, - ModerationAPI::ActionCreateParams::Type::TaggedSymbol - ) - AUTHOR_WARN = - T.let( - :AUTHOR_WARN, - ModerationAPI::ActionCreateParams::Type::TaggedSymbol - ) - AUTHOR_CUSTOM = - T.let( - :AUTHOR_CUSTOM, - ModerationAPI::ActionCreateParams::Type::TaggedSymbol - ) - ITEM_REJECT = - T.let( - :ITEM_REJECT, - ModerationAPI::ActionCreateParams::Type::TaggedSymbol - ) - ITEM_ALLOW = - T.let( - :ITEM_ALLOW, - ModerationAPI::ActionCreateParams::Type::TaggedSymbol - ) - ITEM_CUSTOM = - T.let( - :ITEM_CUSTOM, - ModerationAPI::ActionCreateParams::Type::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ModerationAPI::ActionCreateParams::Type::TaggedSymbol] - ) - end - def self.values - end - end - end - end -end diff --git a/rbi/moderation_api/models/action_create_response.rbi b/rbi/moderation_api/models/action_create_response.rbi deleted file mode 100644 index b8bc63e2..00000000 --- a/rbi/moderation_api/models/action_create_response.rbi +++ /dev/null @@ -1,354 +0,0 @@ -# typed: strong - -module ModerationAPI - module Models - class ActionCreateResponse < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::Models::ActionCreateResponse, - ModerationAPI::Internal::AnyHash - ) - end - - # The ID of the action. - sig { returns(String) } - attr_accessor :id - - # Whether the action is a built-in action or a custom one. - sig { returns(T.nilable(T::Boolean)) } - attr_accessor :built_in - - # The date the action was created. - sig { returns(String) } - attr_accessor :created_at - - # The IDs of the queues the action is available in. - sig { returns(T::Array[String]) } - attr_accessor :filter_in_queue_ids - - # Whether the action allows any text to be entered as a value or if it must be one - # of the possible values. - sig { returns(T::Boolean) } - attr_accessor :free_text - - # The name of the action. - sig { returns(String) } - attr_accessor :name - - # Show the action in all queues, selected queues or no queues (to use via API - # only). - sig do - returns( - ModerationAPI::Models::ActionCreateResponse::Position::TaggedSymbol - ) - end - attr_accessor :position - - # The possible values of the action. The user will be prompted to select one of - # these values when executing the action. - sig do - returns( - T::Array[ModerationAPI::Models::ActionCreateResponse::PossibleValue] - ) - end - attr_accessor :possible_values - - # Whether the action resolves and removes the item, unresolves and re-add it to - # the queue, or does not change the resolve status. - sig do - returns( - ModerationAPI::Models::ActionCreateResponse::QueueBehaviour::TaggedSymbol - ) - end - attr_accessor :queue_behaviour - - # Whether the action requires a value to be executed. - sig { returns(T::Boolean) } - attr_accessor :value_required - - # The description of the action. - sig { returns(T.nilable(String)) } - attr_accessor :description - - # User defined key of the action. - sig { returns(T.nilable(String)) } - attr_accessor :key - - # The type of the action. - sig do - returns( - T.nilable( - ModerationAPI::Models::ActionCreateResponse::Type::TaggedSymbol - ) - ) - end - attr_accessor :type - - sig do - params( - id: String, - built_in: T.nilable(T::Boolean), - created_at: String, - filter_in_queue_ids: T::Array[String], - free_text: T::Boolean, - name: String, - position: - ModerationAPI::Models::ActionCreateResponse::Position::OrSymbol, - possible_values: - T::Array[ - ModerationAPI::Models::ActionCreateResponse::PossibleValue::OrHash - ], - queue_behaviour: - ModerationAPI::Models::ActionCreateResponse::QueueBehaviour::OrSymbol, - value_required: T::Boolean, - description: T.nilable(String), - key: T.nilable(String), - type: - T.nilable( - ModerationAPI::Models::ActionCreateResponse::Type::OrSymbol - ) - ).returns(T.attached_class) - end - def self.new( - # The ID of the action. - id:, - # Whether the action is a built-in action or a custom one. - built_in:, - # The date the action was created. - created_at:, - # The IDs of the queues the action is available in. - filter_in_queue_ids:, - # Whether the action allows any text to be entered as a value or if it must be one - # of the possible values. - free_text:, - # The name of the action. - name:, - # Show the action in all queues, selected queues or no queues (to use via API - # only). - position:, - # The possible values of the action. The user will be prompted to select one of - # these values when executing the action. - possible_values:, - # Whether the action resolves and removes the item, unresolves and re-add it to - # the queue, or does not change the resolve status. - queue_behaviour:, - # Whether the action requires a value to be executed. - value_required:, - # The description of the action. - description: nil, - # User defined key of the action. - key: nil, - # The type of the action. - type: nil - ) - end - - sig do - override.returns( - { - id: String, - built_in: T.nilable(T::Boolean), - created_at: String, - filter_in_queue_ids: T::Array[String], - free_text: T::Boolean, - name: String, - position: - ModerationAPI::Models::ActionCreateResponse::Position::TaggedSymbol, - possible_values: - T::Array[ - ModerationAPI::Models::ActionCreateResponse::PossibleValue - ], - queue_behaviour: - ModerationAPI::Models::ActionCreateResponse::QueueBehaviour::TaggedSymbol, - value_required: T::Boolean, - description: T.nilable(String), - key: T.nilable(String), - type: - T.nilable( - ModerationAPI::Models::ActionCreateResponse::Type::TaggedSymbol - ) - } - ) - end - def to_hash - end - - # Show the action in all queues, selected queues or no queues (to use via API - # only). - module Position - extend ModerationAPI::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all(Symbol, ModerationAPI::Models::ActionCreateResponse::Position) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - ALL_QUEUES = - T.let( - :ALL_QUEUES, - ModerationAPI::Models::ActionCreateResponse::Position::TaggedSymbol - ) - SOME_QUEUES = - T.let( - :SOME_QUEUES, - ModerationAPI::Models::ActionCreateResponse::Position::TaggedSymbol - ) - HIDDEN = - T.let( - :HIDDEN, - ModerationAPI::Models::ActionCreateResponse::Position::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - ModerationAPI::Models::ActionCreateResponse::Position::TaggedSymbol - ] - ) - end - def self.values - end - end - - class PossibleValue < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::Models::ActionCreateResponse::PossibleValue, - ModerationAPI::Internal::AnyHash - ) - end - - # The value of the action. - sig { returns(String) } - attr_accessor :value - - sig { params(value: String).returns(T.attached_class) } - def self.new( - # The value of the action. - value: - ) - end - - sig { override.returns({ value: String }) } - def to_hash - end - end - - # Whether the action resolves and removes the item, unresolves and re-add it to - # the queue, or does not change the resolve status. - module QueueBehaviour - extend ModerationAPI::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all( - Symbol, - ModerationAPI::Models::ActionCreateResponse::QueueBehaviour - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - REMOVE = - T.let( - :REMOVE, - ModerationAPI::Models::ActionCreateResponse::QueueBehaviour::TaggedSymbol - ) - ADD = - T.let( - :ADD, - ModerationAPI::Models::ActionCreateResponse::QueueBehaviour::TaggedSymbol - ) - NO_CHANGE = - T.let( - :NO_CHANGE, - ModerationAPI::Models::ActionCreateResponse::QueueBehaviour::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - ModerationAPI::Models::ActionCreateResponse::QueueBehaviour::TaggedSymbol - ] - ) - end - def self.values - end - end - - # The type of the action. - module Type - extend ModerationAPI::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all(Symbol, ModerationAPI::Models::ActionCreateResponse::Type) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - AUTHOR_BLOCK = - T.let( - :AUTHOR_BLOCK, - ModerationAPI::Models::ActionCreateResponse::Type::TaggedSymbol - ) - AUTHOR_BLOCK_TEMP = - T.let( - :AUTHOR_BLOCK_TEMP, - ModerationAPI::Models::ActionCreateResponse::Type::TaggedSymbol - ) - AUTHOR_UNBLOCK = - T.let( - :AUTHOR_UNBLOCK, - ModerationAPI::Models::ActionCreateResponse::Type::TaggedSymbol - ) - AUTHOR_DELETE = - T.let( - :AUTHOR_DELETE, - ModerationAPI::Models::ActionCreateResponse::Type::TaggedSymbol - ) - AUTHOR_REPORT = - T.let( - :AUTHOR_REPORT, - ModerationAPI::Models::ActionCreateResponse::Type::TaggedSymbol - ) - AUTHOR_WARN = - T.let( - :AUTHOR_WARN, - ModerationAPI::Models::ActionCreateResponse::Type::TaggedSymbol - ) - AUTHOR_CUSTOM = - T.let( - :AUTHOR_CUSTOM, - ModerationAPI::Models::ActionCreateResponse::Type::TaggedSymbol - ) - ITEM_REJECT = - T.let( - :ITEM_REJECT, - ModerationAPI::Models::ActionCreateResponse::Type::TaggedSymbol - ) - ITEM_ALLOW = - T.let( - :ITEM_ALLOW, - ModerationAPI::Models::ActionCreateResponse::Type::TaggedSymbol - ) - ITEM_CUSTOM = - T.let( - :ITEM_CUSTOM, - ModerationAPI::Models::ActionCreateResponse::Type::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - ModerationAPI::Models::ActionCreateResponse::Type::TaggedSymbol - ] - ) - end - def self.values - end - end - end - end -end diff --git a/rbi/moderation_api/models/action_delete_params.rbi b/rbi/moderation_api/models/action_delete_params.rbi deleted file mode 100644 index e78d6c48..00000000 --- a/rbi/moderation_api/models/action_delete_params.rbi +++ /dev/null @@ -1,43 +0,0 @@ -# typed: strong - -module ModerationAPI - module Models - class ActionDeleteParams < ModerationAPI::Internal::Type::BaseModel - extend ModerationAPI::Internal::Type::RequestParameters::Converter - include ModerationAPI::Internal::Type::RequestParameters - - OrHash = - T.type_alias do - T.any( - ModerationAPI::ActionDeleteParams, - ModerationAPI::Internal::AnyHash - ) - end - - # The ID of the action to delete. - sig { returns(String) } - attr_accessor :id - - sig do - params( - id: String, - request_options: ModerationAPI::RequestOptions::OrHash - ).returns(T.attached_class) - end - def self.new( - # The ID of the action to delete. - id:, - request_options: {} - ) - end - - sig do - override.returns( - { id: String, request_options: ModerationAPI::RequestOptions } - ) - end - def to_hash - end - end - end -end diff --git a/rbi/moderation_api/models/action_delete_response.rbi b/rbi/moderation_api/models/action_delete_response.rbi deleted file mode 100644 index 3f0750ed..00000000 --- a/rbi/moderation_api/models/action_delete_response.rbi +++ /dev/null @@ -1,36 +0,0 @@ -# typed: strong - -module ModerationAPI - module Models - class ActionDeleteResponse < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::Models::ActionDeleteResponse, - ModerationAPI::Internal::AnyHash - ) - end - - # The ID of the action. - sig { returns(String) } - attr_accessor :id - - # Whether the action was deleted. - sig { returns(T::Boolean) } - attr_accessor :deleted - - sig { params(id: String, deleted: T::Boolean).returns(T.attached_class) } - def self.new( - # The ID of the action. - id:, - # Whether the action was deleted. - deleted: - ) - end - - sig { override.returns({ id: String, deleted: T::Boolean }) } - def to_hash - end - end - end -end diff --git a/rbi/moderation_api/models/action_list_params.rbi b/rbi/moderation_api/models/action_list_params.rbi deleted file mode 100644 index 8b0baf54..00000000 --- a/rbi/moderation_api/models/action_list_params.rbi +++ /dev/null @@ -1,41 +0,0 @@ -# typed: strong - -module ModerationAPI - module Models - class ActionListParams < ModerationAPI::Internal::Type::BaseModel - extend ModerationAPI::Internal::Type::RequestParameters::Converter - include ModerationAPI::Internal::Type::RequestParameters - - OrHash = - T.type_alias do - T.any( - ModerationAPI::ActionListParams, - ModerationAPI::Internal::AnyHash - ) - end - - sig { returns(T.nilable(String)) } - attr_reader :queue_id - - sig { params(queue_id: String).void } - attr_writer :queue_id - - sig do - params( - queue_id: String, - request_options: ModerationAPI::RequestOptions::OrHash - ).returns(T.attached_class) - end - def self.new(queue_id: nil, request_options: {}) - end - - sig do - override.returns( - { queue_id: String, request_options: ModerationAPI::RequestOptions } - ) - end - def to_hash - end - end - end -end diff --git a/rbi/moderation_api/models/action_list_response.rbi b/rbi/moderation_api/models/action_list_response.rbi deleted file mode 100644 index a4af0764..00000000 --- a/rbi/moderation_api/models/action_list_response.rbi +++ /dev/null @@ -1,365 +0,0 @@ -# typed: strong - -module ModerationAPI - module Models - class ActionListResponseItem < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::Models::ActionListResponseItem, - ModerationAPI::Internal::AnyHash - ) - end - - # The ID of the action. - sig { returns(String) } - attr_accessor :id - - # Whether the action is a built-in action or a custom one. - sig { returns(T.nilable(T::Boolean)) } - attr_accessor :built_in - - # The date the action was created. - sig { returns(String) } - attr_accessor :created_at - - # The IDs of the queues the action is available in. - sig { returns(T::Array[String]) } - attr_accessor :filter_in_queue_ids - - # Whether the action allows any text to be entered as a value or if it must be one - # of the possible values. - sig { returns(T::Boolean) } - attr_accessor :free_text - - # The name of the action. - sig { returns(String) } - attr_accessor :name - - # Show the action in all queues, selected queues or no queues (to use via API - # only). - sig do - returns( - ModerationAPI::Models::ActionListResponseItem::Position::TaggedSymbol - ) - end - attr_accessor :position - - # The possible values of the action. The user will be prompted to select one of - # these values when executing the action. - sig do - returns( - T::Array[ModerationAPI::Models::ActionListResponseItem::PossibleValue] - ) - end - attr_accessor :possible_values - - # Whether the action resolves and removes the item, unresolves and re-add it to - # the queue, or does not change the resolve status. - sig do - returns( - ModerationAPI::Models::ActionListResponseItem::QueueBehaviour::TaggedSymbol - ) - end - attr_accessor :queue_behaviour - - # Whether the action requires a value to be executed. - sig { returns(T::Boolean) } - attr_accessor :value_required - - # The description of the action. - sig { returns(T.nilable(String)) } - attr_accessor :description - - # User defined key of the action. - sig { returns(T.nilable(String)) } - attr_accessor :key - - # The type of the action. - sig do - returns( - T.nilable( - ModerationAPI::Models::ActionListResponseItem::Type::TaggedSymbol - ) - ) - end - attr_accessor :type - - sig do - params( - id: String, - built_in: T.nilable(T::Boolean), - created_at: String, - filter_in_queue_ids: T::Array[String], - free_text: T::Boolean, - name: String, - position: - ModerationAPI::Models::ActionListResponseItem::Position::OrSymbol, - possible_values: - T::Array[ - ModerationAPI::Models::ActionListResponseItem::PossibleValue::OrHash - ], - queue_behaviour: - ModerationAPI::Models::ActionListResponseItem::QueueBehaviour::OrSymbol, - value_required: T::Boolean, - description: T.nilable(String), - key: T.nilable(String), - type: - T.nilable( - ModerationAPI::Models::ActionListResponseItem::Type::OrSymbol - ) - ).returns(T.attached_class) - end - def self.new( - # The ID of the action. - id:, - # Whether the action is a built-in action or a custom one. - built_in:, - # The date the action was created. - created_at:, - # The IDs of the queues the action is available in. - filter_in_queue_ids:, - # Whether the action allows any text to be entered as a value or if it must be one - # of the possible values. - free_text:, - # The name of the action. - name:, - # Show the action in all queues, selected queues or no queues (to use via API - # only). - position:, - # The possible values of the action. The user will be prompted to select one of - # these values when executing the action. - possible_values:, - # Whether the action resolves and removes the item, unresolves and re-add it to - # the queue, or does not change the resolve status. - queue_behaviour:, - # Whether the action requires a value to be executed. - value_required:, - # The description of the action. - description: nil, - # User defined key of the action. - key: nil, - # The type of the action. - type: nil - ) - end - - sig do - override.returns( - { - id: String, - built_in: T.nilable(T::Boolean), - created_at: String, - filter_in_queue_ids: T::Array[String], - free_text: T::Boolean, - name: String, - position: - ModerationAPI::Models::ActionListResponseItem::Position::TaggedSymbol, - possible_values: - T::Array[ - ModerationAPI::Models::ActionListResponseItem::PossibleValue - ], - queue_behaviour: - ModerationAPI::Models::ActionListResponseItem::QueueBehaviour::TaggedSymbol, - value_required: T::Boolean, - description: T.nilable(String), - key: T.nilable(String), - type: - T.nilable( - ModerationAPI::Models::ActionListResponseItem::Type::TaggedSymbol - ) - } - ) - end - def to_hash - end - - # Show the action in all queues, selected queues or no queues (to use via API - # only). - module Position - extend ModerationAPI::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all( - Symbol, - ModerationAPI::Models::ActionListResponseItem::Position - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - ALL_QUEUES = - T.let( - :ALL_QUEUES, - ModerationAPI::Models::ActionListResponseItem::Position::TaggedSymbol - ) - SOME_QUEUES = - T.let( - :SOME_QUEUES, - ModerationAPI::Models::ActionListResponseItem::Position::TaggedSymbol - ) - HIDDEN = - T.let( - :HIDDEN, - ModerationAPI::Models::ActionListResponseItem::Position::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - ModerationAPI::Models::ActionListResponseItem::Position::TaggedSymbol - ] - ) - end - def self.values - end - end - - class PossibleValue < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::Models::ActionListResponseItem::PossibleValue, - ModerationAPI::Internal::AnyHash - ) - end - - # The value of the action. - sig { returns(String) } - attr_accessor :value - - sig { params(value: String).returns(T.attached_class) } - def self.new( - # The value of the action. - value: - ) - end - - sig { override.returns({ value: String }) } - def to_hash - end - end - - # Whether the action resolves and removes the item, unresolves and re-add it to - # the queue, or does not change the resolve status. - module QueueBehaviour - extend ModerationAPI::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all( - Symbol, - ModerationAPI::Models::ActionListResponseItem::QueueBehaviour - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - REMOVE = - T.let( - :REMOVE, - ModerationAPI::Models::ActionListResponseItem::QueueBehaviour::TaggedSymbol - ) - ADD = - T.let( - :ADD, - ModerationAPI::Models::ActionListResponseItem::QueueBehaviour::TaggedSymbol - ) - NO_CHANGE = - T.let( - :NO_CHANGE, - ModerationAPI::Models::ActionListResponseItem::QueueBehaviour::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - ModerationAPI::Models::ActionListResponseItem::QueueBehaviour::TaggedSymbol - ] - ) - end - def self.values - end - end - - # The type of the action. - module Type - extend ModerationAPI::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all(Symbol, ModerationAPI::Models::ActionListResponseItem::Type) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - AUTHOR_BLOCK = - T.let( - :AUTHOR_BLOCK, - ModerationAPI::Models::ActionListResponseItem::Type::TaggedSymbol - ) - AUTHOR_BLOCK_TEMP = - T.let( - :AUTHOR_BLOCK_TEMP, - ModerationAPI::Models::ActionListResponseItem::Type::TaggedSymbol - ) - AUTHOR_UNBLOCK = - T.let( - :AUTHOR_UNBLOCK, - ModerationAPI::Models::ActionListResponseItem::Type::TaggedSymbol - ) - AUTHOR_DELETE = - T.let( - :AUTHOR_DELETE, - ModerationAPI::Models::ActionListResponseItem::Type::TaggedSymbol - ) - AUTHOR_REPORT = - T.let( - :AUTHOR_REPORT, - ModerationAPI::Models::ActionListResponseItem::Type::TaggedSymbol - ) - AUTHOR_WARN = - T.let( - :AUTHOR_WARN, - ModerationAPI::Models::ActionListResponseItem::Type::TaggedSymbol - ) - AUTHOR_CUSTOM = - T.let( - :AUTHOR_CUSTOM, - ModerationAPI::Models::ActionListResponseItem::Type::TaggedSymbol - ) - ITEM_REJECT = - T.let( - :ITEM_REJECT, - ModerationAPI::Models::ActionListResponseItem::Type::TaggedSymbol - ) - ITEM_ALLOW = - T.let( - :ITEM_ALLOW, - ModerationAPI::Models::ActionListResponseItem::Type::TaggedSymbol - ) - ITEM_CUSTOM = - T.let( - :ITEM_CUSTOM, - ModerationAPI::Models::ActionListResponseItem::Type::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - ModerationAPI::Models::ActionListResponseItem::Type::TaggedSymbol - ] - ) - end - def self.values - end - end - end - - ActionListResponse = - T.let( - ModerationAPI::Internal::Type::ArrayOf[ - ModerationAPI::Models::ActionListResponseItem - ], - ModerationAPI::Internal::Type::Converter - ) - end -end diff --git a/rbi/moderation_api/models/action_retrieve_params.rbi b/rbi/moderation_api/models/action_retrieve_params.rbi deleted file mode 100644 index 1ad729d9..00000000 --- a/rbi/moderation_api/models/action_retrieve_params.rbi +++ /dev/null @@ -1,43 +0,0 @@ -# typed: strong - -module ModerationAPI - module Models - class ActionRetrieveParams < ModerationAPI::Internal::Type::BaseModel - extend ModerationAPI::Internal::Type::RequestParameters::Converter - include ModerationAPI::Internal::Type::RequestParameters - - OrHash = - T.type_alias do - T.any( - ModerationAPI::ActionRetrieveParams, - ModerationAPI::Internal::AnyHash - ) - end - - # The ID of the action to get. - sig { returns(String) } - attr_accessor :id - - sig do - params( - id: String, - request_options: ModerationAPI::RequestOptions::OrHash - ).returns(T.attached_class) - end - def self.new( - # The ID of the action to get. - id:, - request_options: {} - ) - end - - sig do - override.returns( - { id: String, request_options: ModerationAPI::RequestOptions } - ) - end - def to_hash - end - end - end -end diff --git a/rbi/moderation_api/models/action_retrieve_response.rbi b/rbi/moderation_api/models/action_retrieve_response.rbi deleted file mode 100644 index 409b686c..00000000 --- a/rbi/moderation_api/models/action_retrieve_response.rbi +++ /dev/null @@ -1,357 +0,0 @@ -# typed: strong - -module ModerationAPI - module Models - class ActionRetrieveResponse < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::Models::ActionRetrieveResponse, - ModerationAPI::Internal::AnyHash - ) - end - - # The ID of the action. - sig { returns(String) } - attr_accessor :id - - # Whether the action is a built-in action or a custom one. - sig { returns(T.nilable(T::Boolean)) } - attr_accessor :built_in - - # The date the action was created. - sig { returns(String) } - attr_accessor :created_at - - # The IDs of the queues the action is available in. - sig { returns(T::Array[String]) } - attr_accessor :filter_in_queue_ids - - # Whether the action allows any text to be entered as a value or if it must be one - # of the possible values. - sig { returns(T::Boolean) } - attr_accessor :free_text - - # The name of the action. - sig { returns(String) } - attr_accessor :name - - # Show the action in all queues, selected queues or no queues (to use via API - # only). - sig do - returns( - ModerationAPI::Models::ActionRetrieveResponse::Position::TaggedSymbol - ) - end - attr_accessor :position - - # The possible values of the action. The user will be prompted to select one of - # these values when executing the action. - sig do - returns( - T::Array[ModerationAPI::Models::ActionRetrieveResponse::PossibleValue] - ) - end - attr_accessor :possible_values - - # Whether the action resolves and removes the item, unresolves and re-add it to - # the queue, or does not change the resolve status. - sig do - returns( - ModerationAPI::Models::ActionRetrieveResponse::QueueBehaviour::TaggedSymbol - ) - end - attr_accessor :queue_behaviour - - # Whether the action requires a value to be executed. - sig { returns(T::Boolean) } - attr_accessor :value_required - - # The description of the action. - sig { returns(T.nilable(String)) } - attr_accessor :description - - # User defined key of the action. - sig { returns(T.nilable(String)) } - attr_accessor :key - - # The type of the action. - sig do - returns( - T.nilable( - ModerationAPI::Models::ActionRetrieveResponse::Type::TaggedSymbol - ) - ) - end - attr_accessor :type - - sig do - params( - id: String, - built_in: T.nilable(T::Boolean), - created_at: String, - filter_in_queue_ids: T::Array[String], - free_text: T::Boolean, - name: String, - position: - ModerationAPI::Models::ActionRetrieveResponse::Position::OrSymbol, - possible_values: - T::Array[ - ModerationAPI::Models::ActionRetrieveResponse::PossibleValue::OrHash - ], - queue_behaviour: - ModerationAPI::Models::ActionRetrieveResponse::QueueBehaviour::OrSymbol, - value_required: T::Boolean, - description: T.nilable(String), - key: T.nilable(String), - type: - T.nilable( - ModerationAPI::Models::ActionRetrieveResponse::Type::OrSymbol - ) - ).returns(T.attached_class) - end - def self.new( - # The ID of the action. - id:, - # Whether the action is a built-in action or a custom one. - built_in:, - # The date the action was created. - created_at:, - # The IDs of the queues the action is available in. - filter_in_queue_ids:, - # Whether the action allows any text to be entered as a value or if it must be one - # of the possible values. - free_text:, - # The name of the action. - name:, - # Show the action in all queues, selected queues or no queues (to use via API - # only). - position:, - # The possible values of the action. The user will be prompted to select one of - # these values when executing the action. - possible_values:, - # Whether the action resolves and removes the item, unresolves and re-add it to - # the queue, or does not change the resolve status. - queue_behaviour:, - # Whether the action requires a value to be executed. - value_required:, - # The description of the action. - description: nil, - # User defined key of the action. - key: nil, - # The type of the action. - type: nil - ) - end - - sig do - override.returns( - { - id: String, - built_in: T.nilable(T::Boolean), - created_at: String, - filter_in_queue_ids: T::Array[String], - free_text: T::Boolean, - name: String, - position: - ModerationAPI::Models::ActionRetrieveResponse::Position::TaggedSymbol, - possible_values: - T::Array[ - ModerationAPI::Models::ActionRetrieveResponse::PossibleValue - ], - queue_behaviour: - ModerationAPI::Models::ActionRetrieveResponse::QueueBehaviour::TaggedSymbol, - value_required: T::Boolean, - description: T.nilable(String), - key: T.nilable(String), - type: - T.nilable( - ModerationAPI::Models::ActionRetrieveResponse::Type::TaggedSymbol - ) - } - ) - end - def to_hash - end - - # Show the action in all queues, selected queues or no queues (to use via API - # only). - module Position - extend ModerationAPI::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all( - Symbol, - ModerationAPI::Models::ActionRetrieveResponse::Position - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - ALL_QUEUES = - T.let( - :ALL_QUEUES, - ModerationAPI::Models::ActionRetrieveResponse::Position::TaggedSymbol - ) - SOME_QUEUES = - T.let( - :SOME_QUEUES, - ModerationAPI::Models::ActionRetrieveResponse::Position::TaggedSymbol - ) - HIDDEN = - T.let( - :HIDDEN, - ModerationAPI::Models::ActionRetrieveResponse::Position::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - ModerationAPI::Models::ActionRetrieveResponse::Position::TaggedSymbol - ] - ) - end - def self.values - end - end - - class PossibleValue < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::Models::ActionRetrieveResponse::PossibleValue, - ModerationAPI::Internal::AnyHash - ) - end - - # The value of the action. - sig { returns(String) } - attr_accessor :value - - sig { params(value: String).returns(T.attached_class) } - def self.new( - # The value of the action. - value: - ) - end - - sig { override.returns({ value: String }) } - def to_hash - end - end - - # Whether the action resolves and removes the item, unresolves and re-add it to - # the queue, or does not change the resolve status. - module QueueBehaviour - extend ModerationAPI::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all( - Symbol, - ModerationAPI::Models::ActionRetrieveResponse::QueueBehaviour - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - REMOVE = - T.let( - :REMOVE, - ModerationAPI::Models::ActionRetrieveResponse::QueueBehaviour::TaggedSymbol - ) - ADD = - T.let( - :ADD, - ModerationAPI::Models::ActionRetrieveResponse::QueueBehaviour::TaggedSymbol - ) - NO_CHANGE = - T.let( - :NO_CHANGE, - ModerationAPI::Models::ActionRetrieveResponse::QueueBehaviour::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - ModerationAPI::Models::ActionRetrieveResponse::QueueBehaviour::TaggedSymbol - ] - ) - end - def self.values - end - end - - # The type of the action. - module Type - extend ModerationAPI::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all(Symbol, ModerationAPI::Models::ActionRetrieveResponse::Type) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - AUTHOR_BLOCK = - T.let( - :AUTHOR_BLOCK, - ModerationAPI::Models::ActionRetrieveResponse::Type::TaggedSymbol - ) - AUTHOR_BLOCK_TEMP = - T.let( - :AUTHOR_BLOCK_TEMP, - ModerationAPI::Models::ActionRetrieveResponse::Type::TaggedSymbol - ) - AUTHOR_UNBLOCK = - T.let( - :AUTHOR_UNBLOCK, - ModerationAPI::Models::ActionRetrieveResponse::Type::TaggedSymbol - ) - AUTHOR_DELETE = - T.let( - :AUTHOR_DELETE, - ModerationAPI::Models::ActionRetrieveResponse::Type::TaggedSymbol - ) - AUTHOR_REPORT = - T.let( - :AUTHOR_REPORT, - ModerationAPI::Models::ActionRetrieveResponse::Type::TaggedSymbol - ) - AUTHOR_WARN = - T.let( - :AUTHOR_WARN, - ModerationAPI::Models::ActionRetrieveResponse::Type::TaggedSymbol - ) - AUTHOR_CUSTOM = - T.let( - :AUTHOR_CUSTOM, - ModerationAPI::Models::ActionRetrieveResponse::Type::TaggedSymbol - ) - ITEM_REJECT = - T.let( - :ITEM_REJECT, - ModerationAPI::Models::ActionRetrieveResponse::Type::TaggedSymbol - ) - ITEM_ALLOW = - T.let( - :ITEM_ALLOW, - ModerationAPI::Models::ActionRetrieveResponse::Type::TaggedSymbol - ) - ITEM_CUSTOM = - T.let( - :ITEM_CUSTOM, - ModerationAPI::Models::ActionRetrieveResponse::Type::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - ModerationAPI::Models::ActionRetrieveResponse::Type::TaggedSymbol - ] - ) - end - def self.values - end - end - end - end -end diff --git a/rbi/moderation_api/models/action_update_params.rbi b/rbi/moderation_api/models/action_update_params.rbi deleted file mode 100644 index cc3b018a..00000000 --- a/rbi/moderation_api/models/action_update_params.rbi +++ /dev/null @@ -1,364 +0,0 @@ -# typed: strong - -module ModerationAPI - module Models - class ActionUpdateParams < ModerationAPI::Internal::Type::BaseModel - extend ModerationAPI::Internal::Type::RequestParameters::Converter - include ModerationAPI::Internal::Type::RequestParameters - - OrHash = - T.type_alias do - T.any( - ModerationAPI::ActionUpdateParams, - ModerationAPI::Internal::AnyHash - ) - end - - # The ID of the action to update. - sig { returns(String) } - attr_accessor :id - - # Whether the action is a built-in action or a custom one. - sig { returns(T.nilable(T::Boolean)) } - attr_accessor :built_in - - # The description of the action. - sig { returns(T.nilable(String)) } - attr_accessor :description - - # The IDs of the queues the action is available in. - sig { returns(T.nilable(T::Array[String])) } - attr_reader :filter_in_queue_ids - - sig { params(filter_in_queue_ids: T::Array[String]).void } - attr_writer :filter_in_queue_ids - - # Whether the action allows any text to be entered as a value or if it must be one - # of the possible values. - sig { returns(T.nilable(T::Boolean)) } - attr_reader :free_text - - sig { params(free_text: T::Boolean).void } - attr_writer :free_text - - # User defined key of the action. - sig { returns(T.nilable(String)) } - attr_accessor :key - - # The name of the action. - sig { returns(T.nilable(String)) } - attr_reader :name - - sig { params(name: String).void } - attr_writer :name - - # Show the action in all queues, selected queues or no queues (to use via API - # only). - sig do - returns( - T.nilable(ModerationAPI::ActionUpdateParams::Position::OrSymbol) - ) - end - attr_reader :position - - sig do - params( - position: ModerationAPI::ActionUpdateParams::Position::OrSymbol - ).void - end - attr_writer :position - - # The possible values of the action. The user will be prompted to select one of - # these values when executing the action. - sig do - returns( - T.nilable(T::Array[ModerationAPI::ActionUpdateParams::PossibleValue]) - ) - end - attr_reader :possible_values - - sig do - params( - possible_values: - T::Array[ModerationAPI::ActionUpdateParams::PossibleValue::OrHash] - ).void - end - attr_writer :possible_values - - # Whether the action resolves and removes the item, unresolves and re-add it to - # the queue, or does not change the resolve status. - sig do - returns( - T.nilable(ModerationAPI::ActionUpdateParams::QueueBehaviour::OrSymbol) - ) - end - attr_reader :queue_behaviour - - sig do - params( - queue_behaviour: - ModerationAPI::ActionUpdateParams::QueueBehaviour::OrSymbol - ).void - end - attr_writer :queue_behaviour - - # The type of the action. - sig do - returns(T.nilable(ModerationAPI::ActionUpdateParams::Type::OrSymbol)) - end - attr_accessor :type - - # Whether the action requires a value to be executed. - sig { returns(T.nilable(T::Boolean)) } - attr_reader :value_required - - sig { params(value_required: T::Boolean).void } - attr_writer :value_required - - sig do - params( - id: String, - built_in: T.nilable(T::Boolean), - description: T.nilable(String), - filter_in_queue_ids: T::Array[String], - free_text: T::Boolean, - key: T.nilable(String), - name: String, - position: ModerationAPI::ActionUpdateParams::Position::OrSymbol, - possible_values: - T::Array[ModerationAPI::ActionUpdateParams::PossibleValue::OrHash], - queue_behaviour: - ModerationAPI::ActionUpdateParams::QueueBehaviour::OrSymbol, - type: T.nilable(ModerationAPI::ActionUpdateParams::Type::OrSymbol), - value_required: T::Boolean, - request_options: ModerationAPI::RequestOptions::OrHash - ).returns(T.attached_class) - end - def self.new( - # The ID of the action to update. - id:, - # Whether the action is a built-in action or a custom one. - built_in: nil, - # The description of the action. - description: nil, - # The IDs of the queues the action is available in. - filter_in_queue_ids: nil, - # Whether the action allows any text to be entered as a value or if it must be one - # of the possible values. - free_text: nil, - # User defined key of the action. - key: nil, - # The name of the action. - name: nil, - # Show the action in all queues, selected queues or no queues (to use via API - # only). - position: nil, - # The possible values of the action. The user will be prompted to select one of - # these values when executing the action. - possible_values: nil, - # Whether the action resolves and removes the item, unresolves and re-add it to - # the queue, or does not change the resolve status. - queue_behaviour: nil, - # The type of the action. - type: nil, - # Whether the action requires a value to be executed. - value_required: nil, - request_options: {} - ) - end - - sig do - override.returns( - { - id: String, - built_in: T.nilable(T::Boolean), - description: T.nilable(String), - filter_in_queue_ids: T::Array[String], - free_text: T::Boolean, - key: T.nilable(String), - name: String, - position: ModerationAPI::ActionUpdateParams::Position::OrSymbol, - possible_values: - T::Array[ModerationAPI::ActionUpdateParams::PossibleValue], - queue_behaviour: - ModerationAPI::ActionUpdateParams::QueueBehaviour::OrSymbol, - type: T.nilable(ModerationAPI::ActionUpdateParams::Type::OrSymbol), - value_required: T::Boolean, - request_options: ModerationAPI::RequestOptions - } - ) - end - def to_hash - end - - # Show the action in all queues, selected queues or no queues (to use via API - # only). - module Position - extend ModerationAPI::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all(Symbol, ModerationAPI::ActionUpdateParams::Position) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - ALL_QUEUES = - T.let( - :ALL_QUEUES, - ModerationAPI::ActionUpdateParams::Position::TaggedSymbol - ) - SOME_QUEUES = - T.let( - :SOME_QUEUES, - ModerationAPI::ActionUpdateParams::Position::TaggedSymbol - ) - HIDDEN = - T.let( - :HIDDEN, - ModerationAPI::ActionUpdateParams::Position::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ModerationAPI::ActionUpdateParams::Position::TaggedSymbol] - ) - end - def self.values - end - end - - class PossibleValue < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::ActionUpdateParams::PossibleValue, - ModerationAPI::Internal::AnyHash - ) - end - - # The value of the action. - sig { returns(String) } - attr_accessor :value - - sig { params(value: String).returns(T.attached_class) } - def self.new( - # The value of the action. - value: - ) - end - - sig { override.returns({ value: String }) } - def to_hash - end - end - - # Whether the action resolves and removes the item, unresolves and re-add it to - # the queue, or does not change the resolve status. - module QueueBehaviour - extend ModerationAPI::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all(Symbol, ModerationAPI::ActionUpdateParams::QueueBehaviour) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - REMOVE = - T.let( - :REMOVE, - ModerationAPI::ActionUpdateParams::QueueBehaviour::TaggedSymbol - ) - ADD = - T.let( - :ADD, - ModerationAPI::ActionUpdateParams::QueueBehaviour::TaggedSymbol - ) - NO_CHANGE = - T.let( - :NO_CHANGE, - ModerationAPI::ActionUpdateParams::QueueBehaviour::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - ModerationAPI::ActionUpdateParams::QueueBehaviour::TaggedSymbol - ] - ) - end - def self.values - end - end - - # The type of the action. - module Type - extend ModerationAPI::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all(Symbol, ModerationAPI::ActionUpdateParams::Type) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - AUTHOR_BLOCK = - T.let( - :AUTHOR_BLOCK, - ModerationAPI::ActionUpdateParams::Type::TaggedSymbol - ) - AUTHOR_BLOCK_TEMP = - T.let( - :AUTHOR_BLOCK_TEMP, - ModerationAPI::ActionUpdateParams::Type::TaggedSymbol - ) - AUTHOR_UNBLOCK = - T.let( - :AUTHOR_UNBLOCK, - ModerationAPI::ActionUpdateParams::Type::TaggedSymbol - ) - AUTHOR_DELETE = - T.let( - :AUTHOR_DELETE, - ModerationAPI::ActionUpdateParams::Type::TaggedSymbol - ) - AUTHOR_REPORT = - T.let( - :AUTHOR_REPORT, - ModerationAPI::ActionUpdateParams::Type::TaggedSymbol - ) - AUTHOR_WARN = - T.let( - :AUTHOR_WARN, - ModerationAPI::ActionUpdateParams::Type::TaggedSymbol - ) - AUTHOR_CUSTOM = - T.let( - :AUTHOR_CUSTOM, - ModerationAPI::ActionUpdateParams::Type::TaggedSymbol - ) - ITEM_REJECT = - T.let( - :ITEM_REJECT, - ModerationAPI::ActionUpdateParams::Type::TaggedSymbol - ) - ITEM_ALLOW = - T.let( - :ITEM_ALLOW, - ModerationAPI::ActionUpdateParams::Type::TaggedSymbol - ) - ITEM_CUSTOM = - T.let( - :ITEM_CUSTOM, - ModerationAPI::ActionUpdateParams::Type::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ModerationAPI::ActionUpdateParams::Type::TaggedSymbol] - ) - end - def self.values - end - end - end - end -end diff --git a/rbi/moderation_api/models/action_update_response.rbi b/rbi/moderation_api/models/action_update_response.rbi deleted file mode 100644 index 46616796..00000000 --- a/rbi/moderation_api/models/action_update_response.rbi +++ /dev/null @@ -1,354 +0,0 @@ -# typed: strong - -module ModerationAPI - module Models - class ActionUpdateResponse < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::Models::ActionUpdateResponse, - ModerationAPI::Internal::AnyHash - ) - end - - # The ID of the action. - sig { returns(String) } - attr_accessor :id - - # Whether the action is a built-in action or a custom one. - sig { returns(T.nilable(T::Boolean)) } - attr_accessor :built_in - - # The date the action was created. - sig { returns(String) } - attr_accessor :created_at - - # The IDs of the queues the action is available in. - sig { returns(T::Array[String]) } - attr_accessor :filter_in_queue_ids - - # Whether the action allows any text to be entered as a value or if it must be one - # of the possible values. - sig { returns(T::Boolean) } - attr_accessor :free_text - - # The name of the action. - sig { returns(String) } - attr_accessor :name - - # Show the action in all queues, selected queues or no queues (to use via API - # only). - sig do - returns( - ModerationAPI::Models::ActionUpdateResponse::Position::TaggedSymbol - ) - end - attr_accessor :position - - # The possible values of the action. The user will be prompted to select one of - # these values when executing the action. - sig do - returns( - T::Array[ModerationAPI::Models::ActionUpdateResponse::PossibleValue] - ) - end - attr_accessor :possible_values - - # Whether the action resolves and removes the item, unresolves and re-add it to - # the queue, or does not change the resolve status. - sig do - returns( - ModerationAPI::Models::ActionUpdateResponse::QueueBehaviour::TaggedSymbol - ) - end - attr_accessor :queue_behaviour - - # Whether the action requires a value to be executed. - sig { returns(T::Boolean) } - attr_accessor :value_required - - # The description of the action. - sig { returns(T.nilable(String)) } - attr_accessor :description - - # User defined key of the action. - sig { returns(T.nilable(String)) } - attr_accessor :key - - # The type of the action. - sig do - returns( - T.nilable( - ModerationAPI::Models::ActionUpdateResponse::Type::TaggedSymbol - ) - ) - end - attr_accessor :type - - sig do - params( - id: String, - built_in: T.nilable(T::Boolean), - created_at: String, - filter_in_queue_ids: T::Array[String], - free_text: T::Boolean, - name: String, - position: - ModerationAPI::Models::ActionUpdateResponse::Position::OrSymbol, - possible_values: - T::Array[ - ModerationAPI::Models::ActionUpdateResponse::PossibleValue::OrHash - ], - queue_behaviour: - ModerationAPI::Models::ActionUpdateResponse::QueueBehaviour::OrSymbol, - value_required: T::Boolean, - description: T.nilable(String), - key: T.nilable(String), - type: - T.nilable( - ModerationAPI::Models::ActionUpdateResponse::Type::OrSymbol - ) - ).returns(T.attached_class) - end - def self.new( - # The ID of the action. - id:, - # Whether the action is a built-in action or a custom one. - built_in:, - # The date the action was created. - created_at:, - # The IDs of the queues the action is available in. - filter_in_queue_ids:, - # Whether the action allows any text to be entered as a value or if it must be one - # of the possible values. - free_text:, - # The name of the action. - name:, - # Show the action in all queues, selected queues or no queues (to use via API - # only). - position:, - # The possible values of the action. The user will be prompted to select one of - # these values when executing the action. - possible_values:, - # Whether the action resolves and removes the item, unresolves and re-add it to - # the queue, or does not change the resolve status. - queue_behaviour:, - # Whether the action requires a value to be executed. - value_required:, - # The description of the action. - description: nil, - # User defined key of the action. - key: nil, - # The type of the action. - type: nil - ) - end - - sig do - override.returns( - { - id: String, - built_in: T.nilable(T::Boolean), - created_at: String, - filter_in_queue_ids: T::Array[String], - free_text: T::Boolean, - name: String, - position: - ModerationAPI::Models::ActionUpdateResponse::Position::TaggedSymbol, - possible_values: - T::Array[ - ModerationAPI::Models::ActionUpdateResponse::PossibleValue - ], - queue_behaviour: - ModerationAPI::Models::ActionUpdateResponse::QueueBehaviour::TaggedSymbol, - value_required: T::Boolean, - description: T.nilable(String), - key: T.nilable(String), - type: - T.nilable( - ModerationAPI::Models::ActionUpdateResponse::Type::TaggedSymbol - ) - } - ) - end - def to_hash - end - - # Show the action in all queues, selected queues or no queues (to use via API - # only). - module Position - extend ModerationAPI::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all(Symbol, ModerationAPI::Models::ActionUpdateResponse::Position) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - ALL_QUEUES = - T.let( - :ALL_QUEUES, - ModerationAPI::Models::ActionUpdateResponse::Position::TaggedSymbol - ) - SOME_QUEUES = - T.let( - :SOME_QUEUES, - ModerationAPI::Models::ActionUpdateResponse::Position::TaggedSymbol - ) - HIDDEN = - T.let( - :HIDDEN, - ModerationAPI::Models::ActionUpdateResponse::Position::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - ModerationAPI::Models::ActionUpdateResponse::Position::TaggedSymbol - ] - ) - end - def self.values - end - end - - class PossibleValue < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::Models::ActionUpdateResponse::PossibleValue, - ModerationAPI::Internal::AnyHash - ) - end - - # The value of the action. - sig { returns(String) } - attr_accessor :value - - sig { params(value: String).returns(T.attached_class) } - def self.new( - # The value of the action. - value: - ) - end - - sig { override.returns({ value: String }) } - def to_hash - end - end - - # Whether the action resolves and removes the item, unresolves and re-add it to - # the queue, or does not change the resolve status. - module QueueBehaviour - extend ModerationAPI::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all( - Symbol, - ModerationAPI::Models::ActionUpdateResponse::QueueBehaviour - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - REMOVE = - T.let( - :REMOVE, - ModerationAPI::Models::ActionUpdateResponse::QueueBehaviour::TaggedSymbol - ) - ADD = - T.let( - :ADD, - ModerationAPI::Models::ActionUpdateResponse::QueueBehaviour::TaggedSymbol - ) - NO_CHANGE = - T.let( - :NO_CHANGE, - ModerationAPI::Models::ActionUpdateResponse::QueueBehaviour::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - ModerationAPI::Models::ActionUpdateResponse::QueueBehaviour::TaggedSymbol - ] - ) - end - def self.values - end - end - - # The type of the action. - module Type - extend ModerationAPI::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all(Symbol, ModerationAPI::Models::ActionUpdateResponse::Type) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - AUTHOR_BLOCK = - T.let( - :AUTHOR_BLOCK, - ModerationAPI::Models::ActionUpdateResponse::Type::TaggedSymbol - ) - AUTHOR_BLOCK_TEMP = - T.let( - :AUTHOR_BLOCK_TEMP, - ModerationAPI::Models::ActionUpdateResponse::Type::TaggedSymbol - ) - AUTHOR_UNBLOCK = - T.let( - :AUTHOR_UNBLOCK, - ModerationAPI::Models::ActionUpdateResponse::Type::TaggedSymbol - ) - AUTHOR_DELETE = - T.let( - :AUTHOR_DELETE, - ModerationAPI::Models::ActionUpdateResponse::Type::TaggedSymbol - ) - AUTHOR_REPORT = - T.let( - :AUTHOR_REPORT, - ModerationAPI::Models::ActionUpdateResponse::Type::TaggedSymbol - ) - AUTHOR_WARN = - T.let( - :AUTHOR_WARN, - ModerationAPI::Models::ActionUpdateResponse::Type::TaggedSymbol - ) - AUTHOR_CUSTOM = - T.let( - :AUTHOR_CUSTOM, - ModerationAPI::Models::ActionUpdateResponse::Type::TaggedSymbol - ) - ITEM_REJECT = - T.let( - :ITEM_REJECT, - ModerationAPI::Models::ActionUpdateResponse::Type::TaggedSymbol - ) - ITEM_ALLOW = - T.let( - :ITEM_ALLOW, - ModerationAPI::Models::ActionUpdateResponse::Type::TaggedSymbol - ) - ITEM_CUSTOM = - T.let( - :ITEM_CUSTOM, - ModerationAPI::Models::ActionUpdateResponse::Type::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - ModerationAPI::Models::ActionUpdateResponse::Type::TaggedSymbol - ] - ) - end - def self.values - end - end - end - end -end diff --git a/rbi/moderation_api/models/actions/execute_execute_by_id_params.rbi b/rbi/moderation_api/models/actions/execute_execute_by_id_params.rbi deleted file mode 100644 index ac0b2535..00000000 --- a/rbi/moderation_api/models/actions/execute_execute_by_id_params.rbi +++ /dev/null @@ -1,92 +0,0 @@ -# typed: strong - -module ModerationAPI - module Models - module Actions - class ExecuteExecuteByIDParams < ModerationAPI::Internal::Type::BaseModel - extend ModerationAPI::Internal::Type::RequestParameters::Converter - include ModerationAPI::Internal::Type::RequestParameters - - OrHash = - T.type_alias do - T.any( - ModerationAPI::Actions::ExecuteExecuteByIDParams, - ModerationAPI::Internal::AnyHash - ) - end - - # The ID or key of the action to execute. - sig { returns(String) } - attr_accessor :action_id - - # IDs of the authors to apply the action to - sig { returns(T.nilable(T::Array[String])) } - attr_reader :author_ids - - sig { params(author_ids: T::Array[String]).void } - attr_writer :author_ids - - # The IDs of the content items to perform the action on. - sig { returns(T.nilable(T::Array[String])) } - attr_reader :content_ids - - sig { params(content_ids: T::Array[String]).void } - attr_writer :content_ids - - # The ID of the queue the action was performed from if any. - sig { returns(T.nilable(String)) } - attr_reader :queue_id - - sig { params(queue_id: String).void } - attr_writer :queue_id - - # The value of the action. Useful to set a reason for the action etc. - sig { returns(T.nilable(String)) } - attr_reader :value - - sig { params(value: String).void } - attr_writer :value - - sig do - params( - action_id: String, - author_ids: T::Array[String], - content_ids: T::Array[String], - queue_id: String, - value: String, - request_options: ModerationAPI::RequestOptions::OrHash - ).returns(T.attached_class) - end - def self.new( - # The ID or key of the action to execute. - action_id:, - # IDs of the authors to apply the action to - author_ids: nil, - # The IDs of the content items to perform the action on. - content_ids: nil, - # The ID of the queue the action was performed from if any. - queue_id: nil, - # The value of the action. Useful to set a reason for the action etc. - value: nil, - request_options: {} - ) - end - - sig do - override.returns( - { - action_id: String, - author_ids: T::Array[String], - content_ids: T::Array[String], - queue_id: String, - value: String, - request_options: ModerationAPI::RequestOptions - } - ) - end - def to_hash - end - end - end - end -end diff --git a/rbi/moderation_api/models/actions/execute_execute_by_id_response.rbi b/rbi/moderation_api/models/actions/execute_execute_by_id_response.rbi deleted file mode 100644 index 73ad1437..00000000 --- a/rbi/moderation_api/models/actions/execute_execute_by_id_response.rbi +++ /dev/null @@ -1,54 +0,0 @@ -# typed: strong - -module ModerationAPI - module Models - module Actions - class ExecuteExecuteByIDResponse < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::Models::Actions::ExecuteExecuteByIDResponse, - ModerationAPI::Internal::AnyHash - ) - end - - # The ID of the action. - sig { returns(String) } - attr_accessor :action_id - - # The IDs of the content items. - sig { returns(T::Array[String]) } - attr_accessor :ids - - # Action executed successfully. - sig { returns(T::Boolean) } - attr_accessor :success - - sig do - params( - action_id: String, - ids: T::Array[String], - success: T::Boolean - ).returns(T.attached_class) - end - def self.new( - # The ID of the action. - action_id:, - # The IDs of the content items. - ids:, - # Action executed successfully. - success: - ) - end - - sig do - override.returns( - { action_id: String, ids: T::Array[String], success: T::Boolean } - ) - end - def to_hash - end - end - end - end -end diff --git a/rbi/moderation_api/models/actions/execute_execute_params.rbi b/rbi/moderation_api/models/actions/execute_execute_params.rbi deleted file mode 100644 index d9edf926..00000000 --- a/rbi/moderation_api/models/actions/execute_execute_params.rbi +++ /dev/null @@ -1,103 +0,0 @@ -# typed: strong - -module ModerationAPI - module Models - module Actions - class ExecuteExecuteParams < ModerationAPI::Internal::Type::BaseModel - extend ModerationAPI::Internal::Type::RequestParameters::Converter - include ModerationAPI::Internal::Type::RequestParameters - - OrHash = - T.type_alias do - T.any( - ModerationAPI::Actions::ExecuteExecuteParams, - ModerationAPI::Internal::AnyHash - ) - end - - # ID or key of the action to execute - sig { returns(String) } - attr_accessor :action_key - - # IDs of the authors to apply the action to. Provide this or contentIds. - sig { returns(T.nilable(T::Array[String])) } - attr_reader :author_ids - - sig { params(author_ids: T::Array[String]).void } - attr_writer :author_ids - - # IDs of the content items to apply the action to. Provide this or authorIds. - sig { returns(T.nilable(T::Array[String])) } - attr_reader :content_ids - - sig { params(content_ids: T::Array[String]).void } - attr_writer :content_ids - - # Optional duration in milliseconds for actions with timeouts - sig { returns(T.nilable(Float)) } - attr_reader :duration - - sig { params(duration: Float).void } - attr_writer :duration - - # Optional queue ID if the action is queue-specific - sig { returns(T.nilable(String)) } - attr_reader :queue_id - - sig { params(queue_id: String).void } - attr_writer :queue_id - - # Optional value to provide with the action - sig { returns(T.nilable(String)) } - attr_reader :value - - sig { params(value: String).void } - attr_writer :value - - sig do - params( - action_key: String, - author_ids: T::Array[String], - content_ids: T::Array[String], - duration: Float, - queue_id: String, - value: String, - request_options: ModerationAPI::RequestOptions::OrHash - ).returns(T.attached_class) - end - def self.new( - # ID or key of the action to execute - action_key:, - # IDs of the authors to apply the action to. Provide this or contentIds. - author_ids: nil, - # IDs of the content items to apply the action to. Provide this or authorIds. - content_ids: nil, - # Optional duration in milliseconds for actions with timeouts - duration: nil, - # Optional queue ID if the action is queue-specific - queue_id: nil, - # Optional value to provide with the action - value: nil, - request_options: {} - ) - end - - sig do - override.returns( - { - action_key: String, - author_ids: T::Array[String], - content_ids: T::Array[String], - duration: Float, - queue_id: String, - value: String, - request_options: ModerationAPI::RequestOptions - } - ) - end - def to_hash - end - end - end - end -end diff --git a/rbi/moderation_api/models/actions/execute_execute_response.rbi b/rbi/moderation_api/models/actions/execute_execute_response.rbi deleted file mode 100644 index 0d49a9be..00000000 --- a/rbi/moderation_api/models/actions/execute_execute_response.rbi +++ /dev/null @@ -1,33 +0,0 @@ -# typed: strong - -module ModerationAPI - module Models - module Actions - class ExecuteExecuteResponse < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::Models::Actions::ExecuteExecuteResponse, - ModerationAPI::Internal::AnyHash - ) - end - - # Whether the action was executed successfully - sig { returns(T::Boolean) } - attr_accessor :success - - # Execution result - sig { params(success: T::Boolean).returns(T.attached_class) } - def self.new( - # Whether the action was executed successfully - success: - ) - end - - sig { override.returns({ success: T::Boolean }) } - def to_hash - end - end - end - end -end diff --git a/rbi/moderation_api/models/auth_create_params.rbi b/rbi/moderation_api/models/auth_create_params.rbi deleted file mode 100644 index db3e72d1..00000000 --- a/rbi/moderation_api/models/auth_create_params.rbi +++ /dev/null @@ -1,32 +0,0 @@ -# typed: strong - -module ModerationAPI - module Models - class AuthCreateParams < ModerationAPI::Internal::Type::BaseModel - extend ModerationAPI::Internal::Type::RequestParameters::Converter - include ModerationAPI::Internal::Type::RequestParameters - - OrHash = - T.type_alias do - T.any( - ModerationAPI::AuthCreateParams, - ModerationAPI::Internal::AnyHash - ) - end - - sig do - params(request_options: ModerationAPI::RequestOptions::OrHash).returns( - T.attached_class - ) - end - def self.new(request_options: {}) - end - - sig do - override.returns({ request_options: ModerationAPI::RequestOptions }) - end - def to_hash - end - end - end -end diff --git a/rbi/moderation_api/models/auth_create_response.rbi b/rbi/moderation_api/models/auth_create_response.rbi deleted file mode 100644 index 0aeace89..00000000 --- a/rbi/moderation_api/models/auth_create_response.rbi +++ /dev/null @@ -1,48 +0,0 @@ -# typed: strong - -module ModerationAPI - module Models - class AuthCreateResponse < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::Models::AuthCreateResponse, - ModerationAPI::Internal::AnyHash - ) - end - - # Message of the authentication - sig { returns(String) } - attr_accessor :message - - # Name of the authenticated project - sig { returns(String) } - attr_accessor :project - - # Status of the authentication - sig { returns(String) } - attr_accessor :status - - sig do - params(message: String, project: String, status: String).returns( - T.attached_class - ) - end - def self.new( - # Message of the authentication - message:, - # Name of the authenticated project - project:, - # Status of the authentication - status: - ) - end - - sig do - override.returns({ message: String, project: String, status: String }) - end - def to_hash - end - end - end -end diff --git a/rbi/moderation_api/models/auth_retrieve_params.rbi b/rbi/moderation_api/models/auth_retrieve_params.rbi deleted file mode 100644 index 05a0e2c6..00000000 --- a/rbi/moderation_api/models/auth_retrieve_params.rbi +++ /dev/null @@ -1,32 +0,0 @@ -# typed: strong - -module ModerationAPI - module Models - class AuthRetrieveParams < ModerationAPI::Internal::Type::BaseModel - extend ModerationAPI::Internal::Type::RequestParameters::Converter - include ModerationAPI::Internal::Type::RequestParameters - - OrHash = - T.type_alias do - T.any( - ModerationAPI::AuthRetrieveParams, - ModerationAPI::Internal::AnyHash - ) - end - - sig do - params(request_options: ModerationAPI::RequestOptions::OrHash).returns( - T.attached_class - ) - end - def self.new(request_options: {}) - end - - sig do - override.returns({ request_options: ModerationAPI::RequestOptions }) - end - def to_hash - end - end - end -end diff --git a/rbi/moderation_api/models/auth_retrieve_response.rbi b/rbi/moderation_api/models/auth_retrieve_response.rbi deleted file mode 100644 index 630cfc0d..00000000 --- a/rbi/moderation_api/models/auth_retrieve_response.rbi +++ /dev/null @@ -1,36 +0,0 @@ -# typed: strong - -module ModerationAPI - module Models - class AuthRetrieveResponse < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::Models::AuthRetrieveResponse, - ModerationAPI::Internal::AnyHash - ) - end - - # Message of the authentication - sig { returns(String) } - attr_accessor :message - - # Status of the authentication - sig { returns(String) } - attr_accessor :status - - sig { params(message: String, status: String).returns(T.attached_class) } - def self.new( - # Message of the authentication - message:, - # Status of the authentication - status: - ) - end - - sig { override.returns({ message: String, status: String }) } - def to_hash - end - end - end -end diff --git a/rbi/moderation_api/models/author_create_params.rbi b/rbi/moderation_api/models/author_create_params.rbi deleted file mode 100644 index f7947e28..00000000 --- a/rbi/moderation_api/models/author_create_params.rbi +++ /dev/null @@ -1,192 +0,0 @@ -# typed: strong - -module ModerationAPI - module Models - class AuthorCreateParams < ModerationAPI::Internal::Type::BaseModel - extend ModerationAPI::Internal::Type::RequestParameters::Converter - include ModerationAPI::Internal::Type::RequestParameters - - OrHash = - T.type_alias do - T.any( - ModerationAPI::AuthorCreateParams, - ModerationAPI::Internal::AnyHash - ) - end - - # External ID of the user, typically the ID of the author in your database. - sig { returns(String) } - attr_accessor :external_id - - # The author's company or organization - sig { returns(T.nilable(String)) } - attr_accessor :company - - # Author email address - sig { returns(T.nilable(String)) } - attr_accessor :email - - # URL of the author's external profile - sig { returns(T.nilable(String)) } - attr_accessor :external_link - - # Timestamp when author first appeared - sig { returns(T.nilable(Float)) } - attr_reader :first_seen - - sig { params(first_seen: Float).void } - attr_writer :first_seen - - # Timestamp of last activity - sig { returns(T.nilable(Float)) } - attr_reader :last_seen - - sig { params(last_seen: Float).void } - attr_writer :last_seen - - sig { returns(T.nilable(Float)) } - attr_accessor :manual_trust_level - - # Additional metadata provided by your system. We recommend including any relevant - # information that may assist in the moderation process. - sig { returns(T.nilable(ModerationAPI::AuthorCreateParams::Metadata)) } - attr_reader :metadata - - sig do - params( - metadata: ModerationAPI::AuthorCreateParams::Metadata::OrHash - ).void - end - attr_writer :metadata - - # Author name or identifier - sig { returns(T.nilable(String)) } - attr_accessor :name - - # URL of the author's profile picture - sig { returns(T.nilable(String)) } - attr_accessor :profile_picture - - sig do - params( - external_id: String, - company: T.nilable(String), - email: T.nilable(String), - external_link: T.nilable(String), - first_seen: Float, - last_seen: Float, - manual_trust_level: T.nilable(Float), - metadata: ModerationAPI::AuthorCreateParams::Metadata::OrHash, - name: T.nilable(String), - profile_picture: T.nilable(String), - request_options: ModerationAPI::RequestOptions::OrHash - ).returns(T.attached_class) - end - def self.new( - # External ID of the user, typically the ID of the author in your database. - external_id:, - # The author's company or organization - company: nil, - # Author email address - email: nil, - # URL of the author's external profile - external_link: nil, - # Timestamp when author first appeared - first_seen: nil, - # Timestamp of last activity - last_seen: nil, - manual_trust_level: nil, - # Additional metadata provided by your system. We recommend including any relevant - # information that may assist in the moderation process. - metadata: nil, - # Author name or identifier - name: nil, - # URL of the author's profile picture - profile_picture: nil, - request_options: {} - ) - end - - sig do - override.returns( - { - external_id: String, - company: T.nilable(String), - email: T.nilable(String), - external_link: T.nilable(String), - first_seen: Float, - last_seen: Float, - manual_trust_level: T.nilable(Float), - metadata: ModerationAPI::AuthorCreateParams::Metadata, - name: T.nilable(String), - profile_picture: T.nilable(String), - request_options: ModerationAPI::RequestOptions - } - ) - end - def to_hash - end - - class Metadata < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::AuthorCreateParams::Metadata, - ModerationAPI::Internal::AnyHash - ) - end - - # Whether the author's email is verified - sig { returns(T.nilable(T::Boolean)) } - attr_accessor :email_verified - - # Whether the author's identity is verified - sig { returns(T.nilable(T::Boolean)) } - attr_accessor :identity_verified - - # Whether the author is a paying customer - sig { returns(T.nilable(T::Boolean)) } - attr_accessor :is_paying_customer - - # Whether the author's phone number is verified - sig { returns(T.nilable(T::Boolean)) } - attr_accessor :phone_verified - - # Additional metadata provided by your system. We recommend including any relevant - # information that may assist in the moderation process. - sig do - params( - email_verified: T.nilable(T::Boolean), - identity_verified: T.nilable(T::Boolean), - is_paying_customer: T.nilable(T::Boolean), - phone_verified: T.nilable(T::Boolean) - ).returns(T.attached_class) - end - def self.new( - # Whether the author's email is verified - email_verified: nil, - # Whether the author's identity is verified - identity_verified: nil, - # Whether the author is a paying customer - is_paying_customer: nil, - # Whether the author's phone number is verified - phone_verified: nil - ) - end - - sig do - override.returns( - { - email_verified: T.nilable(T::Boolean), - identity_verified: T.nilable(T::Boolean), - is_paying_customer: T.nilable(T::Boolean), - phone_verified: T.nilable(T::Boolean) - } - ) - end - def to_hash - end - end - end - end -end diff --git a/rbi/moderation_api/models/author_create_response.rbi b/rbi/moderation_api/models/author_create_response.rbi deleted file mode 100644 index 4c2dab00..00000000 --- a/rbi/moderation_api/models/author_create_response.rbi +++ /dev/null @@ -1,475 +0,0 @@ -# typed: strong - -module ModerationAPI - module Models - class AuthorCreateResponse < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::Models::AuthorCreateResponse, - ModerationAPI::Internal::AnyHash - ) - end - - # Author ID in Moderation API - sig { returns(String) } - attr_accessor :id - - # Block or suspension details, if applicable. Null if the author is enabled. - sig do - returns(T.nilable(ModerationAPI::Models::AuthorCreateResponse::Block)) - end - attr_reader :block - - sig do - params( - block: - T.nilable( - ModerationAPI::Models::AuthorCreateResponse::Block::OrHash - ) - ).void - end - attr_writer :block - - # Timestamp when author first appeared - sig { returns(Float) } - attr_accessor :first_seen - - # Timestamp of last activity - sig { returns(Float) } - attr_accessor :last_seen - - # Additional metadata provided by your system. We recommend including any relevant - # information that may assist in the moderation process. - sig { returns(ModerationAPI::Models::AuthorCreateResponse::Metadata) } - attr_reader :metadata - - sig do - params( - metadata: - ModerationAPI::Models::AuthorCreateResponse::Metadata::OrHash - ).void - end - attr_writer :metadata - - sig { returns(ModerationAPI::Models::AuthorCreateResponse::Metrics) } - attr_reader :metrics - - sig do - params( - metrics: ModerationAPI::Models::AuthorCreateResponse::Metrics::OrHash - ).void - end - attr_writer :metrics - - # Risk assessment details, if available. - sig do - returns( - T.nilable(ModerationAPI::Models::AuthorCreateResponse::RiskEvaluation) - ) - end - attr_reader :risk_evaluation - - sig do - params( - risk_evaluation: - T.nilable( - ModerationAPI::Models::AuthorCreateResponse::RiskEvaluation::OrHash - ) - ).void - end - attr_writer :risk_evaluation - - # Current author status - sig do - returns( - ModerationAPI::Models::AuthorCreateResponse::Status::TaggedSymbol - ) - end - attr_accessor :status - - sig { returns(ModerationAPI::Models::AuthorCreateResponse::TrustLevel) } - attr_reader :trust_level - - sig do - params( - trust_level: - ModerationAPI::Models::AuthorCreateResponse::TrustLevel::OrHash - ).void - end - attr_writer :trust_level - - # The author's company or organization - sig { returns(T.nilable(String)) } - attr_accessor :company - - # Author email address - sig { returns(T.nilable(String)) } - attr_accessor :email - - # The author's ID from your system - sig { returns(T.nilable(String)) } - attr_accessor :external_id - - # URL of the author's external profile - sig { returns(T.nilable(String)) } - attr_accessor :external_link - - # Timestamp of last incident - sig { returns(T.nilable(Float)) } - attr_accessor :last_incident - - # Author name or identifier - sig { returns(T.nilable(String)) } - attr_accessor :name - - # URL of the author's profile picture - sig { returns(T.nilable(String)) } - attr_accessor :profile_picture - - sig do - params( - id: String, - block: - T.nilable( - ModerationAPI::Models::AuthorCreateResponse::Block::OrHash - ), - first_seen: Float, - last_seen: Float, - metadata: - ModerationAPI::Models::AuthorCreateResponse::Metadata::OrHash, - metrics: ModerationAPI::Models::AuthorCreateResponse::Metrics::OrHash, - risk_evaluation: - T.nilable( - ModerationAPI::Models::AuthorCreateResponse::RiskEvaluation::OrHash - ), - status: ModerationAPI::Models::AuthorCreateResponse::Status::OrSymbol, - trust_level: - ModerationAPI::Models::AuthorCreateResponse::TrustLevel::OrHash, - company: T.nilable(String), - email: T.nilable(String), - external_id: T.nilable(String), - external_link: T.nilable(String), - last_incident: T.nilable(Float), - name: T.nilable(String), - profile_picture: T.nilable(String) - ).returns(T.attached_class) - end - def self.new( - # Author ID in Moderation API - id:, - # Block or suspension details, if applicable. Null if the author is enabled. - block:, - # Timestamp when author first appeared - first_seen:, - # Timestamp of last activity - last_seen:, - # Additional metadata provided by your system. We recommend including any relevant - # information that may assist in the moderation process. - metadata:, - metrics:, - # Risk assessment details, if available. - risk_evaluation:, - # Current author status - status:, - trust_level:, - # The author's company or organization - company: nil, - # Author email address - email: nil, - # The author's ID from your system - external_id: nil, - # URL of the author's external profile - external_link: nil, - # Timestamp of last incident - last_incident: nil, - # Author name or identifier - name: nil, - # URL of the author's profile picture - profile_picture: nil - ) - end - - sig do - override.returns( - { - id: String, - block: - T.nilable(ModerationAPI::Models::AuthorCreateResponse::Block), - first_seen: Float, - last_seen: Float, - metadata: ModerationAPI::Models::AuthorCreateResponse::Metadata, - metrics: ModerationAPI::Models::AuthorCreateResponse::Metrics, - risk_evaluation: - T.nilable( - ModerationAPI::Models::AuthorCreateResponse::RiskEvaluation - ), - status: - ModerationAPI::Models::AuthorCreateResponse::Status::TaggedSymbol, - trust_level: - ModerationAPI::Models::AuthorCreateResponse::TrustLevel, - company: T.nilable(String), - email: T.nilable(String), - external_id: T.nilable(String), - external_link: T.nilable(String), - last_incident: T.nilable(Float), - name: T.nilable(String), - profile_picture: T.nilable(String) - } - ) - end - def to_hash - end - - class Block < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::Models::AuthorCreateResponse::Block, - ModerationAPI::Internal::AnyHash - ) - end - - # The moderators reason why the author was blocked or suspended. - sig { returns(T.nilable(String)) } - attr_accessor :reason - - # The timestamp until which they are blocked if the author is suspended. - sig { returns(T.nilable(Float)) } - attr_accessor :until_ - - # Block or suspension details, if applicable. Null if the author is enabled. - sig do - params(reason: T.nilable(String), until_: T.nilable(Float)).returns( - T.attached_class - ) - end - def self.new( - # The moderators reason why the author was blocked or suspended. - reason: nil, - # The timestamp until which they are blocked if the author is suspended. - until_: nil - ) - end - - sig do - override.returns( - { reason: T.nilable(String), until_: T.nilable(Float) } - ) - end - def to_hash - end - end - - class Metadata < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::Models::AuthorCreateResponse::Metadata, - ModerationAPI::Internal::AnyHash - ) - end - - # Whether the author's email is verified - sig { returns(T.nilable(T::Boolean)) } - attr_accessor :email_verified - - # Whether the author's identity is verified - sig { returns(T.nilable(T::Boolean)) } - attr_accessor :identity_verified - - # Whether the author is a paying customer - sig { returns(T.nilable(T::Boolean)) } - attr_accessor :is_paying_customer - - # Whether the author's phone number is verified - sig { returns(T.nilable(T::Boolean)) } - attr_accessor :phone_verified - - # Additional metadata provided by your system. We recommend including any relevant - # information that may assist in the moderation process. - sig do - params( - email_verified: T.nilable(T::Boolean), - identity_verified: T.nilable(T::Boolean), - is_paying_customer: T.nilable(T::Boolean), - phone_verified: T.nilable(T::Boolean) - ).returns(T.attached_class) - end - def self.new( - # Whether the author's email is verified - email_verified: nil, - # Whether the author's identity is verified - identity_verified: nil, - # Whether the author is a paying customer - is_paying_customer: nil, - # Whether the author's phone number is verified - phone_verified: nil - ) - end - - sig do - override.returns( - { - email_verified: T.nilable(T::Boolean), - identity_verified: T.nilable(T::Boolean), - is_paying_customer: T.nilable(T::Boolean), - phone_verified: T.nilable(T::Boolean) - } - ) - end - def to_hash - end - end - - class Metrics < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::Models::AuthorCreateResponse::Metrics, - ModerationAPI::Internal::AnyHash - ) - end - - # Number of flagged content pieces - sig { returns(Float) } - attr_accessor :flagged_content - - # Total pieces of content - sig { returns(Float) } - attr_accessor :total_content - - # Average sentiment score of content (-1 to 1). Requires a sentiment model in your - # project. - sig { returns(T.nilable(Float)) } - attr_accessor :average_sentiment - - sig do - params( - flagged_content: Float, - total_content: Float, - average_sentiment: T.nilable(Float) - ).returns(T.attached_class) - end - def self.new( - # Number of flagged content pieces - flagged_content:, - # Total pieces of content - total_content:, - # Average sentiment score of content (-1 to 1). Requires a sentiment model in your - # project. - average_sentiment: nil - ) - end - - sig do - override.returns( - { - flagged_content: Float, - total_content: Float, - average_sentiment: T.nilable(Float) - } - ) - end - def to_hash - end - end - - class RiskEvaluation < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::Models::AuthorCreateResponse::RiskEvaluation, - ModerationAPI::Internal::AnyHash - ) - end - - # Calculated risk level based on more than 10 behavioral signals. - sig { returns(T.nilable(Float)) } - attr_accessor :risk_level - - # Risk assessment details, if available. - sig { params(risk_level: T.nilable(Float)).returns(T.attached_class) } - def self.new( - # Calculated risk level based on more than 10 behavioral signals. - risk_level: nil - ) - end - - sig { override.returns({ risk_level: T.nilable(Float) }) } - def to_hash - end - end - - # Current author status - module Status - extend ModerationAPI::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all(Symbol, ModerationAPI::Models::AuthorCreateResponse::Status) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - ENABLED = - T.let( - :enabled, - ModerationAPI::Models::AuthorCreateResponse::Status::TaggedSymbol - ) - SUSPENDED = - T.let( - :suspended, - ModerationAPI::Models::AuthorCreateResponse::Status::TaggedSymbol - ) - BLOCKED = - T.let( - :blocked, - ModerationAPI::Models::AuthorCreateResponse::Status::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - ModerationAPI::Models::AuthorCreateResponse::Status::TaggedSymbol - ] - ) - end - def self.values - end - end - - class TrustLevel < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::Models::AuthorCreateResponse::TrustLevel, - ModerationAPI::Internal::AnyHash - ) - end - - # Author trust level (-1, 0, 1, 2, 3, or 4) - sig { returns(Float) } - attr_accessor :level - - # True if the trust level was set manually by a moderator - sig { returns(T::Boolean) } - attr_accessor :manual - - sig do - params(level: Float, manual: T::Boolean).returns(T.attached_class) - end - def self.new( - # Author trust level (-1, 0, 1, 2, 3, or 4) - level:, - # True if the trust level was set manually by a moderator - manual: - ) - end - - sig { override.returns({ level: Float, manual: T::Boolean }) } - def to_hash - end - end - end - end -end diff --git a/rbi/moderation_api/models/author_delete_params.rbi b/rbi/moderation_api/models/author_delete_params.rbi deleted file mode 100644 index 0c3e3748..00000000 --- a/rbi/moderation_api/models/author_delete_params.rbi +++ /dev/null @@ -1,43 +0,0 @@ -# typed: strong - -module ModerationAPI - module Models - class AuthorDeleteParams < ModerationAPI::Internal::Type::BaseModel - extend ModerationAPI::Internal::Type::RequestParameters::Converter - include ModerationAPI::Internal::Type::RequestParameters - - OrHash = - T.type_alias do - T.any( - ModerationAPI::AuthorDeleteParams, - ModerationAPI::Internal::AnyHash - ) - end - - # Either external ID or the ID assigned by moderation API. - sig { returns(String) } - attr_accessor :id - - sig do - params( - id: String, - request_options: ModerationAPI::RequestOptions::OrHash - ).returns(T.attached_class) - end - def self.new( - # Either external ID or the ID assigned by moderation API. - id:, - request_options: {} - ) - end - - sig do - override.returns( - { id: String, request_options: ModerationAPI::RequestOptions } - ) - end - def to_hash - end - end - end -end diff --git a/rbi/moderation_api/models/author_delete_response.rbi b/rbi/moderation_api/models/author_delete_response.rbi deleted file mode 100644 index 92cde6d8..00000000 --- a/rbi/moderation_api/models/author_delete_response.rbi +++ /dev/null @@ -1,26 +0,0 @@ -# typed: strong - -module ModerationAPI - module Models - class AuthorDeleteResponse < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::Models::AuthorDeleteResponse, - ModerationAPI::Internal::AnyHash - ) - end - - sig { returns(T::Boolean) } - attr_accessor :success - - sig { params(success: T::Boolean).returns(T.attached_class) } - def self.new(success:) - end - - sig { override.returns({ success: T::Boolean }) } - def to_hash - end - end - end -end diff --git a/rbi/moderation_api/models/author_list_params.rbi b/rbi/moderation_api/models/author_list_params.rbi deleted file mode 100644 index ad8bc8a9..00000000 --- a/rbi/moderation_api/models/author_list_params.rbi +++ /dev/null @@ -1,213 +0,0 @@ -# typed: strong - -module ModerationAPI - module Models - class AuthorListParams < ModerationAPI::Internal::Type::BaseModel - extend ModerationAPI::Internal::Type::RequestParameters::Converter - include ModerationAPI::Internal::Type::RequestParameters - - OrHash = - T.type_alias do - T.any( - ModerationAPI::AuthorListParams, - ModerationAPI::Internal::AnyHash - ) - end - - sig { returns(T.nilable(String)) } - attr_reader :content_types - - sig { params(content_types: String).void } - attr_writer :content_types - - sig { returns(T.nilable(String)) } - attr_reader :last_active_date - - sig { params(last_active_date: String).void } - attr_writer :last_active_date - - sig { returns(T.nilable(String)) } - attr_reader :member_since_date - - sig { params(member_since_date: String).void } - attr_writer :member_since_date - - # Page number to fetch - sig { returns(T.nilable(Float)) } - attr_reader :page_number - - sig { params(page_number: Float).void } - attr_writer :page_number - - # Number of authors per page - sig { returns(T.nilable(Float)) } - attr_reader :page_size - - sig { params(page_size: Float).void } - attr_writer :page_size - - sig do - returns(T.nilable(ModerationAPI::AuthorListParams::SortBy::OrSymbol)) - end - attr_reader :sort_by - - sig do - params(sort_by: ModerationAPI::AuthorListParams::SortBy::OrSymbol).void - end - attr_writer :sort_by - - # Sort direction - sig do - returns( - T.nilable(ModerationAPI::AuthorListParams::SortDirection::OrSymbol) - ) - end - attr_reader :sort_direction - - sig do - params( - sort_direction: - ModerationAPI::AuthorListParams::SortDirection::OrSymbol - ).void - end - attr_writer :sort_direction - - sig do - params( - content_types: String, - last_active_date: String, - member_since_date: String, - page_number: Float, - page_size: Float, - sort_by: ModerationAPI::AuthorListParams::SortBy::OrSymbol, - sort_direction: - ModerationAPI::AuthorListParams::SortDirection::OrSymbol, - request_options: ModerationAPI::RequestOptions::OrHash - ).returns(T.attached_class) - end - def self.new( - content_types: nil, - last_active_date: nil, - member_since_date: nil, - # Page number to fetch - page_number: nil, - # Number of authors per page - page_size: nil, - sort_by: nil, - # Sort direction - sort_direction: nil, - request_options: {} - ) - end - - sig do - override.returns( - { - content_types: String, - last_active_date: String, - member_since_date: String, - page_number: Float, - page_size: Float, - sort_by: ModerationAPI::AuthorListParams::SortBy::OrSymbol, - sort_direction: - ModerationAPI::AuthorListParams::SortDirection::OrSymbol, - request_options: ModerationAPI::RequestOptions - } - ) - end - def to_hash - end - - module SortBy - extend ModerationAPI::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all(Symbol, ModerationAPI::AuthorListParams::SortBy) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - TRUST_LEVEL = - T.let( - :trustLevel, - ModerationAPI::AuthorListParams::SortBy::TaggedSymbol - ) - VIOLATION_COUNT = - T.let( - :violationCount, - ModerationAPI::AuthorListParams::SortBy::TaggedSymbol - ) - REPORT_COUNT = - T.let( - :reportCount, - ModerationAPI::AuthorListParams::SortBy::TaggedSymbol - ) - MEMBER_SINCE = - T.let( - :memberSince, - ModerationAPI::AuthorListParams::SortBy::TaggedSymbol - ) - LAST_ACTIVE = - T.let( - :lastActive, - ModerationAPI::AuthorListParams::SortBy::TaggedSymbol - ) - CONTENT_COUNT = - T.let( - :contentCount, - ModerationAPI::AuthorListParams::SortBy::TaggedSymbol - ) - FLAGGED_CONTENT_RATIO = - T.let( - :flaggedContentRatio, - ModerationAPI::AuthorListParams::SortBy::TaggedSymbol - ) - AVERAGE_SENTIMENT = - T.let( - :averageSentiment, - ModerationAPI::AuthorListParams::SortBy::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ModerationAPI::AuthorListParams::SortBy::TaggedSymbol] - ) - end - def self.values - end - end - - # Sort direction - module SortDirection - extend ModerationAPI::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all(Symbol, ModerationAPI::AuthorListParams::SortDirection) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - ASC = - T.let( - :asc, - ModerationAPI::AuthorListParams::SortDirection::TaggedSymbol - ) - DESC = - T.let( - :desc, - ModerationAPI::AuthorListParams::SortDirection::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - ModerationAPI::AuthorListParams::SortDirection::TaggedSymbol - ] - ) - end - def self.values - end - end - end - end -end diff --git a/rbi/moderation_api/models/author_list_response.rbi b/rbi/moderation_api/models/author_list_response.rbi deleted file mode 100644 index fcb71fc5..00000000 --- a/rbi/moderation_api/models/author_list_response.rbi +++ /dev/null @@ -1,601 +0,0 @@ -# typed: strong - -module ModerationAPI - module Models - class AuthorListResponse < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::Models::AuthorListResponse, - ModerationAPI::Internal::AnyHash - ) - end - - sig do - returns(T::Array[ModerationAPI::Models::AuthorListResponse::Author]) - end - attr_accessor :authors - - sig { returns(ModerationAPI::Models::AuthorListResponse::Pagination) } - attr_reader :pagination - - sig do - params( - pagination: - ModerationAPI::Models::AuthorListResponse::Pagination::OrHash - ).void - end - attr_writer :pagination - - sig do - params( - authors: - T::Array[ModerationAPI::Models::AuthorListResponse::Author::OrHash], - pagination: - ModerationAPI::Models::AuthorListResponse::Pagination::OrHash - ).returns(T.attached_class) - end - def self.new(authors:, pagination:) - end - - sig do - override.returns( - { - authors: - T::Array[ModerationAPI::Models::AuthorListResponse::Author], - pagination: ModerationAPI::Models::AuthorListResponse::Pagination - } - ) - end - def to_hash - end - - class Author < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::Models::AuthorListResponse::Author, - ModerationAPI::Internal::AnyHash - ) - end - - # Author ID in Moderation API - sig { returns(String) } - attr_accessor :id - - # Block or suspension details, if applicable. Null if the author is enabled. - sig do - returns( - T.nilable(ModerationAPI::Models::AuthorListResponse::Author::Block) - ) - end - attr_reader :block - - sig do - params( - block: - T.nilable( - ModerationAPI::Models::AuthorListResponse::Author::Block::OrHash - ) - ).void - end - attr_writer :block - - # Timestamp when author first appeared - sig { returns(Float) } - attr_accessor :first_seen - - # Timestamp of last activity - sig { returns(Float) } - attr_accessor :last_seen - - # Additional metadata provided by your system. We recommend including any relevant - # information that may assist in the moderation process. - sig do - returns(ModerationAPI::Models::AuthorListResponse::Author::Metadata) - end - attr_reader :metadata - - sig do - params( - metadata: - ModerationAPI::Models::AuthorListResponse::Author::Metadata::OrHash - ).void - end - attr_writer :metadata - - sig do - returns(ModerationAPI::Models::AuthorListResponse::Author::Metrics) - end - attr_reader :metrics - - sig do - params( - metrics: - ModerationAPI::Models::AuthorListResponse::Author::Metrics::OrHash - ).void - end - attr_writer :metrics - - # Risk assessment details, if available. - sig do - returns( - T.nilable( - ModerationAPI::Models::AuthorListResponse::Author::RiskEvaluation - ) - ) - end - attr_reader :risk_evaluation - - sig do - params( - risk_evaluation: - T.nilable( - ModerationAPI::Models::AuthorListResponse::Author::RiskEvaluation::OrHash - ) - ).void - end - attr_writer :risk_evaluation - - # Current author status - sig do - returns( - ModerationAPI::Models::AuthorListResponse::Author::Status::TaggedSymbol - ) - end - attr_accessor :status - - sig do - returns(ModerationAPI::Models::AuthorListResponse::Author::TrustLevel) - end - attr_reader :trust_level - - sig do - params( - trust_level: - ModerationAPI::Models::AuthorListResponse::Author::TrustLevel::OrHash - ).void - end - attr_writer :trust_level - - # The author's company or organization - sig { returns(T.nilable(String)) } - attr_accessor :company - - # Author email address - sig { returns(T.nilable(String)) } - attr_accessor :email - - # The author's ID from your system - sig { returns(T.nilable(String)) } - attr_accessor :external_id - - # URL of the author's external profile - sig { returns(T.nilable(String)) } - attr_accessor :external_link - - # Timestamp of last incident - sig { returns(T.nilable(Float)) } - attr_accessor :last_incident - - # Author name or identifier - sig { returns(T.nilable(String)) } - attr_accessor :name - - # URL of the author's profile picture - sig { returns(T.nilable(String)) } - attr_accessor :profile_picture - - sig do - params( - id: String, - block: - T.nilable( - ModerationAPI::Models::AuthorListResponse::Author::Block::OrHash - ), - first_seen: Float, - last_seen: Float, - metadata: - ModerationAPI::Models::AuthorListResponse::Author::Metadata::OrHash, - metrics: - ModerationAPI::Models::AuthorListResponse::Author::Metrics::OrHash, - risk_evaluation: - T.nilable( - ModerationAPI::Models::AuthorListResponse::Author::RiskEvaluation::OrHash - ), - status: - ModerationAPI::Models::AuthorListResponse::Author::Status::OrSymbol, - trust_level: - ModerationAPI::Models::AuthorListResponse::Author::TrustLevel::OrHash, - company: T.nilable(String), - email: T.nilable(String), - external_id: T.nilable(String), - external_link: T.nilable(String), - last_incident: T.nilable(Float), - name: T.nilable(String), - profile_picture: T.nilable(String) - ).returns(T.attached_class) - end - def self.new( - # Author ID in Moderation API - id:, - # Block or suspension details, if applicable. Null if the author is enabled. - block:, - # Timestamp when author first appeared - first_seen:, - # Timestamp of last activity - last_seen:, - # Additional metadata provided by your system. We recommend including any relevant - # information that may assist in the moderation process. - metadata:, - metrics:, - # Risk assessment details, if available. - risk_evaluation:, - # Current author status - status:, - trust_level:, - # The author's company or organization - company: nil, - # Author email address - email: nil, - # The author's ID from your system - external_id: nil, - # URL of the author's external profile - external_link: nil, - # Timestamp of last incident - last_incident: nil, - # Author name or identifier - name: nil, - # URL of the author's profile picture - profile_picture: nil - ) - end - - sig do - override.returns( - { - id: String, - block: - T.nilable( - ModerationAPI::Models::AuthorListResponse::Author::Block - ), - first_seen: Float, - last_seen: Float, - metadata: - ModerationAPI::Models::AuthorListResponse::Author::Metadata, - metrics: - ModerationAPI::Models::AuthorListResponse::Author::Metrics, - risk_evaluation: - T.nilable( - ModerationAPI::Models::AuthorListResponse::Author::RiskEvaluation - ), - status: - ModerationAPI::Models::AuthorListResponse::Author::Status::TaggedSymbol, - trust_level: - ModerationAPI::Models::AuthorListResponse::Author::TrustLevel, - company: T.nilable(String), - email: T.nilable(String), - external_id: T.nilable(String), - external_link: T.nilable(String), - last_incident: T.nilable(Float), - name: T.nilable(String), - profile_picture: T.nilable(String) - } - ) - end - def to_hash - end - - class Block < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::Models::AuthorListResponse::Author::Block, - ModerationAPI::Internal::AnyHash - ) - end - - # The moderators reason why the author was blocked or suspended. - sig { returns(T.nilable(String)) } - attr_accessor :reason - - # The timestamp until which they are blocked if the author is suspended. - sig { returns(T.nilable(Float)) } - attr_accessor :until_ - - # Block or suspension details, if applicable. Null if the author is enabled. - sig do - params(reason: T.nilable(String), until_: T.nilable(Float)).returns( - T.attached_class - ) - end - def self.new( - # The moderators reason why the author was blocked or suspended. - reason: nil, - # The timestamp until which they are blocked if the author is suspended. - until_: nil - ) - end - - sig do - override.returns( - { reason: T.nilable(String), until_: T.nilable(Float) } - ) - end - def to_hash - end - end - - class Metadata < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::Models::AuthorListResponse::Author::Metadata, - ModerationAPI::Internal::AnyHash - ) - end - - # Whether the author's email is verified - sig { returns(T.nilable(T::Boolean)) } - attr_accessor :email_verified - - # Whether the author's identity is verified - sig { returns(T.nilable(T::Boolean)) } - attr_accessor :identity_verified - - # Whether the author is a paying customer - sig { returns(T.nilable(T::Boolean)) } - attr_accessor :is_paying_customer - - # Whether the author's phone number is verified - sig { returns(T.nilable(T::Boolean)) } - attr_accessor :phone_verified - - # Additional metadata provided by your system. We recommend including any relevant - # information that may assist in the moderation process. - sig do - params( - email_verified: T.nilable(T::Boolean), - identity_verified: T.nilable(T::Boolean), - is_paying_customer: T.nilable(T::Boolean), - phone_verified: T.nilable(T::Boolean) - ).returns(T.attached_class) - end - def self.new( - # Whether the author's email is verified - email_verified: nil, - # Whether the author's identity is verified - identity_verified: nil, - # Whether the author is a paying customer - is_paying_customer: nil, - # Whether the author's phone number is verified - phone_verified: nil - ) - end - - sig do - override.returns( - { - email_verified: T.nilable(T::Boolean), - identity_verified: T.nilable(T::Boolean), - is_paying_customer: T.nilable(T::Boolean), - phone_verified: T.nilable(T::Boolean) - } - ) - end - def to_hash - end - end - - class Metrics < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::Models::AuthorListResponse::Author::Metrics, - ModerationAPI::Internal::AnyHash - ) - end - - # Number of flagged content pieces - sig { returns(Float) } - attr_accessor :flagged_content - - # Total pieces of content - sig { returns(Float) } - attr_accessor :total_content - - # Average sentiment score of content (-1 to 1). Requires a sentiment model in your - # project. - sig { returns(T.nilable(Float)) } - attr_accessor :average_sentiment - - sig do - params( - flagged_content: Float, - total_content: Float, - average_sentiment: T.nilable(Float) - ).returns(T.attached_class) - end - def self.new( - # Number of flagged content pieces - flagged_content:, - # Total pieces of content - total_content:, - # Average sentiment score of content (-1 to 1). Requires a sentiment model in your - # project. - average_sentiment: nil - ) - end - - sig do - override.returns( - { - flagged_content: Float, - total_content: Float, - average_sentiment: T.nilable(Float) - } - ) - end - def to_hash - end - end - - class RiskEvaluation < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::Models::AuthorListResponse::Author::RiskEvaluation, - ModerationAPI::Internal::AnyHash - ) - end - - # Calculated risk level based on more than 10 behavioral signals. - sig { returns(T.nilable(Float)) } - attr_accessor :risk_level - - # Risk assessment details, if available. - sig { params(risk_level: T.nilable(Float)).returns(T.attached_class) } - def self.new( - # Calculated risk level based on more than 10 behavioral signals. - risk_level: nil - ) - end - - sig { override.returns({ risk_level: T.nilable(Float) }) } - def to_hash - end - end - - # Current author status - module Status - extend ModerationAPI::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all( - Symbol, - ModerationAPI::Models::AuthorListResponse::Author::Status - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - ENABLED = - T.let( - :enabled, - ModerationAPI::Models::AuthorListResponse::Author::Status::TaggedSymbol - ) - SUSPENDED = - T.let( - :suspended, - ModerationAPI::Models::AuthorListResponse::Author::Status::TaggedSymbol - ) - BLOCKED = - T.let( - :blocked, - ModerationAPI::Models::AuthorListResponse::Author::Status::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - ModerationAPI::Models::AuthorListResponse::Author::Status::TaggedSymbol - ] - ) - end - def self.values - end - end - - class TrustLevel < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::Models::AuthorListResponse::Author::TrustLevel, - ModerationAPI::Internal::AnyHash - ) - end - - # Author trust level (-1, 0, 1, 2, 3, or 4) - sig { returns(Float) } - attr_accessor :level - - # True if the trust level was set manually by a moderator - sig { returns(T::Boolean) } - attr_accessor :manual - - sig do - params(level: Float, manual: T::Boolean).returns(T.attached_class) - end - def self.new( - # Author trust level (-1, 0, 1, 2, 3, or 4) - level:, - # True if the trust level was set manually by a moderator - manual: - ) - end - - sig { override.returns({ level: Float, manual: T::Boolean }) } - def to_hash - end - end - end - - class Pagination < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::Models::AuthorListResponse::Pagination, - ModerationAPI::Internal::AnyHash - ) - end - - sig { returns(T::Boolean) } - attr_accessor :has_next_page - - sig { returns(T::Boolean) } - attr_accessor :has_previous_page - - sig { returns(Float) } - attr_accessor :page_number - - sig { returns(Float) } - attr_accessor :page_size - - sig { returns(Float) } - attr_accessor :total - - sig do - params( - has_next_page: T::Boolean, - has_previous_page: T::Boolean, - page_number: Float, - page_size: Float, - total: Float - ).returns(T.attached_class) - end - def self.new( - has_next_page:, - has_previous_page:, - page_number:, - page_size:, - total: - ) - end - - sig do - override.returns( - { - has_next_page: T::Boolean, - has_previous_page: T::Boolean, - page_number: Float, - page_size: Float, - total: Float - } - ) - end - def to_hash - end - end - end - end -end diff --git a/rbi/moderation_api/models/author_retrieve_params.rbi b/rbi/moderation_api/models/author_retrieve_params.rbi deleted file mode 100644 index 3e2f7e0d..00000000 --- a/rbi/moderation_api/models/author_retrieve_params.rbi +++ /dev/null @@ -1,43 +0,0 @@ -# typed: strong - -module ModerationAPI - module Models - class AuthorRetrieveParams < ModerationAPI::Internal::Type::BaseModel - extend ModerationAPI::Internal::Type::RequestParameters::Converter - include ModerationAPI::Internal::Type::RequestParameters - - OrHash = - T.type_alias do - T.any( - ModerationAPI::AuthorRetrieveParams, - ModerationAPI::Internal::AnyHash - ) - end - - # Either external ID or the ID assigned by moderation API. - sig { returns(String) } - attr_accessor :id - - sig do - params( - id: String, - request_options: ModerationAPI::RequestOptions::OrHash - ).returns(T.attached_class) - end - def self.new( - # Either external ID or the ID assigned by moderation API. - id:, - request_options: {} - ) - end - - sig do - override.returns( - { id: String, request_options: ModerationAPI::RequestOptions } - ) - end - def to_hash - end - end - end -end diff --git a/rbi/moderation_api/models/author_retrieve_response.rbi b/rbi/moderation_api/models/author_retrieve_response.rbi deleted file mode 100644 index 089c3d9b..00000000 --- a/rbi/moderation_api/models/author_retrieve_response.rbi +++ /dev/null @@ -1,480 +0,0 @@ -# typed: strong - -module ModerationAPI - module Models - class AuthorRetrieveResponse < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::Models::AuthorRetrieveResponse, - ModerationAPI::Internal::AnyHash - ) - end - - # Author ID in Moderation API - sig { returns(String) } - attr_accessor :id - - # Block or suspension details, if applicable. Null if the author is enabled. - sig do - returns(T.nilable(ModerationAPI::Models::AuthorRetrieveResponse::Block)) - end - attr_reader :block - - sig do - params( - block: - T.nilable( - ModerationAPI::Models::AuthorRetrieveResponse::Block::OrHash - ) - ).void - end - attr_writer :block - - # Timestamp when author first appeared - sig { returns(Float) } - attr_accessor :first_seen - - # Timestamp of last activity - sig { returns(Float) } - attr_accessor :last_seen - - # Additional metadata provided by your system. We recommend including any relevant - # information that may assist in the moderation process. - sig { returns(ModerationAPI::Models::AuthorRetrieveResponse::Metadata) } - attr_reader :metadata - - sig do - params( - metadata: - ModerationAPI::Models::AuthorRetrieveResponse::Metadata::OrHash - ).void - end - attr_writer :metadata - - sig { returns(ModerationAPI::Models::AuthorRetrieveResponse::Metrics) } - attr_reader :metrics - - sig do - params( - metrics: - ModerationAPI::Models::AuthorRetrieveResponse::Metrics::OrHash - ).void - end - attr_writer :metrics - - # Risk assessment details, if available. - sig do - returns( - T.nilable( - ModerationAPI::Models::AuthorRetrieveResponse::RiskEvaluation - ) - ) - end - attr_reader :risk_evaluation - - sig do - params( - risk_evaluation: - T.nilable( - ModerationAPI::Models::AuthorRetrieveResponse::RiskEvaluation::OrHash - ) - ).void - end - attr_writer :risk_evaluation - - # Current author status - sig do - returns( - ModerationAPI::Models::AuthorRetrieveResponse::Status::TaggedSymbol - ) - end - attr_accessor :status - - sig { returns(ModerationAPI::Models::AuthorRetrieveResponse::TrustLevel) } - attr_reader :trust_level - - sig do - params( - trust_level: - ModerationAPI::Models::AuthorRetrieveResponse::TrustLevel::OrHash - ).void - end - attr_writer :trust_level - - # The author's company or organization - sig { returns(T.nilable(String)) } - attr_accessor :company - - # Author email address - sig { returns(T.nilable(String)) } - attr_accessor :email - - # The author's ID from your system - sig { returns(T.nilable(String)) } - attr_accessor :external_id - - # URL of the author's external profile - sig { returns(T.nilable(String)) } - attr_accessor :external_link - - # Timestamp of last incident - sig { returns(T.nilable(Float)) } - attr_accessor :last_incident - - # Author name or identifier - sig { returns(T.nilable(String)) } - attr_accessor :name - - # URL of the author's profile picture - sig { returns(T.nilable(String)) } - attr_accessor :profile_picture - - sig do - params( - id: String, - block: - T.nilable( - ModerationAPI::Models::AuthorRetrieveResponse::Block::OrHash - ), - first_seen: Float, - last_seen: Float, - metadata: - ModerationAPI::Models::AuthorRetrieveResponse::Metadata::OrHash, - metrics: - ModerationAPI::Models::AuthorRetrieveResponse::Metrics::OrHash, - risk_evaluation: - T.nilable( - ModerationAPI::Models::AuthorRetrieveResponse::RiskEvaluation::OrHash - ), - status: - ModerationAPI::Models::AuthorRetrieveResponse::Status::OrSymbol, - trust_level: - ModerationAPI::Models::AuthorRetrieveResponse::TrustLevel::OrHash, - company: T.nilable(String), - email: T.nilable(String), - external_id: T.nilable(String), - external_link: T.nilable(String), - last_incident: T.nilable(Float), - name: T.nilable(String), - profile_picture: T.nilable(String) - ).returns(T.attached_class) - end - def self.new( - # Author ID in Moderation API - id:, - # Block or suspension details, if applicable. Null if the author is enabled. - block:, - # Timestamp when author first appeared - first_seen:, - # Timestamp of last activity - last_seen:, - # Additional metadata provided by your system. We recommend including any relevant - # information that may assist in the moderation process. - metadata:, - metrics:, - # Risk assessment details, if available. - risk_evaluation:, - # Current author status - status:, - trust_level:, - # The author's company or organization - company: nil, - # Author email address - email: nil, - # The author's ID from your system - external_id: nil, - # URL of the author's external profile - external_link: nil, - # Timestamp of last incident - last_incident: nil, - # Author name or identifier - name: nil, - # URL of the author's profile picture - profile_picture: nil - ) - end - - sig do - override.returns( - { - id: String, - block: - T.nilable(ModerationAPI::Models::AuthorRetrieveResponse::Block), - first_seen: Float, - last_seen: Float, - metadata: ModerationAPI::Models::AuthorRetrieveResponse::Metadata, - metrics: ModerationAPI::Models::AuthorRetrieveResponse::Metrics, - risk_evaluation: - T.nilable( - ModerationAPI::Models::AuthorRetrieveResponse::RiskEvaluation - ), - status: - ModerationAPI::Models::AuthorRetrieveResponse::Status::TaggedSymbol, - trust_level: - ModerationAPI::Models::AuthorRetrieveResponse::TrustLevel, - company: T.nilable(String), - email: T.nilable(String), - external_id: T.nilable(String), - external_link: T.nilable(String), - last_incident: T.nilable(Float), - name: T.nilable(String), - profile_picture: T.nilable(String) - } - ) - end - def to_hash - end - - class Block < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::Models::AuthorRetrieveResponse::Block, - ModerationAPI::Internal::AnyHash - ) - end - - # The moderators reason why the author was blocked or suspended. - sig { returns(T.nilable(String)) } - attr_accessor :reason - - # The timestamp until which they are blocked if the author is suspended. - sig { returns(T.nilable(Float)) } - attr_accessor :until_ - - # Block or suspension details, if applicable. Null if the author is enabled. - sig do - params(reason: T.nilable(String), until_: T.nilable(Float)).returns( - T.attached_class - ) - end - def self.new( - # The moderators reason why the author was blocked or suspended. - reason: nil, - # The timestamp until which they are blocked if the author is suspended. - until_: nil - ) - end - - sig do - override.returns( - { reason: T.nilable(String), until_: T.nilable(Float) } - ) - end - def to_hash - end - end - - class Metadata < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::Models::AuthorRetrieveResponse::Metadata, - ModerationAPI::Internal::AnyHash - ) - end - - # Whether the author's email is verified - sig { returns(T.nilable(T::Boolean)) } - attr_accessor :email_verified - - # Whether the author's identity is verified - sig { returns(T.nilable(T::Boolean)) } - attr_accessor :identity_verified - - # Whether the author is a paying customer - sig { returns(T.nilable(T::Boolean)) } - attr_accessor :is_paying_customer - - # Whether the author's phone number is verified - sig { returns(T.nilable(T::Boolean)) } - attr_accessor :phone_verified - - # Additional metadata provided by your system. We recommend including any relevant - # information that may assist in the moderation process. - sig do - params( - email_verified: T.nilable(T::Boolean), - identity_verified: T.nilable(T::Boolean), - is_paying_customer: T.nilable(T::Boolean), - phone_verified: T.nilable(T::Boolean) - ).returns(T.attached_class) - end - def self.new( - # Whether the author's email is verified - email_verified: nil, - # Whether the author's identity is verified - identity_verified: nil, - # Whether the author is a paying customer - is_paying_customer: nil, - # Whether the author's phone number is verified - phone_verified: nil - ) - end - - sig do - override.returns( - { - email_verified: T.nilable(T::Boolean), - identity_verified: T.nilable(T::Boolean), - is_paying_customer: T.nilable(T::Boolean), - phone_verified: T.nilable(T::Boolean) - } - ) - end - def to_hash - end - end - - class Metrics < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::Models::AuthorRetrieveResponse::Metrics, - ModerationAPI::Internal::AnyHash - ) - end - - # Number of flagged content pieces - sig { returns(Float) } - attr_accessor :flagged_content - - # Total pieces of content - sig { returns(Float) } - attr_accessor :total_content - - # Average sentiment score of content (-1 to 1). Requires a sentiment model in your - # project. - sig { returns(T.nilable(Float)) } - attr_accessor :average_sentiment - - sig do - params( - flagged_content: Float, - total_content: Float, - average_sentiment: T.nilable(Float) - ).returns(T.attached_class) - end - def self.new( - # Number of flagged content pieces - flagged_content:, - # Total pieces of content - total_content:, - # Average sentiment score of content (-1 to 1). Requires a sentiment model in your - # project. - average_sentiment: nil - ) - end - - sig do - override.returns( - { - flagged_content: Float, - total_content: Float, - average_sentiment: T.nilable(Float) - } - ) - end - def to_hash - end - end - - class RiskEvaluation < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::Models::AuthorRetrieveResponse::RiskEvaluation, - ModerationAPI::Internal::AnyHash - ) - end - - # Calculated risk level based on more than 10 behavioral signals. - sig { returns(T.nilable(Float)) } - attr_accessor :risk_level - - # Risk assessment details, if available. - sig { params(risk_level: T.nilable(Float)).returns(T.attached_class) } - def self.new( - # Calculated risk level based on more than 10 behavioral signals. - risk_level: nil - ) - end - - sig { override.returns({ risk_level: T.nilable(Float) }) } - def to_hash - end - end - - # Current author status - module Status - extend ModerationAPI::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all(Symbol, ModerationAPI::Models::AuthorRetrieveResponse::Status) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - ENABLED = - T.let( - :enabled, - ModerationAPI::Models::AuthorRetrieveResponse::Status::TaggedSymbol - ) - SUSPENDED = - T.let( - :suspended, - ModerationAPI::Models::AuthorRetrieveResponse::Status::TaggedSymbol - ) - BLOCKED = - T.let( - :blocked, - ModerationAPI::Models::AuthorRetrieveResponse::Status::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - ModerationAPI::Models::AuthorRetrieveResponse::Status::TaggedSymbol - ] - ) - end - def self.values - end - end - - class TrustLevel < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::Models::AuthorRetrieveResponse::TrustLevel, - ModerationAPI::Internal::AnyHash - ) - end - - # Author trust level (-1, 0, 1, 2, 3, or 4) - sig { returns(Float) } - attr_accessor :level - - # True if the trust level was set manually by a moderator - sig { returns(T::Boolean) } - attr_accessor :manual - - sig do - params(level: Float, manual: T::Boolean).returns(T.attached_class) - end - def self.new( - # Author trust level (-1, 0, 1, 2, 3, or 4) - level:, - # True if the trust level was set manually by a moderator - manual: - ) - end - - sig { override.returns({ level: Float, manual: T::Boolean }) } - def to_hash - end - end - end - end -end diff --git a/rbi/moderation_api/models/author_update_params.rbi b/rbi/moderation_api/models/author_update_params.rbi deleted file mode 100644 index 30b433bf..00000000 --- a/rbi/moderation_api/models/author_update_params.rbi +++ /dev/null @@ -1,192 +0,0 @@ -# typed: strong - -module ModerationAPI - module Models - class AuthorUpdateParams < ModerationAPI::Internal::Type::BaseModel - extend ModerationAPI::Internal::Type::RequestParameters::Converter - include ModerationAPI::Internal::Type::RequestParameters - - OrHash = - T.type_alias do - T.any( - ModerationAPI::AuthorUpdateParams, - ModerationAPI::Internal::AnyHash - ) - end - - # Either external ID or the ID assigned by moderation API. - sig { returns(String) } - attr_accessor :id - - # The author's company or organization - sig { returns(T.nilable(String)) } - attr_accessor :company - - # Author email address - sig { returns(T.nilable(String)) } - attr_accessor :email - - # URL of the author's external profile - sig { returns(T.nilable(String)) } - attr_accessor :external_link - - # Timestamp when author first appeared - sig { returns(T.nilable(Float)) } - attr_reader :first_seen - - sig { params(first_seen: Float).void } - attr_writer :first_seen - - # Timestamp of last activity - sig { returns(T.nilable(Float)) } - attr_reader :last_seen - - sig { params(last_seen: Float).void } - attr_writer :last_seen - - sig { returns(T.nilable(Float)) } - attr_accessor :manual_trust_level - - # Additional metadata provided by your system. We recommend including any relevant - # information that may assist in the moderation process. - sig { returns(T.nilable(ModerationAPI::AuthorUpdateParams::Metadata)) } - attr_reader :metadata - - sig do - params( - metadata: ModerationAPI::AuthorUpdateParams::Metadata::OrHash - ).void - end - attr_writer :metadata - - # Author name or identifier - sig { returns(T.nilable(String)) } - attr_accessor :name - - # URL of the author's profile picture - sig { returns(T.nilable(String)) } - attr_accessor :profile_picture - - sig do - params( - id: String, - company: T.nilable(String), - email: T.nilable(String), - external_link: T.nilable(String), - first_seen: Float, - last_seen: Float, - manual_trust_level: T.nilable(Float), - metadata: ModerationAPI::AuthorUpdateParams::Metadata::OrHash, - name: T.nilable(String), - profile_picture: T.nilable(String), - request_options: ModerationAPI::RequestOptions::OrHash - ).returns(T.attached_class) - end - def self.new( - # Either external ID or the ID assigned by moderation API. - id:, - # The author's company or organization - company: nil, - # Author email address - email: nil, - # URL of the author's external profile - external_link: nil, - # Timestamp when author first appeared - first_seen: nil, - # Timestamp of last activity - last_seen: nil, - manual_trust_level: nil, - # Additional metadata provided by your system. We recommend including any relevant - # information that may assist in the moderation process. - metadata: nil, - # Author name or identifier - name: nil, - # URL of the author's profile picture - profile_picture: nil, - request_options: {} - ) - end - - sig do - override.returns( - { - id: String, - company: T.nilable(String), - email: T.nilable(String), - external_link: T.nilable(String), - first_seen: Float, - last_seen: Float, - manual_trust_level: T.nilable(Float), - metadata: ModerationAPI::AuthorUpdateParams::Metadata, - name: T.nilable(String), - profile_picture: T.nilable(String), - request_options: ModerationAPI::RequestOptions - } - ) - end - def to_hash - end - - class Metadata < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::AuthorUpdateParams::Metadata, - ModerationAPI::Internal::AnyHash - ) - end - - # Whether the author's email is verified - sig { returns(T.nilable(T::Boolean)) } - attr_accessor :email_verified - - # Whether the author's identity is verified - sig { returns(T.nilable(T::Boolean)) } - attr_accessor :identity_verified - - # Whether the author is a paying customer - sig { returns(T.nilable(T::Boolean)) } - attr_accessor :is_paying_customer - - # Whether the author's phone number is verified - sig { returns(T.nilable(T::Boolean)) } - attr_accessor :phone_verified - - # Additional metadata provided by your system. We recommend including any relevant - # information that may assist in the moderation process. - sig do - params( - email_verified: T.nilable(T::Boolean), - identity_verified: T.nilable(T::Boolean), - is_paying_customer: T.nilable(T::Boolean), - phone_verified: T.nilable(T::Boolean) - ).returns(T.attached_class) - end - def self.new( - # Whether the author's email is verified - email_verified: nil, - # Whether the author's identity is verified - identity_verified: nil, - # Whether the author is a paying customer - is_paying_customer: nil, - # Whether the author's phone number is verified - phone_verified: nil - ) - end - - sig do - override.returns( - { - email_verified: T.nilable(T::Boolean), - identity_verified: T.nilable(T::Boolean), - is_paying_customer: T.nilable(T::Boolean), - phone_verified: T.nilable(T::Boolean) - } - ) - end - def to_hash - end - end - end - end -end diff --git a/rbi/moderation_api/models/author_update_response.rbi b/rbi/moderation_api/models/author_update_response.rbi deleted file mode 100644 index 943a2f2a..00000000 --- a/rbi/moderation_api/models/author_update_response.rbi +++ /dev/null @@ -1,475 +0,0 @@ -# typed: strong - -module ModerationAPI - module Models - class AuthorUpdateResponse < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::Models::AuthorUpdateResponse, - ModerationAPI::Internal::AnyHash - ) - end - - # Author ID in Moderation API - sig { returns(String) } - attr_accessor :id - - # Block or suspension details, if applicable. Null if the author is enabled. - sig do - returns(T.nilable(ModerationAPI::Models::AuthorUpdateResponse::Block)) - end - attr_reader :block - - sig do - params( - block: - T.nilable( - ModerationAPI::Models::AuthorUpdateResponse::Block::OrHash - ) - ).void - end - attr_writer :block - - # Timestamp when author first appeared - sig { returns(Float) } - attr_accessor :first_seen - - # Timestamp of last activity - sig { returns(Float) } - attr_accessor :last_seen - - # Additional metadata provided by your system. We recommend including any relevant - # information that may assist in the moderation process. - sig { returns(ModerationAPI::Models::AuthorUpdateResponse::Metadata) } - attr_reader :metadata - - sig do - params( - metadata: - ModerationAPI::Models::AuthorUpdateResponse::Metadata::OrHash - ).void - end - attr_writer :metadata - - sig { returns(ModerationAPI::Models::AuthorUpdateResponse::Metrics) } - attr_reader :metrics - - sig do - params( - metrics: ModerationAPI::Models::AuthorUpdateResponse::Metrics::OrHash - ).void - end - attr_writer :metrics - - # Risk assessment details, if available. - sig do - returns( - T.nilable(ModerationAPI::Models::AuthorUpdateResponse::RiskEvaluation) - ) - end - attr_reader :risk_evaluation - - sig do - params( - risk_evaluation: - T.nilable( - ModerationAPI::Models::AuthorUpdateResponse::RiskEvaluation::OrHash - ) - ).void - end - attr_writer :risk_evaluation - - # Current author status - sig do - returns( - ModerationAPI::Models::AuthorUpdateResponse::Status::TaggedSymbol - ) - end - attr_accessor :status - - sig { returns(ModerationAPI::Models::AuthorUpdateResponse::TrustLevel) } - attr_reader :trust_level - - sig do - params( - trust_level: - ModerationAPI::Models::AuthorUpdateResponse::TrustLevel::OrHash - ).void - end - attr_writer :trust_level - - # The author's company or organization - sig { returns(T.nilable(String)) } - attr_accessor :company - - # Author email address - sig { returns(T.nilable(String)) } - attr_accessor :email - - # The author's ID from your system - sig { returns(T.nilable(String)) } - attr_accessor :external_id - - # URL of the author's external profile - sig { returns(T.nilable(String)) } - attr_accessor :external_link - - # Timestamp of last incident - sig { returns(T.nilable(Float)) } - attr_accessor :last_incident - - # Author name or identifier - sig { returns(T.nilable(String)) } - attr_accessor :name - - # URL of the author's profile picture - sig { returns(T.nilable(String)) } - attr_accessor :profile_picture - - sig do - params( - id: String, - block: - T.nilable( - ModerationAPI::Models::AuthorUpdateResponse::Block::OrHash - ), - first_seen: Float, - last_seen: Float, - metadata: - ModerationAPI::Models::AuthorUpdateResponse::Metadata::OrHash, - metrics: ModerationAPI::Models::AuthorUpdateResponse::Metrics::OrHash, - risk_evaluation: - T.nilable( - ModerationAPI::Models::AuthorUpdateResponse::RiskEvaluation::OrHash - ), - status: ModerationAPI::Models::AuthorUpdateResponse::Status::OrSymbol, - trust_level: - ModerationAPI::Models::AuthorUpdateResponse::TrustLevel::OrHash, - company: T.nilable(String), - email: T.nilable(String), - external_id: T.nilable(String), - external_link: T.nilable(String), - last_incident: T.nilable(Float), - name: T.nilable(String), - profile_picture: T.nilable(String) - ).returns(T.attached_class) - end - def self.new( - # Author ID in Moderation API - id:, - # Block or suspension details, if applicable. Null if the author is enabled. - block:, - # Timestamp when author first appeared - first_seen:, - # Timestamp of last activity - last_seen:, - # Additional metadata provided by your system. We recommend including any relevant - # information that may assist in the moderation process. - metadata:, - metrics:, - # Risk assessment details, if available. - risk_evaluation:, - # Current author status - status:, - trust_level:, - # The author's company or organization - company: nil, - # Author email address - email: nil, - # The author's ID from your system - external_id: nil, - # URL of the author's external profile - external_link: nil, - # Timestamp of last incident - last_incident: nil, - # Author name or identifier - name: nil, - # URL of the author's profile picture - profile_picture: nil - ) - end - - sig do - override.returns( - { - id: String, - block: - T.nilable(ModerationAPI::Models::AuthorUpdateResponse::Block), - first_seen: Float, - last_seen: Float, - metadata: ModerationAPI::Models::AuthorUpdateResponse::Metadata, - metrics: ModerationAPI::Models::AuthorUpdateResponse::Metrics, - risk_evaluation: - T.nilable( - ModerationAPI::Models::AuthorUpdateResponse::RiskEvaluation - ), - status: - ModerationAPI::Models::AuthorUpdateResponse::Status::TaggedSymbol, - trust_level: - ModerationAPI::Models::AuthorUpdateResponse::TrustLevel, - company: T.nilable(String), - email: T.nilable(String), - external_id: T.nilable(String), - external_link: T.nilable(String), - last_incident: T.nilable(Float), - name: T.nilable(String), - profile_picture: T.nilable(String) - } - ) - end - def to_hash - end - - class Block < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::Models::AuthorUpdateResponse::Block, - ModerationAPI::Internal::AnyHash - ) - end - - # The moderators reason why the author was blocked or suspended. - sig { returns(T.nilable(String)) } - attr_accessor :reason - - # The timestamp until which they are blocked if the author is suspended. - sig { returns(T.nilable(Float)) } - attr_accessor :until_ - - # Block or suspension details, if applicable. Null if the author is enabled. - sig do - params(reason: T.nilable(String), until_: T.nilable(Float)).returns( - T.attached_class - ) - end - def self.new( - # The moderators reason why the author was blocked or suspended. - reason: nil, - # The timestamp until which they are blocked if the author is suspended. - until_: nil - ) - end - - sig do - override.returns( - { reason: T.nilable(String), until_: T.nilable(Float) } - ) - end - def to_hash - end - end - - class Metadata < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::Models::AuthorUpdateResponse::Metadata, - ModerationAPI::Internal::AnyHash - ) - end - - # Whether the author's email is verified - sig { returns(T.nilable(T::Boolean)) } - attr_accessor :email_verified - - # Whether the author's identity is verified - sig { returns(T.nilable(T::Boolean)) } - attr_accessor :identity_verified - - # Whether the author is a paying customer - sig { returns(T.nilable(T::Boolean)) } - attr_accessor :is_paying_customer - - # Whether the author's phone number is verified - sig { returns(T.nilable(T::Boolean)) } - attr_accessor :phone_verified - - # Additional metadata provided by your system. We recommend including any relevant - # information that may assist in the moderation process. - sig do - params( - email_verified: T.nilable(T::Boolean), - identity_verified: T.nilable(T::Boolean), - is_paying_customer: T.nilable(T::Boolean), - phone_verified: T.nilable(T::Boolean) - ).returns(T.attached_class) - end - def self.new( - # Whether the author's email is verified - email_verified: nil, - # Whether the author's identity is verified - identity_verified: nil, - # Whether the author is a paying customer - is_paying_customer: nil, - # Whether the author's phone number is verified - phone_verified: nil - ) - end - - sig do - override.returns( - { - email_verified: T.nilable(T::Boolean), - identity_verified: T.nilable(T::Boolean), - is_paying_customer: T.nilable(T::Boolean), - phone_verified: T.nilable(T::Boolean) - } - ) - end - def to_hash - end - end - - class Metrics < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::Models::AuthorUpdateResponse::Metrics, - ModerationAPI::Internal::AnyHash - ) - end - - # Number of flagged content pieces - sig { returns(Float) } - attr_accessor :flagged_content - - # Total pieces of content - sig { returns(Float) } - attr_accessor :total_content - - # Average sentiment score of content (-1 to 1). Requires a sentiment model in your - # project. - sig { returns(T.nilable(Float)) } - attr_accessor :average_sentiment - - sig do - params( - flagged_content: Float, - total_content: Float, - average_sentiment: T.nilable(Float) - ).returns(T.attached_class) - end - def self.new( - # Number of flagged content pieces - flagged_content:, - # Total pieces of content - total_content:, - # Average sentiment score of content (-1 to 1). Requires a sentiment model in your - # project. - average_sentiment: nil - ) - end - - sig do - override.returns( - { - flagged_content: Float, - total_content: Float, - average_sentiment: T.nilable(Float) - } - ) - end - def to_hash - end - end - - class RiskEvaluation < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::Models::AuthorUpdateResponse::RiskEvaluation, - ModerationAPI::Internal::AnyHash - ) - end - - # Calculated risk level based on more than 10 behavioral signals. - sig { returns(T.nilable(Float)) } - attr_accessor :risk_level - - # Risk assessment details, if available. - sig { params(risk_level: T.nilable(Float)).returns(T.attached_class) } - def self.new( - # Calculated risk level based on more than 10 behavioral signals. - risk_level: nil - ) - end - - sig { override.returns({ risk_level: T.nilable(Float) }) } - def to_hash - end - end - - # Current author status - module Status - extend ModerationAPI::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all(Symbol, ModerationAPI::Models::AuthorUpdateResponse::Status) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - ENABLED = - T.let( - :enabled, - ModerationAPI::Models::AuthorUpdateResponse::Status::TaggedSymbol - ) - SUSPENDED = - T.let( - :suspended, - ModerationAPI::Models::AuthorUpdateResponse::Status::TaggedSymbol - ) - BLOCKED = - T.let( - :blocked, - ModerationAPI::Models::AuthorUpdateResponse::Status::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - ModerationAPI::Models::AuthorUpdateResponse::Status::TaggedSymbol - ] - ) - end - def self.values - end - end - - class TrustLevel < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::Models::AuthorUpdateResponse::TrustLevel, - ModerationAPI::Internal::AnyHash - ) - end - - # Author trust level (-1, 0, 1, 2, 3, or 4) - sig { returns(Float) } - attr_accessor :level - - # True if the trust level was set manually by a moderator - sig { returns(T::Boolean) } - attr_accessor :manual - - sig do - params(level: Float, manual: T::Boolean).returns(T.attached_class) - end - def self.new( - # Author trust level (-1, 0, 1, 2, 3, or 4) - level:, - # True if the trust level was set manually by a moderator - manual: - ) - end - - sig { override.returns({ level: Float, manual: T::Boolean }) } - def to_hash - end - end - end - end -end diff --git a/rbi/moderation_api/models/content_stream_params.rbi b/rbi/moderation_api/models/content_stream_params.rbi deleted file mode 100644 index 7cf32475..00000000 --- a/rbi/moderation_api/models/content_stream_params.rbi +++ /dev/null @@ -1,76 +0,0 @@ -# typed: strong - -module ModerationAPI - module Models - class ContentStreamParams < ModerationAPI::Internal::Type::BaseModel - extend ModerationAPI::Internal::Type::RequestParameters::Converter - include ModerationAPI::Internal::Type::RequestParameters - - OrHash = - T.type_alias do - T.any( - ModerationAPI::ContentStreamParams, - ModerationAPI::Internal::AnyHash - ) - end - - sig do - returns( - ModerationAPI::ContentStreamParams::SecWebSocketProtocol::OrSymbol - ) - end - attr_accessor :sec_web_socket_protocol - - sig do - params( - sec_web_socket_protocol: - ModerationAPI::ContentStreamParams::SecWebSocketProtocol::OrSymbol, - request_options: ModerationAPI::RequestOptions::OrHash - ).returns(T.attached_class) - end - def self.new(sec_web_socket_protocol:, request_options: {}) - end - - sig do - override.returns( - { - sec_web_socket_protocol: - ModerationAPI::ContentStreamParams::SecWebSocketProtocol::OrSymbol, - request_options: ModerationAPI::RequestOptions - } - ) - end - def to_hash - end - - module SecWebSocketProtocol - extend ModerationAPI::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all( - Symbol, - ModerationAPI::ContentStreamParams::SecWebSocketProtocol - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - MODERATIONAPI_V1 = - T.let( - :"moderationapi.v1", - ModerationAPI::ContentStreamParams::SecWebSocketProtocol::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - ModerationAPI::ContentStreamParams::SecWebSocketProtocol::TaggedSymbol - ] - ) - end - def self.values - end - end - end - end -end diff --git a/rbi/moderation_api/models/content_submit_params.rbi b/rbi/moderation_api/models/content_submit_params.rbi deleted file mode 100644 index d444fdd7..00000000 --- a/rbi/moderation_api/models/content_submit_params.rbi +++ /dev/null @@ -1,2569 +0,0 @@ -# typed: strong - -module ModerationAPI - module Models - class ContentSubmitParams < ModerationAPI::Internal::Type::BaseModel - extend ModerationAPI::Internal::Type::RequestParameters::Converter - include ModerationAPI::Internal::Type::RequestParameters - - OrHash = - T.type_alias do - T.any( - ModerationAPI::ContentSubmitParams, - ModerationAPI::Internal::AnyHash - ) - end - - # The content sent for moderation - sig do - returns( - T.any( - ModerationAPI::ContentSubmitParams::Content::Text, - ModerationAPI::ContentSubmitParams::Content::Image, - ModerationAPI::ContentSubmitParams::Content::Video, - ModerationAPI::ContentSubmitParams::Content::Audio, - ModerationAPI::ContentSubmitParams::Content::Object - ) - ) - end - attr_accessor :content - - # The author of the content. - sig { returns(T.nilable(String)) } - attr_reader :author_id - - sig { params(author_id: String).void } - attr_writer :author_id - - # Provide a channel ID or key. Will use the project's default channel if not - # provided. - sig { returns(T.nilable(String)) } - attr_reader :channel - - sig { params(channel: String).void } - attr_writer :channel - - # A recommendation from your own client-side flagging (e.g. a banned-IP list or a - # third-party tool). Feeds the rules engine and can escalate or override the - # recommended action. Does not change whether our analysis flagged the content. - sig do - returns(T.nilable(ModerationAPI::ContentSubmitParams::ClientAction)) - end - attr_reader :client_action - - sig do - params( - client_action: - ModerationAPI::ContentSubmitParams::ClientAction::OrHash - ).void - end - attr_writer :client_action - - # The unique ID of the content in your database. - sig { returns(T.nilable(String)) } - attr_reader :content_id - - sig { params(content_id: String).void } - attr_writer :content_id - - # For example the ID of a chat room or a post - sig { returns(T.nilable(String)) } - attr_reader :conversation_id - - sig { params(conversation_id: String).void } - attr_writer :conversation_id - - # Do not store the content. The content won't enter the review queue - sig { returns(T.nilable(T::Boolean)) } - attr_reader :do_not_store - - sig { params(do_not_store: T::Boolean).void } - attr_writer :do_not_store - - # Any metadata you want to store with the content - sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } - attr_reader :metadata - - sig { params(metadata: T::Hash[Symbol, T.anything]).void } - attr_writer :metadata - - # The meta type of content being moderated - sig do - returns( - T.nilable(ModerationAPI::ContentSubmitParams::MetaType::OrSymbol) - ) - end - attr_reader :meta_type - - sig do - params( - meta_type: ModerationAPI::ContentSubmitParams::MetaType::OrSymbol - ).void - end - attr_writer :meta_type - - # (Enterprise) override the channel policies for this moderation request only. - sig do - returns( - T.nilable( - T::Array[ - T.any( - ModerationAPI::ContentSubmitParams::Policy::Toxicity, - ModerationAPI::ContentSubmitParams::Policy::PersonalInformation, - ModerationAPI::ContentSubmitParams::Policy::ToxicitySevere, - ModerationAPI::ContentSubmitParams::Policy::Hate, - ModerationAPI::ContentSubmitParams::Policy::Illicit, - ModerationAPI::ContentSubmitParams::Policy::IllicitDrugs, - ModerationAPI::ContentSubmitParams::Policy::IllicitAlcohol, - ModerationAPI::ContentSubmitParams::Policy::IllicitFirearms, - ModerationAPI::ContentSubmitParams::Policy::IllicitTobacco, - ModerationAPI::ContentSubmitParams::Policy::IllicitGambling, - ModerationAPI::ContentSubmitParams::Policy::Cannabis, - ModerationAPI::ContentSubmitParams::Policy::Adult, - ModerationAPI::ContentSubmitParams::Policy::Crypto, - ModerationAPI::ContentSubmitParams::Policy::Sexual, - ModerationAPI::ContentSubmitParams::Policy::SexualMinors, - ModerationAPI::ContentSubmitParams::Policy::Flirtation, - ModerationAPI::ContentSubmitParams::Policy::Profanity, - ModerationAPI::ContentSubmitParams::Policy::Violence, - ModerationAPI::ContentSubmitParams::Policy::SelfHarm, - ModerationAPI::ContentSubmitParams::Policy::Spam, - ModerationAPI::ContentSubmitParams::Policy::LowQualityContent, - ModerationAPI::ContentSubmitParams::Policy::FaceDetection, - ModerationAPI::ContentSubmitParams::Policy::SelfPromotion, - ModerationAPI::ContentSubmitParams::Policy::Political, - ModerationAPI::ContentSubmitParams::Policy::Religion, - ModerationAPI::ContentSubmitParams::Policy::CodeAbuse, - ModerationAPI::ContentSubmitParams::Policy::UnicodeSpoofing, - ModerationAPI::ContentSubmitParams::Policy::PiiMasking, - ModerationAPI::ContentSubmitParams::Policy::URLMasking, - ModerationAPI::ContentSubmitParams::Policy::URLRisk, - ModerationAPI::ContentSubmitParams::Policy::Guideline - ) - ] - ) - ) - end - attr_reader :policies - - sig do - params( - policies: - T::Array[ - T.any( - ModerationAPI::ContentSubmitParams::Policy::Toxicity::OrHash, - ModerationAPI::ContentSubmitParams::Policy::PersonalInformation::OrHash, - ModerationAPI::ContentSubmitParams::Policy::ToxicitySevere::OrHash, - ModerationAPI::ContentSubmitParams::Policy::Hate::OrHash, - ModerationAPI::ContentSubmitParams::Policy::Illicit::OrHash, - ModerationAPI::ContentSubmitParams::Policy::IllicitDrugs::OrHash, - ModerationAPI::ContentSubmitParams::Policy::IllicitAlcohol::OrHash, - ModerationAPI::ContentSubmitParams::Policy::IllicitFirearms::OrHash, - ModerationAPI::ContentSubmitParams::Policy::IllicitTobacco::OrHash, - ModerationAPI::ContentSubmitParams::Policy::IllicitGambling::OrHash, - ModerationAPI::ContentSubmitParams::Policy::Cannabis::OrHash, - ModerationAPI::ContentSubmitParams::Policy::Adult::OrHash, - ModerationAPI::ContentSubmitParams::Policy::Crypto::OrHash, - ModerationAPI::ContentSubmitParams::Policy::Sexual::OrHash, - ModerationAPI::ContentSubmitParams::Policy::SexualMinors::OrHash, - ModerationAPI::ContentSubmitParams::Policy::Flirtation::OrHash, - ModerationAPI::ContentSubmitParams::Policy::Profanity::OrHash, - ModerationAPI::ContentSubmitParams::Policy::Violence::OrHash, - ModerationAPI::ContentSubmitParams::Policy::SelfHarm::OrHash, - ModerationAPI::ContentSubmitParams::Policy::Spam::OrHash, - ModerationAPI::ContentSubmitParams::Policy::LowQualityContent::OrHash, - ModerationAPI::ContentSubmitParams::Policy::FaceDetection::OrHash, - ModerationAPI::ContentSubmitParams::Policy::SelfPromotion::OrHash, - ModerationAPI::ContentSubmitParams::Policy::Political::OrHash, - ModerationAPI::ContentSubmitParams::Policy::Religion::OrHash, - ModerationAPI::ContentSubmitParams::Policy::CodeAbuse::OrHash, - ModerationAPI::ContentSubmitParams::Policy::UnicodeSpoofing::OrHash, - ModerationAPI::ContentSubmitParams::Policy::PiiMasking::OrHash, - ModerationAPI::ContentSubmitParams::Policy::URLMasking::OrHash, - ModerationAPI::ContentSubmitParams::Policy::URLRisk::OrHash, - ModerationAPI::ContentSubmitParams::Policy::Guideline::OrHash - ) - ] - ).void - end - attr_writer :policies - - # Unix timestamp (in milliseconds) of when the content was created. Use if content - # is not submitted in real-time. - sig { returns(T.nilable(Float)) } - attr_reader :timestamp - - sig { params(timestamp: Float).void } - attr_writer :timestamp - - sig do - params( - content: - T.any( - ModerationAPI::ContentSubmitParams::Content::Text::OrHash, - ModerationAPI::ContentSubmitParams::Content::Image::OrHash, - ModerationAPI::ContentSubmitParams::Content::Video::OrHash, - ModerationAPI::ContentSubmitParams::Content::Audio::OrHash, - ModerationAPI::ContentSubmitParams::Content::Object::OrHash - ), - author_id: String, - channel: String, - client_action: - ModerationAPI::ContentSubmitParams::ClientAction::OrHash, - content_id: String, - conversation_id: String, - do_not_store: T::Boolean, - metadata: T::Hash[Symbol, T.anything], - meta_type: ModerationAPI::ContentSubmitParams::MetaType::OrSymbol, - policies: - T::Array[ - T.any( - ModerationAPI::ContentSubmitParams::Policy::Toxicity::OrHash, - ModerationAPI::ContentSubmitParams::Policy::PersonalInformation::OrHash, - ModerationAPI::ContentSubmitParams::Policy::ToxicitySevere::OrHash, - ModerationAPI::ContentSubmitParams::Policy::Hate::OrHash, - ModerationAPI::ContentSubmitParams::Policy::Illicit::OrHash, - ModerationAPI::ContentSubmitParams::Policy::IllicitDrugs::OrHash, - ModerationAPI::ContentSubmitParams::Policy::IllicitAlcohol::OrHash, - ModerationAPI::ContentSubmitParams::Policy::IllicitFirearms::OrHash, - ModerationAPI::ContentSubmitParams::Policy::IllicitTobacco::OrHash, - ModerationAPI::ContentSubmitParams::Policy::IllicitGambling::OrHash, - ModerationAPI::ContentSubmitParams::Policy::Cannabis::OrHash, - ModerationAPI::ContentSubmitParams::Policy::Adult::OrHash, - ModerationAPI::ContentSubmitParams::Policy::Crypto::OrHash, - ModerationAPI::ContentSubmitParams::Policy::Sexual::OrHash, - ModerationAPI::ContentSubmitParams::Policy::SexualMinors::OrHash, - ModerationAPI::ContentSubmitParams::Policy::Flirtation::OrHash, - ModerationAPI::ContentSubmitParams::Policy::Profanity::OrHash, - ModerationAPI::ContentSubmitParams::Policy::Violence::OrHash, - ModerationAPI::ContentSubmitParams::Policy::SelfHarm::OrHash, - ModerationAPI::ContentSubmitParams::Policy::Spam::OrHash, - ModerationAPI::ContentSubmitParams::Policy::LowQualityContent::OrHash, - ModerationAPI::ContentSubmitParams::Policy::FaceDetection::OrHash, - ModerationAPI::ContentSubmitParams::Policy::SelfPromotion::OrHash, - ModerationAPI::ContentSubmitParams::Policy::Political::OrHash, - ModerationAPI::ContentSubmitParams::Policy::Religion::OrHash, - ModerationAPI::ContentSubmitParams::Policy::CodeAbuse::OrHash, - ModerationAPI::ContentSubmitParams::Policy::UnicodeSpoofing::OrHash, - ModerationAPI::ContentSubmitParams::Policy::PiiMasking::OrHash, - ModerationAPI::ContentSubmitParams::Policy::URLMasking::OrHash, - ModerationAPI::ContentSubmitParams::Policy::URLRisk::OrHash, - ModerationAPI::ContentSubmitParams::Policy::Guideline::OrHash - ) - ], - timestamp: Float, - request_options: ModerationAPI::RequestOptions::OrHash - ).returns(T.attached_class) - end - def self.new( - # The content sent for moderation - content:, - # The author of the content. - author_id: nil, - # Provide a channel ID or key. Will use the project's default channel if not - # provided. - channel: nil, - # A recommendation from your own client-side flagging (e.g. a banned-IP list or a - # third-party tool). Feeds the rules engine and can escalate or override the - # recommended action. Does not change whether our analysis flagged the content. - client_action: nil, - # The unique ID of the content in your database. - content_id: nil, - # For example the ID of a chat room or a post - conversation_id: nil, - # Do not store the content. The content won't enter the review queue - do_not_store: nil, - # Any metadata you want to store with the content - metadata: nil, - # The meta type of content being moderated - meta_type: nil, - # (Enterprise) override the channel policies for this moderation request only. - policies: nil, - # Unix timestamp (in milliseconds) of when the content was created. Use if content - # is not submitted in real-time. - timestamp: nil, - request_options: {} - ) - end - - sig do - override.returns( - { - content: - T.any( - ModerationAPI::ContentSubmitParams::Content::Text, - ModerationAPI::ContentSubmitParams::Content::Image, - ModerationAPI::ContentSubmitParams::Content::Video, - ModerationAPI::ContentSubmitParams::Content::Audio, - ModerationAPI::ContentSubmitParams::Content::Object - ), - author_id: String, - channel: String, - client_action: ModerationAPI::ContentSubmitParams::ClientAction, - content_id: String, - conversation_id: String, - do_not_store: T::Boolean, - metadata: T::Hash[Symbol, T.anything], - meta_type: ModerationAPI::ContentSubmitParams::MetaType::OrSymbol, - policies: - T::Array[ - T.any( - ModerationAPI::ContentSubmitParams::Policy::Toxicity, - ModerationAPI::ContentSubmitParams::Policy::PersonalInformation, - ModerationAPI::ContentSubmitParams::Policy::ToxicitySevere, - ModerationAPI::ContentSubmitParams::Policy::Hate, - ModerationAPI::ContentSubmitParams::Policy::Illicit, - ModerationAPI::ContentSubmitParams::Policy::IllicitDrugs, - ModerationAPI::ContentSubmitParams::Policy::IllicitAlcohol, - ModerationAPI::ContentSubmitParams::Policy::IllicitFirearms, - ModerationAPI::ContentSubmitParams::Policy::IllicitTobacco, - ModerationAPI::ContentSubmitParams::Policy::IllicitGambling, - ModerationAPI::ContentSubmitParams::Policy::Cannabis, - ModerationAPI::ContentSubmitParams::Policy::Adult, - ModerationAPI::ContentSubmitParams::Policy::Crypto, - ModerationAPI::ContentSubmitParams::Policy::Sexual, - ModerationAPI::ContentSubmitParams::Policy::SexualMinors, - ModerationAPI::ContentSubmitParams::Policy::Flirtation, - ModerationAPI::ContentSubmitParams::Policy::Profanity, - ModerationAPI::ContentSubmitParams::Policy::Violence, - ModerationAPI::ContentSubmitParams::Policy::SelfHarm, - ModerationAPI::ContentSubmitParams::Policy::Spam, - ModerationAPI::ContentSubmitParams::Policy::LowQualityContent, - ModerationAPI::ContentSubmitParams::Policy::FaceDetection, - ModerationAPI::ContentSubmitParams::Policy::SelfPromotion, - ModerationAPI::ContentSubmitParams::Policy::Political, - ModerationAPI::ContentSubmitParams::Policy::Religion, - ModerationAPI::ContentSubmitParams::Policy::CodeAbuse, - ModerationAPI::ContentSubmitParams::Policy::UnicodeSpoofing, - ModerationAPI::ContentSubmitParams::Policy::PiiMasking, - ModerationAPI::ContentSubmitParams::Policy::URLMasking, - ModerationAPI::ContentSubmitParams::Policy::URLRisk, - ModerationAPI::ContentSubmitParams::Policy::Guideline - ) - ], - timestamp: Float, - request_options: ModerationAPI::RequestOptions - } - ) - end - def to_hash - end - - # The content sent for moderation - module Content - extend ModerationAPI::Internal::Type::Union - - Variants = - T.type_alias do - T.any( - ModerationAPI::ContentSubmitParams::Content::Text, - ModerationAPI::ContentSubmitParams::Content::Image, - ModerationAPI::ContentSubmitParams::Content::Video, - ModerationAPI::ContentSubmitParams::Content::Audio, - ModerationAPI::ContentSubmitParams::Content::Object - ) - end - - class Text < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::ContentSubmitParams::Content::Text, - ModerationAPI::Internal::AnyHash - ) - end - - # The content text - sig { returns(String) } - attr_accessor :text - - sig { returns(Symbol) } - attr_accessor :type - - # Text - sig { params(text: String, type: Symbol).returns(T.attached_class) } - def self.new( - # The content text - text:, - type: :text - ) - end - - sig { override.returns({ text: String, type: Symbol }) } - def to_hash - end - end - - class Image < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::ContentSubmitParams::Content::Image, - ModerationAPI::Internal::AnyHash - ) - end - - sig { returns(Symbol) } - attr_accessor :type - - # Base64-encoded image data. Either url or data must be provided. Note: base64 - # images are not stored and will not appear in the review queue. - sig { returns(T.nilable(String)) } - attr_reader :data - - sig { params(data: String).void } - attr_writer :data - - # A public URL of the image content. Either url or data must be provided. - sig { returns(T.nilable(String)) } - attr_reader :url - - sig { params(url: String).void } - attr_writer :url - - # Image - sig do - params(data: String, url: String, type: Symbol).returns( - T.attached_class - ) - end - def self.new( - # Base64-encoded image data. Either url or data must be provided. Note: base64 - # images are not stored and will not appear in the review queue. - data: nil, - # A public URL of the image content. Either url or data must be provided. - url: nil, - type: :image - ) - end - - sig { override.returns({ type: Symbol, data: String, url: String }) } - def to_hash - end - end - - class Video < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::ContentSubmitParams::Content::Video, - ModerationAPI::Internal::AnyHash - ) - end - - sig { returns(Symbol) } - attr_accessor :type - - # A public URL of the video content - sig { returns(String) } - attr_accessor :url - - # Video - sig { params(url: String, type: Symbol).returns(T.attached_class) } - def self.new( - # A public URL of the video content - url:, - type: :video - ) - end - - sig { override.returns({ type: Symbol, url: String }) } - def to_hash - end - end - - class Audio < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::ContentSubmitParams::Content::Audio, - ModerationAPI::Internal::AnyHash - ) - end - - sig { returns(Symbol) } - attr_accessor :type - - # The URL of the audio content - sig { returns(String) } - attr_accessor :url - - # Audio - sig { params(url: String, type: Symbol).returns(T.attached_class) } - def self.new( - # The URL of the audio content - url:, - type: :audio - ) - end - - sig { override.returns({ type: Symbol, url: String }) } - def to_hash - end - end - - class Object < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::ContentSubmitParams::Content::Object, - ModerationAPI::Internal::AnyHash - ) - end - - # Values in the object. Can be mixed content types. - sig do - returns( - T::Hash[ - Symbol, - T.any( - ModerationAPI::ContentSubmitParams::Content::Object::Data::Text, - ModerationAPI::ContentSubmitParams::Content::Object::Data::Image, - ModerationAPI::ContentSubmitParams::Content::Object::Data::Video, - ModerationAPI::ContentSubmitParams::Content::Object::Data::Audio - ) - ] - ) - end - attr_accessor :data - - sig { returns(Symbol) } - attr_accessor :type - - # Object - sig do - params( - data: - T::Hash[ - Symbol, - T.any( - ModerationAPI::ContentSubmitParams::Content::Object::Data::Text::OrHash, - ModerationAPI::ContentSubmitParams::Content::Object::Data::Image::OrHash, - ModerationAPI::ContentSubmitParams::Content::Object::Data::Video::OrHash, - ModerationAPI::ContentSubmitParams::Content::Object::Data::Audio::OrHash - ) - ], - type: Symbol - ).returns(T.attached_class) - end - def self.new( - # Values in the object. Can be mixed content types. - data:, - type: :object - ) - end - - sig do - override.returns( - { - data: - T::Hash[ - Symbol, - T.any( - ModerationAPI::ContentSubmitParams::Content::Object::Data::Text, - ModerationAPI::ContentSubmitParams::Content::Object::Data::Image, - ModerationAPI::ContentSubmitParams::Content::Object::Data::Video, - ModerationAPI::ContentSubmitParams::Content::Object::Data::Audio - ) - ], - type: Symbol - } - ) - end - def to_hash - end - - # Text - module Data - extend ModerationAPI::Internal::Type::Union - - Variants = - T.type_alias do - T.any( - ModerationAPI::ContentSubmitParams::Content::Object::Data::Text, - ModerationAPI::ContentSubmitParams::Content::Object::Data::Image, - ModerationAPI::ContentSubmitParams::Content::Object::Data::Video, - ModerationAPI::ContentSubmitParams::Content::Object::Data::Audio - ) - end - - class Text < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::ContentSubmitParams::Content::Object::Data::Text, - ModerationAPI::Internal::AnyHash - ) - end - - # The content text - sig { returns(String) } - attr_accessor :text - - sig { returns(Symbol) } - attr_accessor :type - - # Text - sig do - params(text: String, type: Symbol).returns(T.attached_class) - end - def self.new( - # The content text - text:, - type: :text - ) - end - - sig { override.returns({ text: String, type: Symbol }) } - def to_hash - end - end - - class Image < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::ContentSubmitParams::Content::Object::Data::Image, - ModerationAPI::Internal::AnyHash - ) - end - - sig { returns(Symbol) } - attr_accessor :type - - # Base64-encoded image data. Either url or data must be provided. Note: base64 - # images are not stored and will not appear in the review queue. - sig { returns(T.nilable(String)) } - attr_reader :data - - sig { params(data: String).void } - attr_writer :data - - # A public URL of the image content. Either url or data must be provided. - sig { returns(T.nilable(String)) } - attr_reader :url - - sig { params(url: String).void } - attr_writer :url - - # Image - sig do - params(data: String, url: String, type: Symbol).returns( - T.attached_class - ) - end - def self.new( - # Base64-encoded image data. Either url or data must be provided. Note: base64 - # images are not stored and will not appear in the review queue. - data: nil, - # A public URL of the image content. Either url or data must be provided. - url: nil, - type: :image - ) - end - - sig do - override.returns({ type: Symbol, data: String, url: String }) - end - def to_hash - end - end - - class Video < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::ContentSubmitParams::Content::Object::Data::Video, - ModerationAPI::Internal::AnyHash - ) - end - - sig { returns(Symbol) } - attr_accessor :type - - # A public URL of the video content - sig { returns(String) } - attr_accessor :url - - # Video - sig do - params(url: String, type: Symbol).returns(T.attached_class) - end - def self.new( - # A public URL of the video content - url:, - type: :video - ) - end - - sig { override.returns({ type: Symbol, url: String }) } - def to_hash - end - end - - class Audio < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::ContentSubmitParams::Content::Object::Data::Audio, - ModerationAPI::Internal::AnyHash - ) - end - - sig { returns(Symbol) } - attr_accessor :type - - # The URL of the audio content - sig { returns(String) } - attr_accessor :url - - # Audio - sig do - params(url: String, type: Symbol).returns(T.attached_class) - end - def self.new( - # The URL of the audio content - url:, - type: :audio - ) - end - - sig { override.returns({ type: Symbol, url: String }) } - def to_hash - end - end - - sig do - override.returns( - T::Array[ - ModerationAPI::ContentSubmitParams::Content::Object::Data::Variants - ] - ) - end - def self.variants - end - end - end - - sig do - override.returns( - T::Array[ModerationAPI::ContentSubmitParams::Content::Variants] - ) - end - def self.variants - end - end - - class ClientAction < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::ContentSubmitParams::ClientAction, - ModerationAPI::Internal::AnyHash - ) - end - - # Your recommendation for the content: allow, review, or reject. - sig do - returns( - ModerationAPI::ContentSubmitParams::ClientAction::Action::OrSymbol - ) - end - attr_accessor :action - - # How your recommendation combines with ours. Defaults to 'escalate', which only - # applies it when stricter than ours; 'override' replaces ours outright. - sig do - returns( - T.nilable( - ModerationAPI::ContentSubmitParams::ClientAction::Behavior::OrSymbol - ) - ) - end - attr_reader :behavior - - sig do - params( - behavior: - ModerationAPI::ContentSubmitParams::ClientAction::Behavior::OrSymbol - ).void - end - attr_writer :behavior - - # A human-readable explanation for your recommendation. - sig { returns(T.nilable(String)) } - attr_reader :reason - - sig { params(reason: String).void } - attr_writer :reason - - # Where your recommendation came from, e.g. "banned-ip". - sig { returns(T.nilable(String)) } - attr_reader :source - - sig { params(source: String).void } - attr_writer :source - - # A recommendation from your own client-side flagging (e.g. a banned-IP list or a - # third-party tool). Feeds the rules engine and can escalate or override the - # recommended action. Does not change whether our analysis flagged the content. - sig do - params( - action: - ModerationAPI::ContentSubmitParams::ClientAction::Action::OrSymbol, - behavior: - ModerationAPI::ContentSubmitParams::ClientAction::Behavior::OrSymbol, - reason: String, - source: String - ).returns(T.attached_class) - end - def self.new( - # Your recommendation for the content: allow, review, or reject. - action:, - # How your recommendation combines with ours. Defaults to 'escalate', which only - # applies it when stricter than ours; 'override' replaces ours outright. - behavior: nil, - # A human-readable explanation for your recommendation. - reason: nil, - # Where your recommendation came from, e.g. "banned-ip". - source: nil - ) - end - - sig do - override.returns( - { - action: - ModerationAPI::ContentSubmitParams::ClientAction::Action::OrSymbol, - behavior: - ModerationAPI::ContentSubmitParams::ClientAction::Behavior::OrSymbol, - reason: String, - source: String - } - ) - end - def to_hash - end - - # Your recommendation for the content: allow, review, or reject. - module Action - extend ModerationAPI::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all( - Symbol, - ModerationAPI::ContentSubmitParams::ClientAction::Action - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - REVIEW = - T.let( - :review, - ModerationAPI::ContentSubmitParams::ClientAction::Action::TaggedSymbol - ) - ALLOW = - T.let( - :allow, - ModerationAPI::ContentSubmitParams::ClientAction::Action::TaggedSymbol - ) - REJECT = - T.let( - :reject, - ModerationAPI::ContentSubmitParams::ClientAction::Action::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - ModerationAPI::ContentSubmitParams::ClientAction::Action::TaggedSymbol - ] - ) - end - def self.values - end - end - - # How your recommendation combines with ours. Defaults to 'escalate', which only - # applies it when stricter than ours; 'override' replaces ours outright. - module Behavior - extend ModerationAPI::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all( - Symbol, - ModerationAPI::ContentSubmitParams::ClientAction::Behavior - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - OVERRIDE = - T.let( - :override, - ModerationAPI::ContentSubmitParams::ClientAction::Behavior::TaggedSymbol - ) - ESCALATE = - T.let( - :escalate, - ModerationAPI::ContentSubmitParams::ClientAction::Behavior::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - ModerationAPI::ContentSubmitParams::ClientAction::Behavior::TaggedSymbol - ] - ) - end - def self.values - end - end - end - - # The meta type of content being moderated - module MetaType - extend ModerationAPI::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all(Symbol, ModerationAPI::ContentSubmitParams::MetaType) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - PROFILE = - T.let( - :profile, - ModerationAPI::ContentSubmitParams::MetaType::TaggedSymbol - ) - MESSAGE = - T.let( - :message, - ModerationAPI::ContentSubmitParams::MetaType::TaggedSymbol - ) - POST = - T.let( - :post, - ModerationAPI::ContentSubmitParams::MetaType::TaggedSymbol - ) - COMMENT = - T.let( - :comment, - ModerationAPI::ContentSubmitParams::MetaType::TaggedSymbol - ) - EVENT = - T.let( - :event, - ModerationAPI::ContentSubmitParams::MetaType::TaggedSymbol - ) - PRODUCT = - T.let( - :product, - ModerationAPI::ContentSubmitParams::MetaType::TaggedSymbol - ) - REVIEW = - T.let( - :review, - ModerationAPI::ContentSubmitParams::MetaType::TaggedSymbol - ) - VOICE = - T.let( - :voice, - ModerationAPI::ContentSubmitParams::MetaType::TaggedSymbol - ) - OTHER = - T.let( - :other, - ModerationAPI::ContentSubmitParams::MetaType::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ModerationAPI::ContentSubmitParams::MetaType::TaggedSymbol] - ) - end - def self.values - end - end - - module Policy - extend ModerationAPI::Internal::Type::Union - - Variants = - T.type_alias do - T.any( - ModerationAPI::ContentSubmitParams::Policy::Toxicity, - ModerationAPI::ContentSubmitParams::Policy::PersonalInformation, - ModerationAPI::ContentSubmitParams::Policy::ToxicitySevere, - ModerationAPI::ContentSubmitParams::Policy::Hate, - ModerationAPI::ContentSubmitParams::Policy::Illicit, - ModerationAPI::ContentSubmitParams::Policy::IllicitDrugs, - ModerationAPI::ContentSubmitParams::Policy::IllicitAlcohol, - ModerationAPI::ContentSubmitParams::Policy::IllicitFirearms, - ModerationAPI::ContentSubmitParams::Policy::IllicitTobacco, - ModerationAPI::ContentSubmitParams::Policy::IllicitGambling, - ModerationAPI::ContentSubmitParams::Policy::Cannabis, - ModerationAPI::ContentSubmitParams::Policy::Adult, - ModerationAPI::ContentSubmitParams::Policy::Crypto, - ModerationAPI::ContentSubmitParams::Policy::Sexual, - ModerationAPI::ContentSubmitParams::Policy::SexualMinors, - ModerationAPI::ContentSubmitParams::Policy::Flirtation, - ModerationAPI::ContentSubmitParams::Policy::Profanity, - ModerationAPI::ContentSubmitParams::Policy::Violence, - ModerationAPI::ContentSubmitParams::Policy::SelfHarm, - ModerationAPI::ContentSubmitParams::Policy::Spam, - ModerationAPI::ContentSubmitParams::Policy::LowQualityContent, - ModerationAPI::ContentSubmitParams::Policy::FaceDetection, - ModerationAPI::ContentSubmitParams::Policy::SelfPromotion, - ModerationAPI::ContentSubmitParams::Policy::Political, - ModerationAPI::ContentSubmitParams::Policy::Religion, - ModerationAPI::ContentSubmitParams::Policy::CodeAbuse, - ModerationAPI::ContentSubmitParams::Policy::UnicodeSpoofing, - ModerationAPI::ContentSubmitParams::Policy::PiiMasking, - ModerationAPI::ContentSubmitParams::Policy::URLMasking, - ModerationAPI::ContentSubmitParams::Policy::URLRisk, - ModerationAPI::ContentSubmitParams::Policy::Guideline - ) - end - - class Toxicity < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::ContentSubmitParams::Policy::Toxicity, - ModerationAPI::Internal::AnyHash - ) - end - - sig { returns(Symbol) } - attr_accessor :id - - sig { returns(T::Boolean) } - attr_accessor :flag - - sig { returns(T.nilable(Float)) } - attr_reader :threshold - - sig { params(threshold: Float).void } - attr_writer :threshold - - sig do - params(flag: T::Boolean, threshold: Float, id: Symbol).returns( - T.attached_class - ) - end - def self.new(flag:, threshold: nil, id: :toxicity) - end - - sig do - override.returns({ id: Symbol, flag: T::Boolean, threshold: Float }) - end - def to_hash - end - end - - class PersonalInformation < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::ContentSubmitParams::Policy::PersonalInformation, - ModerationAPI::Internal::AnyHash - ) - end - - sig { returns(Symbol) } - attr_accessor :id - - sig { returns(T::Boolean) } - attr_accessor :flag - - sig { returns(T.nilable(Float)) } - attr_reader :threshold - - sig { params(threshold: Float).void } - attr_writer :threshold - - sig do - params(flag: T::Boolean, threshold: Float, id: Symbol).returns( - T.attached_class - ) - end - def self.new(flag:, threshold: nil, id: :personal_information) - end - - sig do - override.returns({ id: Symbol, flag: T::Boolean, threshold: Float }) - end - def to_hash - end - end - - class ToxicitySevere < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::ContentSubmitParams::Policy::ToxicitySevere, - ModerationAPI::Internal::AnyHash - ) - end - - sig { returns(Symbol) } - attr_accessor :id - - sig { returns(T::Boolean) } - attr_accessor :flag - - sig { returns(T.nilable(Float)) } - attr_reader :threshold - - sig { params(threshold: Float).void } - attr_writer :threshold - - sig do - params(flag: T::Boolean, threshold: Float, id: Symbol).returns( - T.attached_class - ) - end - def self.new(flag:, threshold: nil, id: :toxicity_severe) - end - - sig do - override.returns({ id: Symbol, flag: T::Boolean, threshold: Float }) - end - def to_hash - end - end - - class Hate < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::ContentSubmitParams::Policy::Hate, - ModerationAPI::Internal::AnyHash - ) - end - - sig { returns(Symbol) } - attr_accessor :id - - sig { returns(T::Boolean) } - attr_accessor :flag - - sig { returns(T.nilable(Float)) } - attr_reader :threshold - - sig { params(threshold: Float).void } - attr_writer :threshold - - sig do - params(flag: T::Boolean, threshold: Float, id: Symbol).returns( - T.attached_class - ) - end - def self.new(flag:, threshold: nil, id: :hate) - end - - sig do - override.returns({ id: Symbol, flag: T::Boolean, threshold: Float }) - end - def to_hash - end - end - - class Illicit < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::ContentSubmitParams::Policy::Illicit, - ModerationAPI::Internal::AnyHash - ) - end - - sig { returns(Symbol) } - attr_accessor :id - - sig { returns(T::Boolean) } - attr_accessor :flag - - sig { returns(T.nilable(Float)) } - attr_reader :threshold - - sig { params(threshold: Float).void } - attr_writer :threshold - - sig do - params(flag: T::Boolean, threshold: Float, id: Symbol).returns( - T.attached_class - ) - end - def self.new(flag:, threshold: nil, id: :illicit) - end - - sig do - override.returns({ id: Symbol, flag: T::Boolean, threshold: Float }) - end - def to_hash - end - end - - class IllicitDrugs < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::ContentSubmitParams::Policy::IllicitDrugs, - ModerationAPI::Internal::AnyHash - ) - end - - sig { returns(Symbol) } - attr_accessor :id - - sig { returns(T::Boolean) } - attr_accessor :flag - - sig { returns(T.nilable(Float)) } - attr_reader :threshold - - sig { params(threshold: Float).void } - attr_writer :threshold - - sig do - params(flag: T::Boolean, threshold: Float, id: Symbol).returns( - T.attached_class - ) - end - def self.new(flag:, threshold: nil, id: :illicit_drugs) - end - - sig do - override.returns({ id: Symbol, flag: T::Boolean, threshold: Float }) - end - def to_hash - end - end - - class IllicitAlcohol < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::ContentSubmitParams::Policy::IllicitAlcohol, - ModerationAPI::Internal::AnyHash - ) - end - - sig { returns(Symbol) } - attr_accessor :id - - sig { returns(T::Boolean) } - attr_accessor :flag - - sig { returns(T.nilable(Float)) } - attr_reader :threshold - - sig { params(threshold: Float).void } - attr_writer :threshold - - sig do - params(flag: T::Boolean, threshold: Float, id: Symbol).returns( - T.attached_class - ) - end - def self.new(flag:, threshold: nil, id: :illicit_alcohol) - end - - sig do - override.returns({ id: Symbol, flag: T::Boolean, threshold: Float }) - end - def to_hash - end - end - - class IllicitFirearms < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::ContentSubmitParams::Policy::IllicitFirearms, - ModerationAPI::Internal::AnyHash - ) - end - - sig { returns(Symbol) } - attr_accessor :id - - sig { returns(T::Boolean) } - attr_accessor :flag - - sig { returns(T.nilable(Float)) } - attr_reader :threshold - - sig { params(threshold: Float).void } - attr_writer :threshold - - sig do - params(flag: T::Boolean, threshold: Float, id: Symbol).returns( - T.attached_class - ) - end - def self.new(flag:, threshold: nil, id: :illicit_firearms) - end - - sig do - override.returns({ id: Symbol, flag: T::Boolean, threshold: Float }) - end - def to_hash - end - end - - class IllicitTobacco < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::ContentSubmitParams::Policy::IllicitTobacco, - ModerationAPI::Internal::AnyHash - ) - end - - sig { returns(Symbol) } - attr_accessor :id - - sig { returns(T::Boolean) } - attr_accessor :flag - - sig { returns(T.nilable(Float)) } - attr_reader :threshold - - sig { params(threshold: Float).void } - attr_writer :threshold - - sig do - params(flag: T::Boolean, threshold: Float, id: Symbol).returns( - T.attached_class - ) - end - def self.new(flag:, threshold: nil, id: :illicit_tobacco) - end - - sig do - override.returns({ id: Symbol, flag: T::Boolean, threshold: Float }) - end - def to_hash - end - end - - class IllicitGambling < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::ContentSubmitParams::Policy::IllicitGambling, - ModerationAPI::Internal::AnyHash - ) - end - - sig { returns(Symbol) } - attr_accessor :id - - sig { returns(T::Boolean) } - attr_accessor :flag - - sig { returns(T.nilable(Float)) } - attr_reader :threshold - - sig { params(threshold: Float).void } - attr_writer :threshold - - sig do - params(flag: T::Boolean, threshold: Float, id: Symbol).returns( - T.attached_class - ) - end - def self.new(flag:, threshold: nil, id: :illicit_gambling) - end - - sig do - override.returns({ id: Symbol, flag: T::Boolean, threshold: Float }) - end - def to_hash - end - end - - class Cannabis < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::ContentSubmitParams::Policy::Cannabis, - ModerationAPI::Internal::AnyHash - ) - end - - sig { returns(Symbol) } - attr_accessor :id - - sig { returns(T::Boolean) } - attr_accessor :flag - - sig { returns(T.nilable(Float)) } - attr_reader :threshold - - sig { params(threshold: Float).void } - attr_writer :threshold - - sig do - params(flag: T::Boolean, threshold: Float, id: Symbol).returns( - T.attached_class - ) - end - def self.new(flag:, threshold: nil, id: :cannabis) - end - - sig do - override.returns({ id: Symbol, flag: T::Boolean, threshold: Float }) - end - def to_hash - end - end - - class Adult < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::ContentSubmitParams::Policy::Adult, - ModerationAPI::Internal::AnyHash - ) - end - - sig { returns(Symbol) } - attr_accessor :id - - sig { returns(T::Boolean) } - attr_accessor :flag - - sig { returns(T.nilable(Float)) } - attr_reader :threshold - - sig { params(threshold: Float).void } - attr_writer :threshold - - sig do - params(flag: T::Boolean, threshold: Float, id: Symbol).returns( - T.attached_class - ) - end - def self.new(flag:, threshold: nil, id: :adult) - end - - sig do - override.returns({ id: Symbol, flag: T::Boolean, threshold: Float }) - end - def to_hash - end - end - - class Crypto < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::ContentSubmitParams::Policy::Crypto, - ModerationAPI::Internal::AnyHash - ) - end - - sig { returns(Symbol) } - attr_accessor :id - - sig { returns(T::Boolean) } - attr_accessor :flag - - sig { returns(T.nilable(Float)) } - attr_reader :threshold - - sig { params(threshold: Float).void } - attr_writer :threshold - - sig do - params(flag: T::Boolean, threshold: Float, id: Symbol).returns( - T.attached_class - ) - end - def self.new(flag:, threshold: nil, id: :crypto) - end - - sig do - override.returns({ id: Symbol, flag: T::Boolean, threshold: Float }) - end - def to_hash - end - end - - class Sexual < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::ContentSubmitParams::Policy::Sexual, - ModerationAPI::Internal::AnyHash - ) - end - - sig { returns(Symbol) } - attr_accessor :id - - sig { returns(T::Boolean) } - attr_accessor :flag - - sig { returns(T.nilable(Float)) } - attr_reader :threshold - - sig { params(threshold: Float).void } - attr_writer :threshold - - sig do - params(flag: T::Boolean, threshold: Float, id: Symbol).returns( - T.attached_class - ) - end - def self.new(flag:, threshold: nil, id: :sexual) - end - - sig do - override.returns({ id: Symbol, flag: T::Boolean, threshold: Float }) - end - def to_hash - end - end - - class SexualMinors < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::ContentSubmitParams::Policy::SexualMinors, - ModerationAPI::Internal::AnyHash - ) - end - - sig { returns(Symbol) } - attr_accessor :id - - sig { returns(T::Boolean) } - attr_accessor :flag - - sig { returns(T.nilable(Float)) } - attr_reader :threshold - - sig { params(threshold: Float).void } - attr_writer :threshold - - sig do - params(flag: T::Boolean, threshold: Float, id: Symbol).returns( - T.attached_class - ) - end - def self.new(flag:, threshold: nil, id: :sexual_minors) - end - - sig do - override.returns({ id: Symbol, flag: T::Boolean, threshold: Float }) - end - def to_hash - end - end - - class Flirtation < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::ContentSubmitParams::Policy::Flirtation, - ModerationAPI::Internal::AnyHash - ) - end - - sig { returns(Symbol) } - attr_accessor :id - - sig { returns(T::Boolean) } - attr_accessor :flag - - sig { returns(T.nilable(Float)) } - attr_reader :threshold - - sig { params(threshold: Float).void } - attr_writer :threshold - - sig do - params(flag: T::Boolean, threshold: Float, id: Symbol).returns( - T.attached_class - ) - end - def self.new(flag:, threshold: nil, id: :flirtation) - end - - sig do - override.returns({ id: Symbol, flag: T::Boolean, threshold: Float }) - end - def to_hash - end - end - - class Profanity < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::ContentSubmitParams::Policy::Profanity, - ModerationAPI::Internal::AnyHash - ) - end - - sig { returns(Symbol) } - attr_accessor :id - - sig { returns(T::Boolean) } - attr_accessor :flag - - sig { returns(T.nilable(Float)) } - attr_reader :threshold - - sig { params(threshold: Float).void } - attr_writer :threshold - - sig do - params(flag: T::Boolean, threshold: Float, id: Symbol).returns( - T.attached_class - ) - end - def self.new(flag:, threshold: nil, id: :profanity) - end - - sig do - override.returns({ id: Symbol, flag: T::Boolean, threshold: Float }) - end - def to_hash - end - end - - class Violence < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::ContentSubmitParams::Policy::Violence, - ModerationAPI::Internal::AnyHash - ) - end - - sig { returns(Symbol) } - attr_accessor :id - - sig { returns(T::Boolean) } - attr_accessor :flag - - sig { returns(T.nilable(Float)) } - attr_reader :threshold - - sig { params(threshold: Float).void } - attr_writer :threshold - - sig do - params(flag: T::Boolean, threshold: Float, id: Symbol).returns( - T.attached_class - ) - end - def self.new(flag:, threshold: nil, id: :violence) - end - - sig do - override.returns({ id: Symbol, flag: T::Boolean, threshold: Float }) - end - def to_hash - end - end - - class SelfHarm < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::ContentSubmitParams::Policy::SelfHarm, - ModerationAPI::Internal::AnyHash - ) - end - - sig { returns(Symbol) } - attr_accessor :id - - sig { returns(T::Boolean) } - attr_accessor :flag - - sig { returns(T.nilable(Float)) } - attr_reader :threshold - - sig { params(threshold: Float).void } - attr_writer :threshold - - sig do - params(flag: T::Boolean, threshold: Float, id: Symbol).returns( - T.attached_class - ) - end - def self.new(flag:, threshold: nil, id: :self_harm) - end - - sig do - override.returns({ id: Symbol, flag: T::Boolean, threshold: Float }) - end - def to_hash - end - end - - class Spam < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::ContentSubmitParams::Policy::Spam, - ModerationAPI::Internal::AnyHash - ) - end - - sig { returns(Symbol) } - attr_accessor :id - - sig { returns(T::Boolean) } - attr_accessor :flag - - sig { returns(T.nilable(Float)) } - attr_reader :threshold - - sig { params(threshold: Float).void } - attr_writer :threshold - - sig do - params(flag: T::Boolean, threshold: Float, id: Symbol).returns( - T.attached_class - ) - end - def self.new(flag:, threshold: nil, id: :spam) - end - - sig do - override.returns({ id: Symbol, flag: T::Boolean, threshold: Float }) - end - def to_hash - end - end - - class LowQualityContent < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::ContentSubmitParams::Policy::LowQualityContent, - ModerationAPI::Internal::AnyHash - ) - end - - sig { returns(Symbol) } - attr_accessor :id - - sig { returns(T::Boolean) } - attr_accessor :flag - - # Flag content with fewer than this many words as low-effort. Defaults to 3. Set - # to disable by omitting. - sig { returns(T.nilable(Integer)) } - attr_reader :min_words - - sig { params(min_words: Integer).void } - attr_writer :min_words - - sig { returns(T.nilable(Float)) } - attr_reader :threshold - - sig { params(threshold: Float).void } - attr_writer :threshold - - sig do - params( - flag: T::Boolean, - min_words: Integer, - threshold: Float, - id: Symbol - ).returns(T.attached_class) - end - def self.new( - flag:, - # Flag content with fewer than this many words as low-effort. Defaults to 3. Set - # to disable by omitting. - min_words: nil, - threshold: nil, - id: :low_quality - ) - end - - sig do - override.returns( - { - id: Symbol, - flag: T::Boolean, - min_words: Integer, - threshold: Float - } - ) - end - def to_hash - end - end - - class FaceDetection < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::ContentSubmitParams::Policy::FaceDetection, - ModerationAPI::Internal::AnyHash - ) - end - - sig { returns(Symbol) } - attr_accessor :id - - sig { returns(T::Boolean) } - attr_accessor :flag - - # Flag images that contain "at least" or "fewer than" the configured number of - # faces. Defaults to at_least. - sig do - returns( - T.nilable( - ModerationAPI::ContentSubmitParams::Policy::FaceDetection::Comparator::OrSymbol - ) - ) - end - attr_reader :comparator - - sig do - params( - comparator: - ModerationAPI::ContentSubmitParams::Policy::FaceDetection::Comparator::OrSymbol - ).void - end - attr_writer :comparator - - # Number of faces the comparator applies to. Defaults to 1, so the default rule - # flags any image containing a face. - sig { returns(T.nilable(Integer)) } - attr_reader :count - - sig { params(count: Integer).void } - attr_writer :count - - sig { returns(T.nilable(Float)) } - attr_reader :threshold - - sig { params(threshold: Float).void } - attr_writer :threshold - - sig do - params( - flag: T::Boolean, - comparator: - ModerationAPI::ContentSubmitParams::Policy::FaceDetection::Comparator::OrSymbol, - count: Integer, - threshold: Float, - id: Symbol - ).returns(T.attached_class) - end - def self.new( - flag:, - # Flag images that contain "at least" or "fewer than" the configured number of - # faces. Defaults to at_least. - comparator: nil, - # Number of faces the comparator applies to. Defaults to 1, so the default rule - # flags any image containing a face. - count: nil, - threshold: nil, - id: :face_detection - ) - end - - sig do - override.returns( - { - id: Symbol, - flag: T::Boolean, - comparator: - ModerationAPI::ContentSubmitParams::Policy::FaceDetection::Comparator::OrSymbol, - count: Integer, - threshold: Float - } - ) - end - def to_hash - end - - # Flag images that contain "at least" or "fewer than" the configured number of - # faces. Defaults to at_least. - module Comparator - extend ModerationAPI::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all( - Symbol, - ModerationAPI::ContentSubmitParams::Policy::FaceDetection::Comparator - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - AT_LEAST = - T.let( - :at_least, - ModerationAPI::ContentSubmitParams::Policy::FaceDetection::Comparator::TaggedSymbol - ) - FEWER_THAN = - T.let( - :fewer_than, - ModerationAPI::ContentSubmitParams::Policy::FaceDetection::Comparator::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - ModerationAPI::ContentSubmitParams::Policy::FaceDetection::Comparator::TaggedSymbol - ] - ) - end - def self.values - end - end - end - - class SelfPromotion < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::ContentSubmitParams::Policy::SelfPromotion, - ModerationAPI::Internal::AnyHash - ) - end - - sig { returns(Symbol) } - attr_accessor :id - - sig { returns(T::Boolean) } - attr_accessor :flag - - sig { returns(T.nilable(Float)) } - attr_reader :threshold - - sig { params(threshold: Float).void } - attr_writer :threshold - - sig do - params(flag: T::Boolean, threshold: Float, id: Symbol).returns( - T.attached_class - ) - end - def self.new(flag:, threshold: nil, id: :self_promotion) - end - - sig do - override.returns({ id: Symbol, flag: T::Boolean, threshold: Float }) - end - def to_hash - end - end - - class Political < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::ContentSubmitParams::Policy::Political, - ModerationAPI::Internal::AnyHash - ) - end - - sig { returns(Symbol) } - attr_accessor :id - - sig { returns(T::Boolean) } - attr_accessor :flag - - sig { returns(T.nilable(Float)) } - attr_reader :threshold - - sig { params(threshold: Float).void } - attr_writer :threshold - - sig do - params(flag: T::Boolean, threshold: Float, id: Symbol).returns( - T.attached_class - ) - end - def self.new(flag:, threshold: nil, id: :political) - end - - sig do - override.returns({ id: Symbol, flag: T::Boolean, threshold: Float }) - end - def to_hash - end - end - - class Religion < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::ContentSubmitParams::Policy::Religion, - ModerationAPI::Internal::AnyHash - ) - end - - sig { returns(Symbol) } - attr_accessor :id - - sig { returns(T::Boolean) } - attr_accessor :flag - - sig { returns(T.nilable(Float)) } - attr_reader :threshold - - sig { params(threshold: Float).void } - attr_writer :threshold - - sig do - params(flag: T::Boolean, threshold: Float, id: Symbol).returns( - T.attached_class - ) - end - def self.new(flag:, threshold: nil, id: :religion) - end - - sig do - override.returns({ id: Symbol, flag: T::Boolean, threshold: Float }) - end - def to_hash - end - end - - class CodeAbuse < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::ContentSubmitParams::Policy::CodeAbuse, - ModerationAPI::Internal::AnyHash - ) - end - - sig { returns(Symbol) } - attr_accessor :id - - sig { returns(T::Boolean) } - attr_accessor :flag - - sig { returns(T.nilable(Float)) } - attr_reader :threshold - - sig { params(threshold: Float).void } - attr_writer :threshold - - sig do - params(flag: T::Boolean, threshold: Float, id: Symbol).returns( - T.attached_class - ) - end - def self.new(flag:, threshold: nil, id: :code_abuse) - end - - sig do - override.returns({ id: Symbol, flag: T::Boolean, threshold: Float }) - end - def to_hash - end - end - - class UnicodeSpoofing < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::ContentSubmitParams::Policy::UnicodeSpoofing, - ModerationAPI::Internal::AnyHash - ) - end - - sig { returns(Symbol) } - attr_accessor :id - - sig { returns(T::Boolean) } - attr_accessor :flag - - # Per-signal flag toggles. Omitted spoofing signals are enabled; encoding_damage - # defaults to off because decode damage (U+FFFD) marks a broken pipeline, not an - # attack. A disabled signal is still detected and reported as a label, but does - # not by itself flag the policy. - sig do - returns( - T.nilable( - T::Hash[ - Symbol, - ModerationAPI::ContentSubmitParams::Policy::UnicodeSpoofing::Signal - ] - ) - ) - end - attr_reader :signals - - sig do - params( - signals: - T::Hash[ - Symbol, - ModerationAPI::ContentSubmitParams::Policy::UnicodeSpoofing::Signal::OrHash - ] - ).void - end - attr_writer :signals - - sig { returns(T.nilable(Float)) } - attr_reader :threshold - - sig { params(threshold: Float).void } - attr_writer :threshold - - sig do - params( - flag: T::Boolean, - signals: - T::Hash[ - Symbol, - ModerationAPI::ContentSubmitParams::Policy::UnicodeSpoofing::Signal::OrHash - ], - threshold: Float, - id: Symbol - ).returns(T.attached_class) - end - def self.new( - flag:, - # Per-signal flag toggles. Omitted spoofing signals are enabled; encoding_damage - # defaults to off because decode damage (U+FFFD) marks a broken pipeline, not an - # attack. A disabled signal is still detected and reported as a label, but does - # not by itself flag the policy. - signals: nil, - threshold: nil, - id: :unicode_spoofing - ) - end - - sig do - override.returns( - { - id: Symbol, - flag: T::Boolean, - signals: - T::Hash[ - Symbol, - ModerationAPI::ContentSubmitParams::Policy::UnicodeSpoofing::Signal - ], - threshold: Float - } - ) - end - def to_hash - end - - class Signal < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::ContentSubmitParams::Policy::UnicodeSpoofing::Signal, - ModerationAPI::Internal::AnyHash - ) - end - - sig { returns(T.nilable(T::Boolean)) } - attr_reader :flag - - sig { params(flag: T::Boolean).void } - attr_writer :flag - - sig { params(flag: T::Boolean).returns(T.attached_class) } - def self.new(flag: nil) - end - - sig { override.returns({ flag: T::Boolean }) } - def to_hash - end - end - end - - class PiiMasking < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::ContentSubmitParams::Policy::PiiMasking, - ModerationAPI::Internal::AnyHash - ) - end - - sig { returns(Symbol) } - attr_accessor :id - - sig do - returns( - T::Hash[ - Symbol, - ModerationAPI::ContentSubmitParams::Policy::PiiMasking::Entity - ] - ) - end - attr_accessor :entities - - sig do - params( - entities: - T::Hash[ - Symbol, - ModerationAPI::ContentSubmitParams::Policy::PiiMasking::Entity::OrHash - ], - id: Symbol - ).returns(T.attached_class) - end - def self.new(entities:, id: :pii) - end - - sig do - override.returns( - { - id: Symbol, - entities: - T::Hash[ - Symbol, - ModerationAPI::ContentSubmitParams::Policy::PiiMasking::Entity - ] - } - ) - end - def to_hash - end - - class Entity < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::ContentSubmitParams::Policy::PiiMasking::Entity, - ModerationAPI::Internal::AnyHash - ) - end - - sig { returns(T.nilable(T::Boolean)) } - attr_reader :enable - - sig { params(enable: T::Boolean).void } - attr_writer :enable - - sig { returns(T.nilable(T::Boolean)) } - attr_reader :flag - - sig { params(flag: T::Boolean).void } - attr_writer :flag - - sig { returns(T.nilable(String)) } - attr_reader :mask - - sig { params(mask: String).void } - attr_writer :mask - - sig { returns(T.nilable(T::Boolean)) } - attr_reader :should_mask - - sig { params(should_mask: T::Boolean).void } - attr_writer :should_mask - - sig do - params( - enable: T::Boolean, - flag: T::Boolean, - mask: String, - should_mask: T::Boolean - ).returns(T.attached_class) - end - def self.new(enable: nil, flag: nil, mask: nil, should_mask: nil) - end - - sig do - override.returns( - { - enable: T::Boolean, - flag: T::Boolean, - mask: String, - should_mask: T::Boolean - } - ) - end - def to_hash - end - end - end - - class URLMasking < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::ContentSubmitParams::Policy::URLMasking, - ModerationAPI::Internal::AnyHash - ) - end - - sig { returns(Symbol) } - attr_accessor :id - - sig do - returns( - T::Hash[ - Symbol, - ModerationAPI::ContentSubmitParams::Policy::URLMasking::Entity - ] - ) - end - attr_accessor :entities - - sig do - params( - entities: - T::Hash[ - Symbol, - ModerationAPI::ContentSubmitParams::Policy::URLMasking::Entity::OrHash - ], - id: Symbol - ).returns(T.attached_class) - end - def self.new(entities:, id: :url) - end - - sig do - override.returns( - { - id: Symbol, - entities: - T::Hash[ - Symbol, - ModerationAPI::ContentSubmitParams::Policy::URLMasking::Entity - ] - } - ) - end - def to_hash - end - - class Entity < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::ContentSubmitParams::Policy::URLMasking::Entity, - ModerationAPI::Internal::AnyHash - ) - end - - sig { returns(T.nilable(T::Boolean)) } - attr_reader :enable - - sig { params(enable: T::Boolean).void } - attr_writer :enable - - sig { returns(T.nilable(T::Boolean)) } - attr_reader :flag - - sig { params(flag: T::Boolean).void } - attr_writer :flag - - sig { returns(T.nilable(String)) } - attr_reader :mask - - sig { params(mask: String).void } - attr_writer :mask - - sig { returns(T.nilable(T::Boolean)) } - attr_reader :should_mask - - sig { params(should_mask: T::Boolean).void } - attr_writer :should_mask - - sig do - params( - enable: T::Boolean, - flag: T::Boolean, - mask: String, - should_mask: T::Boolean - ).returns(T.attached_class) - end - def self.new(enable: nil, flag: nil, mask: nil, should_mask: nil) - end - - sig do - override.returns( - { - enable: T::Boolean, - flag: T::Boolean, - mask: String, - should_mask: T::Boolean - } - ) - end - def to_hash - end - end - end - - class URLRisk < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::ContentSubmitParams::Policy::URLRisk, - ModerationAPI::Internal::AnyHash - ) - end - - sig { returns(Symbol) } - attr_accessor :id - - sig { returns(T::Boolean) } - attr_accessor :flag - - # IDs of wordlists whose entries are treated as allowed URL domains. Matches - # short-circuit the risk model and are never flagged. - sig { returns(T.nilable(T::Array[String])) } - attr_reader :allowlist_wordlist_ids - - sig { params(allowlist_wordlist_ids: T::Array[String]).void } - attr_writer :allowlist_wordlist_ids - - # IDs of wordlists whose entries are treated as blocked URL domains. Matches - # short-circuit the risk model and are always flagged. Blocklists take precedence - # over allowlists. - sig { returns(T.nilable(T::Array[String])) } - attr_reader :blocklist_wordlist_ids - - sig { params(blocklist_wordlist_ids: T::Array[String]).void } - attr_writer :blocklist_wordlist_ids - - # When true, any URL detected as a free link shortener (bit.ly, t.co, tinyurl, - # etc.) is always flagged regardless of risk score. Allowlist matches still win. - sig { returns(T.nilable(T::Boolean)) } - attr_reader :flag_link_shorteners - - sig { params(flag_link_shorteners: T::Boolean).void } - attr_writer :flag_link_shorteners - - sig { returns(T.nilable(Float)) } - attr_reader :threshold - - sig { params(threshold: Float).void } - attr_writer :threshold - - sig do - params( - flag: T::Boolean, - allowlist_wordlist_ids: T::Array[String], - blocklist_wordlist_ids: T::Array[String], - flag_link_shorteners: T::Boolean, - threshold: Float, - id: Symbol - ).returns(T.attached_class) - end - def self.new( - flag:, - # IDs of wordlists whose entries are treated as allowed URL domains. Matches - # short-circuit the risk model and are never flagged. - allowlist_wordlist_ids: nil, - # IDs of wordlists whose entries are treated as blocked URL domains. Matches - # short-circuit the risk model and are always flagged. Blocklists take precedence - # over allowlists. - blocklist_wordlist_ids: nil, - # When true, any URL detected as a free link shortener (bit.ly, t.co, tinyurl, - # etc.) is always flagged regardless of risk score. Allowlist matches still win. - flag_link_shorteners: nil, - threshold: nil, - id: :url_risk - ) - end - - sig do - override.returns( - { - id: Symbol, - flag: T::Boolean, - allowlist_wordlist_ids: T::Array[String], - blocklist_wordlist_ids: T::Array[String], - flag_link_shorteners: T::Boolean, - threshold: Float - } - ) - end - def to_hash - end - end - - class Guideline < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::ContentSubmitParams::Policy::Guideline, - ModerationAPI::Internal::AnyHash - ) - end - - sig { returns(Symbol) } - attr_accessor :id - - sig { returns(T::Boolean) } - attr_accessor :flag - - sig { returns(String) } - attr_accessor :guideline_key - - sig { returns(String) } - attr_accessor :instructions - - sig { returns(T.nilable(Float)) } - attr_reader :threshold - - sig { params(threshold: Float).void } - attr_writer :threshold - - sig do - params( - flag: T::Boolean, - guideline_key: String, - instructions: String, - threshold: Float, - id: Symbol - ).returns(T.attached_class) - end - def self.new( - flag:, - guideline_key:, - instructions:, - threshold: nil, - id: :guideline - ) - end - - sig do - override.returns( - { - id: Symbol, - flag: T::Boolean, - guideline_key: String, - instructions: String, - threshold: Float - } - ) - end - def to_hash - end - end - - sig do - override.returns( - T::Array[ModerationAPI::ContentSubmitParams::Policy::Variants] - ) - end - def self.variants - end - end - end - end -end diff --git a/rbi/moderation_api/models/content_submit_response.rbi b/rbi/moderation_api/models/content_submit_response.rbi deleted file mode 100644 index 8fe1ead6..00000000 --- a/rbi/moderation_api/models/content_submit_response.rbi +++ /dev/null @@ -1,2109 +0,0 @@ -# typed: strong - -module ModerationAPI - module Models - class ContentSubmitResponse < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::Models::ContentSubmitResponse, - ModerationAPI::Internal::AnyHash - ) - end - - # The author of the content if your account has authors enabled. Requires you to - # send authorId when submitting content. - sig do - returns(T.nilable(ModerationAPI::Models::ContentSubmitResponse::Author)) - end - attr_reader :author - - sig do - params( - author: - T.nilable( - ModerationAPI::Models::ContentSubmitResponse::Author::OrHash - ) - ).void - end - attr_writer :author - - # What your casebook — the record of your past moderation decisions — found for - # this content, or null when it had nothing close enough to say, when the matching - # cases disagreed, or when casebook lookups are not switched on for this channel. - # Reports what the casebook found; whether it decided the outcome is shown in - # `recommendation`, where a higher-priority rule may have settled the item first. - sig do - returns( - T.nilable(ModerationAPI::Models::ContentSubmitResponse::Casebook) - ) - end - attr_reader :casebook - - sig do - params( - casebook: - T.nilable( - ModerationAPI::Models::ContentSubmitResponse::Casebook::OrHash - ) - ).void - end - attr_writer :casebook - - # Potentially modified content. - sig { returns(ModerationAPI::Models::ContentSubmitResponse::Content) } - attr_reader :content - - sig do - params( - content: ModerationAPI::Models::ContentSubmitResponse::Content::OrHash - ).void - end - attr_writer :content - - # The evaluation of the content after running the channel policies. - sig { returns(ModerationAPI::Models::ContentSubmitResponse::Evaluation) } - attr_reader :evaluation - - sig do - params( - evaluation: - ModerationAPI::Models::ContentSubmitResponse::Evaluation::OrHash - ).void - end - attr_writer :evaluation - - # Results of all insights enabled in the channel. - sig do - returns( - T::Array[ - ModerationAPI::Models::ContentSubmitResponse::Insight::Variants - ] - ) - end - attr_accessor :insights - - # Metadata about the moderation request - sig { returns(ModerationAPI::Models::ContentSubmitResponse::Meta) } - attr_reader :meta - - sig do - params( - meta: ModerationAPI::Models::ContentSubmitResponse::Meta::OrHash - ).void - end - attr_writer :meta - - # Results of all policies in the channel. Sorted by highest probability. - sig do - returns( - T::Array[ - ModerationAPI::Models::ContentSubmitResponse::Policy::Variants - ] - ) - end - attr_accessor :policies - - # The recommendation for the content based on the evaluation. - sig do - returns(ModerationAPI::Models::ContentSubmitResponse::Recommendation) - end - attr_reader :recommendation - - sig do - params( - recommendation: - ModerationAPI::Models::ContentSubmitResponse::Recommendation::OrHash - ).void - end - attr_writer :recommendation - - # Policies that had errors - sig do - returns( - T.nilable( - T::Array[ModerationAPI::Models::ContentSubmitResponse::Error] - ) - ) - end - attr_reader :errors - - sig do - params( - errors: - T::Array[ - ModerationAPI::Models::ContentSubmitResponse::Error::OrHash - ] - ).void - end - attr_writer :errors - - sig do - params( - author: - T.nilable( - ModerationAPI::Models::ContentSubmitResponse::Author::OrHash - ), - casebook: - T.nilable( - ModerationAPI::Models::ContentSubmitResponse::Casebook::OrHash - ), - content: - ModerationAPI::Models::ContentSubmitResponse::Content::OrHash, - evaluation: - ModerationAPI::Models::ContentSubmitResponse::Evaluation::OrHash, - insights: - T::Array[ - T.any( - ModerationAPI::Models::ContentSubmitResponse::Insight::SentimentInsight::OrHash, - ModerationAPI::Models::ContentSubmitResponse::Insight::LanguageInsight::OrHash - ) - ], - meta: ModerationAPI::Models::ContentSubmitResponse::Meta::OrHash, - policies: - T::Array[ - T.any( - ModerationAPI::Models::ContentSubmitResponse::Policy::ClassifierOutput::OrHash, - ModerationAPI::Models::ContentSubmitResponse::Policy::EntityMatcherOutput::OrHash - ) - ], - recommendation: - ModerationAPI::Models::ContentSubmitResponse::Recommendation::OrHash, - errors: - T::Array[ - ModerationAPI::Models::ContentSubmitResponse::Error::OrHash - ] - ).returns(T.attached_class) - end - def self.new( - # The author of the content if your account has authors enabled. Requires you to - # send authorId when submitting content. - author:, - # What your casebook — the record of your past moderation decisions — found for - # this content, or null when it had nothing close enough to say, when the matching - # cases disagreed, or when casebook lookups are not switched on for this channel. - # Reports what the casebook found; whether it decided the outcome is shown in - # `recommendation`, where a higher-priority rule may have settled the item first. - casebook:, - # Potentially modified content. - content:, - # The evaluation of the content after running the channel policies. - evaluation:, - # Results of all insights enabled in the channel. - insights:, - # Metadata about the moderation request - meta:, - # Results of all policies in the channel. Sorted by highest probability. - policies:, - # The recommendation for the content based on the evaluation. - recommendation:, - # Policies that had errors - errors: nil - ) - end - - sig do - override.returns( - { - author: - T.nilable(ModerationAPI::Models::ContentSubmitResponse::Author), - casebook: - T.nilable(ModerationAPI::Models::ContentSubmitResponse::Casebook), - content: ModerationAPI::Models::ContentSubmitResponse::Content, - evaluation: - ModerationAPI::Models::ContentSubmitResponse::Evaluation, - insights: - T::Array[ - ModerationAPI::Models::ContentSubmitResponse::Insight::Variants - ], - meta: ModerationAPI::Models::ContentSubmitResponse::Meta, - policies: - T::Array[ - ModerationAPI::Models::ContentSubmitResponse::Policy::Variants - ], - recommendation: - ModerationAPI::Models::ContentSubmitResponse::Recommendation, - errors: - T::Array[ModerationAPI::Models::ContentSubmitResponse::Error] - } - ) - end - def to_hash - end - - class Author < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::Models::ContentSubmitResponse::Author, - ModerationAPI::Internal::AnyHash - ) - end - - # Author ID in Moderation API - sig { returns(String) } - attr_accessor :id - - # Block or suspension details, if applicable. Null if the author is enabled. - sig do - returns( - T.nilable( - ModerationAPI::Models::ContentSubmitResponse::Author::Block - ) - ) - end - attr_reader :block - - sig do - params( - block: - T.nilable( - ModerationAPI::Models::ContentSubmitResponse::Author::Block::OrHash - ) - ).void - end - attr_writer :block - - # Current author status - sig do - returns( - ModerationAPI::Models::ContentSubmitResponse::Author::Status::TaggedSymbol - ) - end - attr_accessor :status - - sig do - returns( - ModerationAPI::Models::ContentSubmitResponse::Author::TrustLevel - ) - end - attr_reader :trust_level - - sig do - params( - trust_level: - ModerationAPI::Models::ContentSubmitResponse::Author::TrustLevel::OrHash - ).void - end - attr_writer :trust_level - - # The author's ID from your system - sig { returns(T.nilable(String)) } - attr_accessor :external_id - - # The author of the content if your account has authors enabled. Requires you to - # send authorId when submitting content. - sig do - params( - id: String, - block: - T.nilable( - ModerationAPI::Models::ContentSubmitResponse::Author::Block::OrHash - ), - status: - ModerationAPI::Models::ContentSubmitResponse::Author::Status::OrSymbol, - trust_level: - ModerationAPI::Models::ContentSubmitResponse::Author::TrustLevel::OrHash, - external_id: T.nilable(String) - ).returns(T.attached_class) - end - def self.new( - # Author ID in Moderation API - id:, - # Block or suspension details, if applicable. Null if the author is enabled. - block:, - # Current author status - status:, - trust_level:, - # The author's ID from your system - external_id: nil - ) - end - - sig do - override.returns( - { - id: String, - block: - T.nilable( - ModerationAPI::Models::ContentSubmitResponse::Author::Block - ), - status: - ModerationAPI::Models::ContentSubmitResponse::Author::Status::TaggedSymbol, - trust_level: - ModerationAPI::Models::ContentSubmitResponse::Author::TrustLevel, - external_id: T.nilable(String) - } - ) - end - def to_hash - end - - class Block < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::Models::ContentSubmitResponse::Author::Block, - ModerationAPI::Internal::AnyHash - ) - end - - # The moderators reason why the author was blocked or suspended. - sig { returns(T.nilable(String)) } - attr_accessor :reason - - # The timestamp until which they are blocked if the author is suspended. - sig { returns(T.nilable(Float)) } - attr_accessor :until_ - - # Block or suspension details, if applicable. Null if the author is enabled. - sig do - params(reason: T.nilable(String), until_: T.nilable(Float)).returns( - T.attached_class - ) - end - def self.new( - # The moderators reason why the author was blocked or suspended. - reason: nil, - # The timestamp until which they are blocked if the author is suspended. - until_: nil - ) - end - - sig do - override.returns( - { reason: T.nilable(String), until_: T.nilable(Float) } - ) - end - def to_hash - end - end - - # Current author status - module Status - extend ModerationAPI::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all( - Symbol, - ModerationAPI::Models::ContentSubmitResponse::Author::Status - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - ENABLED = - T.let( - :enabled, - ModerationAPI::Models::ContentSubmitResponse::Author::Status::TaggedSymbol - ) - SUSPENDED = - T.let( - :suspended, - ModerationAPI::Models::ContentSubmitResponse::Author::Status::TaggedSymbol - ) - BLOCKED = - T.let( - :blocked, - ModerationAPI::Models::ContentSubmitResponse::Author::Status::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - ModerationAPI::Models::ContentSubmitResponse::Author::Status::TaggedSymbol - ] - ) - end - def self.values - end - end - - class TrustLevel < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::Models::ContentSubmitResponse::Author::TrustLevel, - ModerationAPI::Internal::AnyHash - ) - end - - # Author trust level (-1, 0, 1, 2, 3, or 4) - sig { returns(Float) } - attr_accessor :level - - # True if the trust level was set manually by a moderator - sig { returns(T::Boolean) } - attr_accessor :manual - - sig do - params(level: Float, manual: T::Boolean).returns(T.attached_class) - end - def self.new( - # Author trust level (-1, 0, 1, 2, 3, or 4) - level:, - # True if the trust level was set manually by a moderator - manual: - ) - end - - sig { override.returns({ level: Float, manual: T::Boolean }) } - def to_hash - end - end - end - - class Casebook < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::Models::ContentSubmitResponse::Casebook, - ModerationAPI::Internal::AnyHash - ) - end - - # How unanimous the matching cases are, from 0 to 1: the share of them that - # decided this way, ignoring how many there are. Always at least 0.8 when a ruling - # is returned — below that the casebook reports a disagreement instead of picking - # a side — so it tells you how clean the consensus was, and is not a threshold to - # re-apply yourself. - sig { returns(Float) } - attr_accessor :agreement - - # How many of your past cases backed this ruling. - sig { returns(Float) } - attr_accessor :case_count - - # How strongly the casebook holds this ruling, from 0 to 1: the agreement scaled - # by how much evidence backs it, so a handful of close, recent cases outweighs one - # distant one. Older cases count for less, halving in weight roughly every 180 - # days. This is the number to use in rules when you want a strength condition. - sig { returns(Float) } - attr_accessor :confidence - - # How close the nearest matching case is, from 0 to 1. 1 means the content is - # identical to something you have already decided. - sig { returns(Float) } - attr_accessor :similarity - - # The topic the closest matching case is filed under, or null when it has not been - # grouped into one yet. - sig do - returns( - T.nilable( - ModerationAPI::Models::ContentSubmitResponse::Casebook::Topic - ) - ) - end - attr_reader :topic - - sig do - params( - topic: - T.nilable( - ModerationAPI::Models::ContentSubmitResponse::Casebook::Topic::OrHash - ) - ).void - end - attr_writer :topic - - # The ruling your past decisions point to for this content. - sig do - returns( - ModerationAPI::Models::ContentSubmitResponse::Casebook::Verdict::TaggedSymbol - ) - end - attr_accessor :verdict - - # What your casebook — the record of your past moderation decisions — found for - # this content, or null when it had nothing close enough to say, when the matching - # cases disagreed, or when casebook lookups are not switched on for this channel. - # Reports what the casebook found; whether it decided the outcome is shown in - # `recommendation`, where a higher-priority rule may have settled the item first. - sig do - params( - agreement: Float, - case_count: Float, - confidence: Float, - similarity: Float, - topic: - T.nilable( - ModerationAPI::Models::ContentSubmitResponse::Casebook::Topic::OrHash - ), - verdict: - ModerationAPI::Models::ContentSubmitResponse::Casebook::Verdict::OrSymbol - ).returns(T.attached_class) - end - def self.new( - # How unanimous the matching cases are, from 0 to 1: the share of them that - # decided this way, ignoring how many there are. Always at least 0.8 when a ruling - # is returned — below that the casebook reports a disagreement instead of picking - # a side — so it tells you how clean the consensus was, and is not a threshold to - # re-apply yourself. - agreement:, - # How many of your past cases backed this ruling. - case_count:, - # How strongly the casebook holds this ruling, from 0 to 1: the agreement scaled - # by how much evidence backs it, so a handful of close, recent cases outweighs one - # distant one. Older cases count for less, halving in weight roughly every 180 - # days. This is the number to use in rules when you want a strength condition. - confidence:, - # How close the nearest matching case is, from 0 to 1. 1 means the content is - # identical to something you have already decided. - similarity:, - # The topic the closest matching case is filed under, or null when it has not been - # grouped into one yet. - topic:, - # The ruling your past decisions point to for this content. - verdict: - ) - end - - sig do - override.returns( - { - agreement: Float, - case_count: Float, - confidence: Float, - similarity: Float, - topic: - T.nilable( - ModerationAPI::Models::ContentSubmitResponse::Casebook::Topic - ), - verdict: - ModerationAPI::Models::ContentSubmitResponse::Casebook::Verdict::TaggedSymbol - } - ) - end - def to_hash - end - - class Topic < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::Models::ContentSubmitResponse::Casebook::Topic, - ModerationAPI::Internal::AnyHash - ) - end - - sig { returns(String) } - attr_accessor :id - - sig { returns(String) } - attr_accessor :label - - # The topic the closest matching case is filed under, or null when it has not been - # grouped into one yet. - sig { params(id: String, label: String).returns(T.attached_class) } - def self.new(id:, label:) - end - - sig { override.returns({ id: String, label: String }) } - def to_hash - end - end - - # The ruling your past decisions point to for this content. - module Verdict - extend ModerationAPI::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all( - Symbol, - ModerationAPI::Models::ContentSubmitResponse::Casebook::Verdict - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - ALLOW = - T.let( - :allow, - ModerationAPI::Models::ContentSubmitResponse::Casebook::Verdict::TaggedSymbol - ) - REJECT = - T.let( - :reject, - ModerationAPI::Models::ContentSubmitResponse::Casebook::Verdict::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - ModerationAPI::Models::ContentSubmitResponse::Casebook::Verdict::TaggedSymbol - ] - ) - end - def self.values - end - end - end - - class Content < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::Models::ContentSubmitResponse::Content, - ModerationAPI::Internal::AnyHash - ) - end - - # The unique identifier for the content. Either the contentId provided by you or - # an autogenerated ID. - sig { returns(String) } - attr_accessor :id - - # Whether any values have been masked. - sig { returns(T::Boolean) } - attr_accessor :masked - - # The modified content, if any. - sig do - returns( - T.nilable( - ModerationAPI::Models::ContentSubmitResponse::Content::Modified::Variants - ) - ) - end - attr_accessor :modified - - # Whether Unicode spoofing normalization rewrote the content — confusables folded - # to their Latin lookalikes, invisible characters and combining-mark abuse - # stripped. - sig { returns(T::Boolean) } - attr_accessor :unicode_cleaned - - # The transcribed text from audio content. Only present when audio moderation is - # used and transcript inclusion is enabled on the channel. - sig { returns(T.nilable(String)) } - attr_accessor :transcript - - # Potentially modified content. - sig do - params( - id: String, - masked: T::Boolean, - modified: - T.nilable( - ModerationAPI::Models::ContentSubmitResponse::Content::Modified::Variants - ), - unicode_cleaned: T::Boolean, - transcript: T.nilable(String) - ).returns(T.attached_class) - end - def self.new( - # The unique identifier for the content. Either the contentId provided by you or - # an autogenerated ID. - id:, - # Whether any values have been masked. - masked:, - # The modified content, if any. - modified:, - # Whether Unicode spoofing normalization rewrote the content — confusables folded - # to their Latin lookalikes, invisible characters and combining-mark abuse - # stripped. - unicode_cleaned:, - # The transcribed text from audio content. Only present when audio moderation is - # used and transcript inclusion is enabled on the channel. - transcript: nil - ) - end - - sig do - override.returns( - { - id: String, - masked: T::Boolean, - modified: - T.nilable( - ModerationAPI::Models::ContentSubmitResponse::Content::Modified::Variants - ), - unicode_cleaned: T::Boolean, - transcript: T.nilable(String) - } - ) - end - def to_hash - end - - # The modified content, if any. - module Modified - extend ModerationAPI::Internal::Type::Union - - Variants = - T.type_alias do - T.any( - String, - T::Hash[Symbol, T.anything], - T::Hash[ - Symbol, - ModerationAPI::Models::ContentSubmitResponse::Content::Modified::ModifiedNestedObjectContent::Variants - ] - ) - end - - # Text - module ModifiedNestedObjectContent - extend ModerationAPI::Internal::Type::Union - - Variants = - T.type_alias do - T.any( - ModerationAPI::Models::ContentSubmitResponse::Content::Modified::ModifiedNestedObjectContent::Text, - ModerationAPI::Models::ContentSubmitResponse::Content::Modified::ModifiedNestedObjectContent::Image, - ModerationAPI::Models::ContentSubmitResponse::Content::Modified::ModifiedNestedObjectContent::Video, - ModerationAPI::Models::ContentSubmitResponse::Content::Modified::ModifiedNestedObjectContent::Audio - ) - end - - class Text < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::Models::ContentSubmitResponse::Content::Modified::ModifiedNestedObjectContent::Text, - ModerationAPI::Internal::AnyHash - ) - end - - # The content text - sig { returns(String) } - attr_accessor :text - - sig { returns(Symbol) } - attr_accessor :type - - # Text - sig do - params(text: String, type: Symbol).returns(T.attached_class) - end - def self.new( - # The content text - text:, - type: :text - ) - end - - sig { override.returns({ text: String, type: Symbol }) } - def to_hash - end - end - - class Image < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::Models::ContentSubmitResponse::Content::Modified::ModifiedNestedObjectContent::Image, - ModerationAPI::Internal::AnyHash - ) - end - - sig { returns(Symbol) } - attr_accessor :type - - # Base64-encoded image data. Either url or data must be provided. Note: base64 - # images are not stored and will not appear in the review queue. - sig { returns(T.nilable(String)) } - attr_reader :data - - sig { params(data: String).void } - attr_writer :data - - # A public URL of the image content. Either url or data must be provided. - sig { returns(T.nilable(String)) } - attr_reader :url - - sig { params(url: String).void } - attr_writer :url - - # Image - sig do - params(data: String, url: String, type: Symbol).returns( - T.attached_class - ) - end - def self.new( - # Base64-encoded image data. Either url or data must be provided. Note: base64 - # images are not stored and will not appear in the review queue. - data: nil, - # A public URL of the image content. Either url or data must be provided. - url: nil, - type: :image - ) - end - - sig do - override.returns({ type: Symbol, data: String, url: String }) - end - def to_hash - end - end - - class Video < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::Models::ContentSubmitResponse::Content::Modified::ModifiedNestedObjectContent::Video, - ModerationAPI::Internal::AnyHash - ) - end - - sig { returns(Symbol) } - attr_accessor :type - - # A public URL of the video content - sig { returns(String) } - attr_accessor :url - - # Video - sig do - params(url: String, type: Symbol).returns(T.attached_class) - end - def self.new( - # A public URL of the video content - url:, - type: :video - ) - end - - sig { override.returns({ type: Symbol, url: String }) } - def to_hash - end - end - - class Audio < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::Models::ContentSubmitResponse::Content::Modified::ModifiedNestedObjectContent::Audio, - ModerationAPI::Internal::AnyHash - ) - end - - sig { returns(Symbol) } - attr_accessor :type - - # The URL of the audio content - sig { returns(String) } - attr_accessor :url - - # Audio - sig do - params(url: String, type: Symbol).returns(T.attached_class) - end - def self.new( - # The URL of the audio content - url:, - type: :audio - ) - end - - sig { override.returns({ type: Symbol, url: String }) } - def to_hash - end - end - - sig do - override.returns( - T::Array[ - ModerationAPI::Models::ContentSubmitResponse::Content::Modified::ModifiedNestedObjectContent::Variants - ] - ) - end - def self.variants - end - end - - sig do - override.returns( - T::Array[ - ModerationAPI::Models::ContentSubmitResponse::Content::Modified::Variants - ] - ) - end - def self.variants - end - - ModifiedObjectContentMap = - T.let( - ModerationAPI::Internal::Type::HashOf[ - ModerationAPI::Internal::Type::Unknown - ], - ModerationAPI::Internal::Type::Converter - ) - - ModifiedNestedObjectContentMap = - T.let( - ModerationAPI::Internal::Type::HashOf[ - union: - ModerationAPI::Models::ContentSubmitResponse::Content::Modified::ModifiedNestedObjectContent - ], - ModerationAPI::Internal::Type::Converter - ) - end - end - - class Evaluation < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::Models::ContentSubmitResponse::Evaluation, - ModerationAPI::Internal::AnyHash - ) - end - - # The probability that the content should be flagged. - sig { returns(Float) } - attr_accessor :flag_probability - - # Whether the content was flagged by any policy. - sig { returns(T::Boolean) } - attr_accessor :flagged - - # The severity score of the content. A higher score indicates more severe content. - sig { returns(Float) } - attr_accessor :severity_score - - # Whether the content would have been flagged by analyze-only policies (flag: - # false). - sig { returns(T.nilable(T::Boolean)) } - attr_reader :shadow_flagged - - sig { params(shadow_flagged: T::Boolean).void } - attr_writer :shadow_flagged - - # Whether the content was flagged for Unicode spoofing. - sig { returns(T.nilable(T::Boolean)) } - attr_reader :unicode_spoofed - - sig { params(unicode_spoofed: T::Boolean).void } - attr_writer :unicode_spoofed - - # The evaluation of the content after running the channel policies. - sig do - params( - flag_probability: Float, - flagged: T::Boolean, - severity_score: Float, - shadow_flagged: T::Boolean, - unicode_spoofed: T::Boolean - ).returns(T.attached_class) - end - def self.new( - # The probability that the content should be flagged. - flag_probability:, - # Whether the content was flagged by any policy. - flagged:, - # The severity score of the content. A higher score indicates more severe content. - severity_score:, - # Whether the content would have been flagged by analyze-only policies (flag: - # false). - shadow_flagged: nil, - # Whether the content was flagged for Unicode spoofing. - unicode_spoofed: nil - ) - end - - sig do - override.returns( - { - flag_probability: Float, - flagged: T::Boolean, - severity_score: Float, - shadow_flagged: T::Boolean, - unicode_spoofed: T::Boolean - } - ) - end - def to_hash - end - end - - # Sentiment insight - module Insight - extend ModerationAPI::Internal::Type::Union - - Variants = - T.type_alias do - T.any( - ModerationAPI::Models::ContentSubmitResponse::Insight::SentimentInsight, - ModerationAPI::Models::ContentSubmitResponse::Insight::LanguageInsight - ) - end - - class SentimentInsight < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::Models::ContentSubmitResponse::Insight::SentimentInsight, - ModerationAPI::Internal::AnyHash - ) - end - - sig { returns(Symbol) } - attr_accessor :id - - sig { returns(Float) } - attr_accessor :probability - - sig { returns(Symbol) } - attr_accessor :type - - sig do - returns( - T.nilable( - ModerationAPI::Models::ContentSubmitResponse::Insight::SentimentInsight::Value::TaggedSymbol - ) - ) - end - attr_accessor :value - - # Sentiment insight - sig do - params( - probability: Float, - value: - T.nilable( - ModerationAPI::Models::ContentSubmitResponse::Insight::SentimentInsight::Value::OrSymbol - ), - id: Symbol, - type: Symbol - ).returns(T.attached_class) - end - def self.new(probability:, value:, id: :sentiment, type: :insight) - end - - sig do - override.returns( - { - id: Symbol, - probability: Float, - type: Symbol, - value: - T.nilable( - ModerationAPI::Models::ContentSubmitResponse::Insight::SentimentInsight::Value::TaggedSymbol - ) - } - ) - end - def to_hash - end - - module Value - extend ModerationAPI::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all( - Symbol, - ModerationAPI::Models::ContentSubmitResponse::Insight::SentimentInsight::Value - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - POSITIVE = - T.let( - :positive, - ModerationAPI::Models::ContentSubmitResponse::Insight::SentimentInsight::Value::TaggedSymbol - ) - NEUTRAL = - T.let( - :neutral, - ModerationAPI::Models::ContentSubmitResponse::Insight::SentimentInsight::Value::TaggedSymbol - ) - NEGATIVE = - T.let( - :negative, - ModerationAPI::Models::ContentSubmitResponse::Insight::SentimentInsight::Value::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - ModerationAPI::Models::ContentSubmitResponse::Insight::SentimentInsight::Value::TaggedSymbol - ] - ) - end - def self.values - end - end - end - - class LanguageInsight < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::Models::ContentSubmitResponse::Insight::LanguageInsight, - ModerationAPI::Internal::AnyHash - ) - end - - sig { returns(Symbol) } - attr_accessor :id - - sig { returns(Float) } - attr_accessor :probability - - sig { returns(Symbol) } - attr_accessor :type - - sig { returns(T.nilable(String)) } - attr_accessor :value - - # Language insight - sig do - params( - probability: Float, - value: T.nilable(String), - id: Symbol, - type: Symbol - ).returns(T.attached_class) - end - def self.new(probability:, value:, id: :language, type: :insight) - end - - sig do - override.returns( - { - id: Symbol, - probability: Float, - type: Symbol, - value: T.nilable(String) - } - ) - end - def to_hash - end - end - - sig do - override.returns( - T::Array[ - ModerationAPI::Models::ContentSubmitResponse::Insight::Variants - ] - ) - end - def self.variants - end - end - - class Meta < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::Models::ContentSubmitResponse::Meta, - ModerationAPI::Internal::AnyHash - ) - end - - # The unique key of the channel where the content was handled. Either the channel - # provided by you or automatically routed. - sig { returns(String) } - attr_accessor :channel_key - - sig do - returns( - ModerationAPI::Models::ContentSubmitResponse::Meta::Status::TaggedSymbol - ) - end - attr_accessor :status - - sig { returns(Float) } - attr_accessor :timestamp - - sig { returns(Float) } - attr_accessor :usage - - sig { returns(T.nilable(String)) } - attr_reader :processing_time - - sig { params(processing_time: String).void } - attr_writer :processing_time - - # Metadata about the moderation request - sig do - params( - channel_key: String, - status: - ModerationAPI::Models::ContentSubmitResponse::Meta::Status::OrSymbol, - timestamp: Float, - usage: Float, - processing_time: String - ).returns(T.attached_class) - end - def self.new( - # The unique key of the channel where the content was handled. Either the channel - # provided by you or automatically routed. - channel_key:, - status:, - timestamp:, - usage:, - processing_time: nil - ) - end - - sig do - override.returns( - { - channel_key: String, - status: - ModerationAPI::Models::ContentSubmitResponse::Meta::Status::TaggedSymbol, - timestamp: Float, - usage: Float, - processing_time: String - } - ) - end - def to_hash - end - - module Status - extend ModerationAPI::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all( - Symbol, - ModerationAPI::Models::ContentSubmitResponse::Meta::Status - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - SUCCESS = - T.let( - :success, - ModerationAPI::Models::ContentSubmitResponse::Meta::Status::TaggedSymbol - ) - PARTIAL_SUCCESS = - T.let( - :partial_success, - ModerationAPI::Models::ContentSubmitResponse::Meta::Status::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - ModerationAPI::Models::ContentSubmitResponse::Meta::Status::TaggedSymbol - ] - ) - end - def self.values - end - end - end - - # Policy output schema. - module Policy - extend ModerationAPI::Internal::Type::Union - - Variants = - T.type_alias do - T.any( - ModerationAPI::Models::ContentSubmitResponse::Policy::ClassifierOutput, - ModerationAPI::Models::ContentSubmitResponse::Policy::EntityMatcherOutput - ) - end - - class ClassifierOutput < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::Models::ContentSubmitResponse::Policy::ClassifierOutput, - ModerationAPI::Internal::AnyHash - ) - end - - # The unique identifier for the classifier output. - sig { returns(String) } - attr_accessor :id - - sig { returns(T::Boolean) } - attr_accessor :flagged - - sig { returns(Float) } - attr_accessor :probability - - sig { returns(Symbol) } - attr_accessor :type - - # Optional structured data produced by the policy. For face detection: { count, - # faces: [{ confidence, gender, age }] }. - sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } - attr_reader :data - - sig { params(data: T::Hash[Symbol, T.anything]).void } - attr_writer :data - - # The keys of the flagged fields if submitting an object. - sig { returns(T.nilable(T::Array[String])) } - attr_reader :flagged_fields - - sig { params(flagged_fields: T::Array[String]).void } - attr_writer :flagged_fields - - sig do - returns( - T.nilable( - T::Array[ - ModerationAPI::Models::ContentSubmitResponse::Policy::ClassifierOutput::Label - ] - ) - ) - end - attr_reader :labels - - sig do - params( - labels: - T::Array[ - ModerationAPI::Models::ContentSubmitResponse::Policy::ClassifierOutput::Label::OrHash - ] - ).void - end - attr_writer :labels - - # Classifier policy. - sig do - params( - id: String, - flagged: T::Boolean, - probability: Float, - data: T::Hash[Symbol, T.anything], - flagged_fields: T::Array[String], - labels: - T::Array[ - ModerationAPI::Models::ContentSubmitResponse::Policy::ClassifierOutput::Label::OrHash - ], - type: Symbol - ).returns(T.attached_class) - end - def self.new( - # The unique identifier for the classifier output. - id:, - flagged:, - probability:, - # Optional structured data produced by the policy. For face detection: { count, - # faces: [{ confidence, gender, age }] }. - data: nil, - # The keys of the flagged fields if submitting an object. - flagged_fields: nil, - labels: nil, - type: :classifier - ) - end - - sig do - override.returns( - { - id: String, - flagged: T::Boolean, - probability: Float, - type: Symbol, - data: T::Hash[Symbol, T.anything], - flagged_fields: T::Array[String], - labels: - T::Array[ - ModerationAPI::Models::ContentSubmitResponse::Policy::ClassifierOutput::Label - ] - } - ) - end - def to_hash - end - - class Label < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::Models::ContentSubmitResponse::Policy::ClassifierOutput::Label, - ModerationAPI::Internal::AnyHash - ) - end - - sig { returns(String) } - attr_accessor :id - - sig { returns(T::Boolean) } - attr_accessor :flagged - - sig { returns(Float) } - attr_accessor :probability - - sig { returns(T.nilable(T::Boolean)) } - attr_reader :shadow_flagged - - sig { params(shadow_flagged: T::Boolean).void } - attr_writer :shadow_flagged - - sig do - params( - id: String, - flagged: T::Boolean, - probability: Float, - shadow_flagged: T::Boolean - ).returns(T.attached_class) - end - def self.new(id:, flagged:, probability:, shadow_flagged: nil) - end - - sig do - override.returns( - { - id: String, - flagged: T::Boolean, - probability: Float, - shadow_flagged: T::Boolean - } - ) - end - def to_hash - end - end - end - - class EntityMatcherOutput < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::Models::ContentSubmitResponse::Policy::EntityMatcherOutput, - ModerationAPI::Internal::AnyHash - ) - end - - sig { returns(String) } - attr_accessor :id - - sig { returns(T::Boolean) } - attr_accessor :flagged - - sig do - returns( - T::Array[ - ModerationAPI::Models::ContentSubmitResponse::Policy::EntityMatcherOutput::Match - ] - ) - end - attr_accessor :matches - - sig { returns(Float) } - attr_accessor :probability - - sig { returns(Symbol) } - attr_accessor :type - - sig { returns(T.nilable(T::Array[String])) } - attr_reader :flagged_fields - - sig { params(flagged_fields: T::Array[String]).void } - attr_writer :flagged_fields - - # Entity matcher policy. - sig do - params( - id: String, - flagged: T::Boolean, - matches: - T::Array[ - ModerationAPI::Models::ContentSubmitResponse::Policy::EntityMatcherOutput::Match::OrHash - ], - probability: Float, - flagged_fields: T::Array[String], - type: Symbol - ).returns(T.attached_class) - end - def self.new( - id:, - flagged:, - matches:, - probability:, - flagged_fields: nil, - type: :entity_matcher - ) - end - - sig do - override.returns( - { - id: String, - flagged: T::Boolean, - matches: - T::Array[ - ModerationAPI::Models::ContentSubmitResponse::Policy::EntityMatcherOutput::Match - ], - probability: Float, - type: Symbol, - flagged_fields: T::Array[String] - } - ) - end - def to_hash - end - - class Match < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::Models::ContentSubmitResponse::Policy::EntityMatcherOutput::Match, - ModerationAPI::Internal::AnyHash - ) - end - - sig { returns(String) } - attr_accessor :match - - sig { returns(Float) } - attr_accessor :probability - - sig { returns(T::Array[Integer]) } - attr_accessor :span - - # Sub-type of the entity match — e.g. the NER key (email, phone, name, …) for PII - # matches. Absent for URL Risk and wordlist matches where the type is already - # encoded in the parent label. - sig { returns(T.nilable(String)) } - attr_reader :entity_type - - sig { params(entity_type: String).void } - attr_writer :entity_type - - # Stable codes explaining why a URL was flagged (URL Risk only). - sig { returns(T.nilable(T::Array[String])) } - attr_reader :reasons - - sig { params(reasons: T::Array[String]).void } - attr_writer :reasons - - # Observable properties of a URL (URL Risk only). Absent for allow/block list - # matches. - sig do - returns( - T.nilable( - ModerationAPI::Models::ContentSubmitResponse::Policy::EntityMatcherOutput::Match::Signals - ) - ) - end - attr_reader :signals - - sig do - params( - signals: - ModerationAPI::Models::ContentSubmitResponse::Policy::EntityMatcherOutput::Match::Signals::OrHash - ).void - end - attr_writer :signals - - sig do - params( - match: String, - probability: Float, - span: T::Array[Integer], - entity_type: String, - reasons: T::Array[String], - signals: - ModerationAPI::Models::ContentSubmitResponse::Policy::EntityMatcherOutput::Match::Signals::OrHash - ).returns(T.attached_class) - end - def self.new( - match:, - probability:, - span:, - # Sub-type of the entity match — e.g. the NER key (email, phone, name, …) for PII - # matches. Absent for URL Risk and wordlist matches where the type is already - # encoded in the parent label. - entity_type: nil, - # Stable codes explaining why a URL was flagged (URL Risk only). - reasons: nil, - # Observable properties of a URL (URL Risk only). Absent for allow/block list - # matches. - signals: nil - ) - end - - sig do - override.returns( - { - match: String, - probability: Float, - span: T::Array[Integer], - entity_type: String, - reasons: T::Array[String], - signals: - ModerationAPI::Models::ContentSubmitResponse::Policy::EntityMatcherOutput::Match::Signals - } - ) - end - def to_hash - end - - class Signals < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::Models::ContentSubmitResponse::Policy::EntityMatcherOutput::Match::Signals, - ModerationAPI::Internal::AnyHash - ) - end - - sig { returns(T.nilable(T::Boolean)) } - attr_accessor :bot_protection - - sig do - returns( - T.nilable( - ModerationAPI::Models::ContentSubmitResponse::Policy::EntityMatcherOutput::Match::Signals::BrandImpersonation - ) - ) - end - attr_reader :brand_impersonation - - sig do - params( - brand_impersonation: - T.nilable( - ModerationAPI::Models::ContentSubmitResponse::Policy::EntityMatcherOutput::Match::Signals::BrandImpersonation::OrHash - ) - ).void - end - attr_writer :brand_impersonation - - sig { returns(T.nilable(Integer)) } - attr_accessor :domain_age_days - - sig { returns(T.nilable(String)) } - attr_accessor :final_url - - sig { returns(T.nilable(T::Boolean)) } - attr_accessor :has_email_setup - - sig { returns(T::Boolean) } - attr_accessor :has_suspicious_characters - - sig { returns(T::Boolean) } - attr_accessor :is_link_shortener - - sig { returns(T::Boolean) } - attr_accessor :is_reported - - sig { returns(T.nilable(Integer)) } - attr_accessor :redirect_count - - # Observable properties of a URL (URL Risk only). Absent for allow/block list - # matches. - sig do - params( - bot_protection: T.nilable(T::Boolean), - brand_impersonation: - T.nilable( - ModerationAPI::Models::ContentSubmitResponse::Policy::EntityMatcherOutput::Match::Signals::BrandImpersonation::OrHash - ), - domain_age_days: T.nilable(Integer), - final_url: T.nilable(String), - has_email_setup: T.nilable(T::Boolean), - has_suspicious_characters: T::Boolean, - is_link_shortener: T::Boolean, - is_reported: T::Boolean, - redirect_count: T.nilable(Integer) - ).returns(T.attached_class) - end - def self.new( - bot_protection:, - brand_impersonation:, - domain_age_days:, - final_url:, - has_email_setup:, - has_suspicious_characters:, - is_link_shortener:, - is_reported:, - redirect_count: - ) - end - - sig do - override.returns( - { - bot_protection: T.nilable(T::Boolean), - brand_impersonation: - T.nilable( - ModerationAPI::Models::ContentSubmitResponse::Policy::EntityMatcherOutput::Match::Signals::BrandImpersonation - ), - domain_age_days: T.nilable(Integer), - final_url: T.nilable(String), - has_email_setup: T.nilable(T::Boolean), - has_suspicious_characters: T::Boolean, - is_link_shortener: T::Boolean, - is_reported: T::Boolean, - redirect_count: T.nilable(Integer) - } - ) - end - def to_hash - end - - class BrandImpersonation < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::Models::ContentSubmitResponse::Policy::EntityMatcherOutput::Match::Signals::BrandImpersonation, - ModerationAPI::Internal::AnyHash - ) - end - - sig { returns(String) } - attr_accessor :brand - - sig do - returns( - ModerationAPI::Models::ContentSubmitResponse::Policy::EntityMatcherOutput::Match::Signals::BrandImpersonation::Method::TaggedSymbol - ) - end - attr_accessor :method_ - - sig do - params( - brand: String, - method_: - ModerationAPI::Models::ContentSubmitResponse::Policy::EntityMatcherOutput::Match::Signals::BrandImpersonation::Method::OrSymbol - ).returns(T.attached_class) - end - def self.new(brand:, method_:) - end - - sig do - override.returns( - { - brand: String, - method_: - ModerationAPI::Models::ContentSubmitResponse::Policy::EntityMatcherOutput::Match::Signals::BrandImpersonation::Method::TaggedSymbol - } - ) - end - def to_hash - end - - module Method - extend ModerationAPI::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all( - Symbol, - ModerationAPI::Models::ContentSubmitResponse::Policy::EntityMatcherOutput::Match::Signals::BrandImpersonation::Method - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - REGISTERED_DOMAIN_TOKEN = - T.let( - :registered_domain_token, - ModerationAPI::Models::ContentSubmitResponse::Policy::EntityMatcherOutput::Match::Signals::BrandImpersonation::Method::TaggedSymbol - ) - SUBDOMAIN_TOKEN = - T.let( - :subdomain_token, - ModerationAPI::Models::ContentSubmitResponse::Policy::EntityMatcherOutput::Match::Signals::BrandImpersonation::Method::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - ModerationAPI::Models::ContentSubmitResponse::Policy::EntityMatcherOutput::Match::Signals::BrandImpersonation::Method::TaggedSymbol - ] - ) - end - def self.values - end - end - end - end - end - end - - sig do - override.returns( - T::Array[ - ModerationAPI::Models::ContentSubmitResponse::Policy::Variants - ] - ) - end - def self.variants - end - end - - class Recommendation < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::Models::ContentSubmitResponse::Recommendation, - ModerationAPI::Internal::AnyHash - ) - end - - # The action to take based on the recommendation - sig do - returns( - ModerationAPI::Models::ContentSubmitResponse::Recommendation::Action::TaggedSymbol - ) - end - attr_accessor :action - - # Reason codes for the recommendation. Standard codes plus a `rule:` code - # identifying the rule that produced the action. Can be used to display a reason - # to the user. - sig do - returns( - T::Array[ - ModerationAPI::Models::ContentSubmitResponse::Recommendation::ReasonCode::Variants - ] - ) - end - attr_accessor :reason_codes - - # Rules that matched during evaluation, if rules engine is active. - sig do - returns( - T.nilable( - T::Array[ - ModerationAPI::Models::ContentSubmitResponse::Recommendation::MatchedRule - ] - ) - ) - end - attr_reader :matched_rules - - sig do - params( - matched_rules: - T::Array[ - ModerationAPI::Models::ContentSubmitResponse::Recommendation::MatchedRule::OrHash - ] - ).void - end - attr_writer :matched_rules - - # The recommendation for the content based on the evaluation. - sig do - params( - action: - ModerationAPI::Models::ContentSubmitResponse::Recommendation::Action::OrSymbol, - reason_codes: - T::Array[ - T.any( - ModerationAPI::Models::ContentSubmitResponse::Recommendation::ReasonCode::OrSymbol, - String - ) - ], - matched_rules: - T::Array[ - ModerationAPI::Models::ContentSubmitResponse::Recommendation::MatchedRule::OrHash - ] - ).returns(T.attached_class) - end - def self.new( - # The action to take based on the recommendation - action:, - # Reason codes for the recommendation. Standard codes plus a `rule:` code - # identifying the rule that produced the action. Can be used to display a reason - # to the user. - reason_codes:, - # Rules that matched during evaluation, if rules engine is active. - matched_rules: nil - ) - end - - sig do - override.returns( - { - action: - ModerationAPI::Models::ContentSubmitResponse::Recommendation::Action::TaggedSymbol, - reason_codes: - T::Array[ - ModerationAPI::Models::ContentSubmitResponse::Recommendation::ReasonCode::Variants - ], - matched_rules: - T::Array[ - ModerationAPI::Models::ContentSubmitResponse::Recommendation::MatchedRule - ] - } - ) - end - def to_hash - end - - # The action to take based on the recommendation - module Action - extend ModerationAPI::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all( - Symbol, - ModerationAPI::Models::ContentSubmitResponse::Recommendation::Action - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - REVIEW = - T.let( - :review, - ModerationAPI::Models::ContentSubmitResponse::Recommendation::Action::TaggedSymbol - ) - ALLOW = - T.let( - :allow, - ModerationAPI::Models::ContentSubmitResponse::Recommendation::Action::TaggedSymbol - ) - REJECT = - T.let( - :reject, - ModerationAPI::Models::ContentSubmitResponse::Recommendation::Action::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - ModerationAPI::Models::ContentSubmitResponse::Recommendation::Action::TaggedSymbol - ] - ) - end - def self.values - end - end - - module ReasonCode - extend ModerationAPI::Internal::Type::Union - - Variants = - T.type_alias do - T.any( - ModerationAPI::Models::ContentSubmitResponse::Recommendation::ReasonCode::TaggedSymbol, - String - ) - end - - sig do - override.returns( - T::Array[ - ModerationAPI::Models::ContentSubmitResponse::Recommendation::ReasonCode::Variants - ] - ) - end - def self.variants - end - - TaggedSymbol = - T.type_alias do - T.all( - Symbol, - ModerationAPI::Models::ContentSubmitResponse::Recommendation::ReasonCode - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - SEVERITY_REJECT = - T.let( - :severity_reject, - ModerationAPI::Models::ContentSubmitResponse::Recommendation::ReasonCode::TaggedSymbol - ) - SEVERITY_REVIEW = - T.let( - :severity_review, - ModerationAPI::Models::ContentSubmitResponse::Recommendation::ReasonCode::TaggedSymbol - ) - AUTHOR_BLOCK = - T.let( - :author_block, - ModerationAPI::Models::ContentSubmitResponse::Recommendation::ReasonCode::TaggedSymbol - ) - DRY_RUN = - T.let( - :dry_run, - ModerationAPI::Models::ContentSubmitResponse::Recommendation::ReasonCode::TaggedSymbol - ) - TRUSTED_ALLOW = - T.let( - :trusted_allow, - ModerationAPI::Models::ContentSubmitResponse::Recommendation::ReasonCode::TaggedSymbol - ) - UNTRUSTED_SEVERITY = - T.let( - :untrusted_severity, - ModerationAPI::Models::ContentSubmitResponse::Recommendation::ReasonCode::TaggedSymbol - ) - RULE_MATCH = - T.let( - :rule_match, - ModerationAPI::Models::ContentSubmitResponse::Recommendation::ReasonCode::TaggedSymbol - ) - RULE_DEFAULT = - T.let( - :rule_default, - ModerationAPI::Models::ContentSubmitResponse::Recommendation::ReasonCode::TaggedSymbol - ) - RULE_FALLBACK = - T.let( - :rule_fallback, - ModerationAPI::Models::ContentSubmitResponse::Recommendation::ReasonCode::TaggedSymbol - ) - CLIENT_OVERRIDE = - T.let( - :client_override, - ModerationAPI::Models::ContentSubmitResponse::Recommendation::ReasonCode::TaggedSymbol - ) - CASEBOOK_MATCH = - T.let( - :casebook_match, - ModerationAPI::Models::ContentSubmitResponse::Recommendation::ReasonCode::TaggedSymbol - ) - end - - class MatchedRule < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::Models::ContentSubmitResponse::Recommendation::MatchedRule, - ModerationAPI::Internal::AnyHash - ) - end - - sig { returns(String) } - attr_accessor :key - - sig { returns(String) } - attr_accessor :name - - sig { params(key: String, name: String).returns(T.attached_class) } - def self.new(key:, name:) - end - - sig { override.returns({ key: String, name: String }) } - def to_hash - end - end - end - - class Error < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::Models::ContentSubmitResponse::Error, - ModerationAPI::Internal::AnyHash - ) - end - - sig { returns(String) } - attr_accessor :id - - sig { returns(String) } - attr_accessor :message - - sig { params(id: String, message: String).returns(T.attached_class) } - def self.new(id:, message:) - end - - sig { override.returns({ id: String, message: String }) } - def to_hash - end - end - end - end -end diff --git a/rbi/moderation_api/models/queue/item_list_params.rbi b/rbi/moderation_api/models/queue/item_list_params.rbi deleted file mode 100644 index 40148d19..00000000 --- a/rbi/moderation_api/models/queue/item_list_params.rbi +++ /dev/null @@ -1,245 +0,0 @@ -# typed: strong - -module ModerationAPI - module Models - module Queue - class ItemListParams < ModerationAPI::Internal::Type::BaseModel - extend ModerationAPI::Internal::Type::RequestParameters::Converter - include ModerationAPI::Internal::Type::RequestParameters - - OrHash = - T.type_alias do - T.any( - ModerationAPI::Queue::ItemListParams, - ModerationAPI::Internal::AnyHash - ) - end - - # The queue ID - sig { returns(String) } - attr_accessor :id - - sig { returns(T.nilable(String)) } - attr_reader :after_date - - sig { params(after_date: String).void } - attr_writer :after_date - - sig { returns(T.nilable(String)) } - attr_reader :author_id - - sig { params(author_id: String).void } - attr_writer :author_id - - sig { returns(T.nilable(String)) } - attr_reader :before_date - - sig { params(before_date: String).void } - attr_writer :before_date - - sig { returns(T.nilable(String)) } - attr_reader :conversation_ids - - sig { params(conversation_ids: String).void } - attr_writer :conversation_ids - - sig { returns(T.nilable(String)) } - attr_reader :filtered_action_ids - - sig { params(filtered_action_ids: String).void } - attr_writer :filtered_action_ids - - sig { returns(T.nilable(String)) } - attr_reader :include_resolved - - sig { params(include_resolved: String).void } - attr_writer :include_resolved - - sig { returns(T.nilable(String)) } - attr_reader :labels - - sig { params(labels: String).void } - attr_writer :labels - - # Page number to fetch - sig { returns(T.nilable(Float)) } - attr_reader :page_number - - sig { params(page_number: Float).void } - attr_writer :page_number - - # Number of items per page - sig { returns(T.nilable(Float)) } - attr_reader :page_size - - sig { params(page_size: Float).void } - attr_writer :page_size - - # Sort direction - sig do - returns( - T.nilable( - ModerationAPI::Queue::ItemListParams::SortDirection::OrSymbol - ) - ) - end - attr_reader :sort_direction - - sig do - params( - sort_direction: - ModerationAPI::Queue::ItemListParams::SortDirection::OrSymbol - ).void - end - attr_writer :sort_direction - - sig do - returns( - T.nilable(ModerationAPI::Queue::ItemListParams::SortField::OrSymbol) - ) - end - attr_reader :sort_field - - sig do - params( - sort_field: - ModerationAPI::Queue::ItemListParams::SortField::OrSymbol - ).void - end - attr_writer :sort_field - - sig do - params( - id: String, - after_date: String, - author_id: String, - before_date: String, - conversation_ids: String, - filtered_action_ids: String, - include_resolved: String, - labels: String, - page_number: Float, - page_size: Float, - sort_direction: - ModerationAPI::Queue::ItemListParams::SortDirection::OrSymbol, - sort_field: - ModerationAPI::Queue::ItemListParams::SortField::OrSymbol, - request_options: ModerationAPI::RequestOptions::OrHash - ).returns(T.attached_class) - end - def self.new( - # The queue ID - id:, - after_date: nil, - author_id: nil, - before_date: nil, - conversation_ids: nil, - filtered_action_ids: nil, - include_resolved: nil, - labels: nil, - # Page number to fetch - page_number: nil, - # Number of items per page - page_size: nil, - # Sort direction - sort_direction: nil, - sort_field: nil, - request_options: {} - ) - end - - sig do - override.returns( - { - id: String, - after_date: String, - author_id: String, - before_date: String, - conversation_ids: String, - filtered_action_ids: String, - include_resolved: String, - labels: String, - page_number: Float, - page_size: Float, - sort_direction: - ModerationAPI::Queue::ItemListParams::SortDirection::OrSymbol, - sort_field: - ModerationAPI::Queue::ItemListParams::SortField::OrSymbol, - request_options: ModerationAPI::RequestOptions - } - ) - end - def to_hash - end - - # Sort direction - module SortDirection - extend ModerationAPI::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all(Symbol, ModerationAPI::Queue::ItemListParams::SortDirection) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - ASC = - T.let( - :asc, - ModerationAPI::Queue::ItemListParams::SortDirection::TaggedSymbol - ) - DESC = - T.let( - :desc, - ModerationAPI::Queue::ItemListParams::SortDirection::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - ModerationAPI::Queue::ItemListParams::SortDirection::TaggedSymbol - ] - ) - end - def self.values - end - end - - module SortField - extend ModerationAPI::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all(Symbol, ModerationAPI::Queue::ItemListParams::SortField) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - CREATED_AT = - T.let( - :createdAt, - ModerationAPI::Queue::ItemListParams::SortField::TaggedSymbol - ) - SEVERITY = - T.let( - :severity, - ModerationAPI::Queue::ItemListParams::SortField::TaggedSymbol - ) - REVIEWED_AT = - T.let( - :reviewedAt, - ModerationAPI::Queue::ItemListParams::SortField::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - ModerationAPI::Queue::ItemListParams::SortField::TaggedSymbol - ] - ) - end - def self.values - end - end - end - end - end -end diff --git a/rbi/moderation_api/models/queue/item_list_response.rbi b/rbi/moderation_api/models/queue/item_list_response.rbi deleted file mode 100644 index 8ee05e45..00000000 --- a/rbi/moderation_api/models/queue/item_list_response.rbi +++ /dev/null @@ -1,440 +0,0 @@ -# typed: strong - -module ModerationAPI - module Models - module Queue - class ItemListResponse < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::Models::Queue::ItemListResponse, - ModerationAPI::Internal::AnyHash - ) - end - - sig do - returns( - T::Array[ModerationAPI::Models::Queue::ItemListResponse::Item] - ) - end - attr_accessor :items - - sig do - returns(ModerationAPI::Models::Queue::ItemListResponse::Pagination) - end - attr_reader :pagination - - sig do - params( - pagination: - ModerationAPI::Models::Queue::ItemListResponse::Pagination::OrHash - ).void - end - attr_writer :pagination - - sig do - params( - items: - T::Array[ - ModerationAPI::Models::Queue::ItemListResponse::Item::OrHash - ], - pagination: - ModerationAPI::Models::Queue::ItemListResponse::Pagination::OrHash - ).returns(T.attached_class) - end - def self.new(items:, pagination:) - end - - sig do - override.returns( - { - items: - T::Array[ModerationAPI::Models::Queue::ItemListResponse::Item], - pagination: - ModerationAPI::Models::Queue::ItemListResponse::Pagination - } - ) - end - def to_hash - end - - class Item < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::Models::Queue::ItemListResponse::Item, - ModerationAPI::Internal::AnyHash - ) - end - - # Content ID - sig { returns(String) } - attr_accessor :id - - # The content to be moderated - sig { returns(String) } - attr_accessor :content - - # Whether the item is flagged by any label - sig { returns(T::Boolean) } - attr_accessor :flagged - - sig do - returns( - T::Array[ - ModerationAPI::Models::Queue::ItemListResponse::Item::Label - ] - ) - end - attr_accessor :labels - - # Status of the item - sig do - returns( - ModerationAPI::Models::Queue::ItemListResponse::Item::Status::TaggedSymbol - ) - end - attr_accessor :status - - # Unix timestamp of when the item was created - sig { returns(Float) } - attr_accessor :timestamp - - # Action IDs taken on this item - sig do - returns( - T.nilable( - T::Array[ - ModerationAPI::Models::Queue::ItemListResponse::Item::Action - ] - ) - ) - end - attr_reader :actions - - sig do - params( - actions: - T::Array[ - ModerationAPI::Models::Queue::ItemListResponse::Item::Action::OrHash - ] - ).void - end - attr_writer :actions - - # Author ID - sig { returns(T.nilable(String)) } - attr_reader :author_id - - sig { params(author_id: String).void } - attr_writer :author_id - - # Type of the content object - sig { returns(T.nilable(String)) } - attr_reader :content_type - - sig { params(content_type: String).void } - attr_writer :content_type - - # Conversation ID - sig { returns(T.nilable(String)) } - attr_reader :conversation_id - - sig { params(conversation_id: String).void } - attr_writer :conversation_id - - # Content language - sig { returns(T.nilable(String)) } - attr_reader :language - - sig { params(language: String).void } - attr_writer :language - - sig do - params( - id: String, - content: String, - flagged: T::Boolean, - labels: - T::Array[ - ModerationAPI::Models::Queue::ItemListResponse::Item::Label::OrHash - ], - status: - ModerationAPI::Models::Queue::ItemListResponse::Item::Status::OrSymbol, - timestamp: Float, - actions: - T::Array[ - ModerationAPI::Models::Queue::ItemListResponse::Item::Action::OrHash - ], - author_id: String, - content_type: String, - conversation_id: String, - language: String - ).returns(T.attached_class) - end - def self.new( - # Content ID - id:, - # The content to be moderated - content:, - # Whether the item is flagged by any label - flagged:, - labels:, - # Status of the item - status:, - # Unix timestamp of when the item was created - timestamp:, - # Action IDs taken on this item - actions: nil, - # Author ID - author_id: nil, - # Type of the content object - content_type: nil, - # Conversation ID - conversation_id: nil, - # Content language - language: nil - ) - end - - sig do - override.returns( - { - id: String, - content: String, - flagged: T::Boolean, - labels: - T::Array[ - ModerationAPI::Models::Queue::ItemListResponse::Item::Label - ], - status: - ModerationAPI::Models::Queue::ItemListResponse::Item::Status::TaggedSymbol, - timestamp: Float, - actions: - T::Array[ - ModerationAPI::Models::Queue::ItemListResponse::Item::Action - ], - author_id: String, - content_type: String, - conversation_id: String, - language: String - } - ) - end - def to_hash - end - - class Label < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::Models::Queue::ItemListResponse::Item::Label, - ModerationAPI::Internal::AnyHash - ) - end - - # Whether this label caused a flag - sig { returns(T::Boolean) } - attr_accessor :flagged - - # Label name - sig { returns(String) } - attr_accessor :label - - # Confidence score of the label - sig { returns(Float) } - attr_accessor :score - - sig do - params(flagged: T::Boolean, label: String, score: Float).returns( - T.attached_class - ) - end - def self.new( - # Whether this label caused a flag - flagged:, - # Label name - label:, - # Confidence score of the label - score: - ) - end - - sig do - override.returns( - { flagged: T::Boolean, label: String, score: Float } - ) - end - def to_hash - end - end - - # Status of the item - module Status - extend ModerationAPI::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all( - Symbol, - ModerationAPI::Models::Queue::ItemListResponse::Item::Status - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - PENDING = - T.let( - :pending, - ModerationAPI::Models::Queue::ItemListResponse::Item::Status::TaggedSymbol - ) - RESOLVED = - T.let( - :resolved, - ModerationAPI::Models::Queue::ItemListResponse::Item::Status::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - ModerationAPI::Models::Queue::ItemListResponse::Item::Status::TaggedSymbol - ] - ) - end - def self.values - end - end - - class Action < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::Models::Queue::ItemListResponse::Item::Action, - ModerationAPI::Internal::AnyHash - ) - end - - # Action ID - sig { returns(String) } - attr_accessor :id - - # Action name - sig { returns(String) } - attr_accessor :name - - # Unix timestamp of when the action was taken - sig { returns(Float) } - attr_accessor :timestamp - - # Action comment - sig { returns(T.nilable(String)) } - attr_reader :comment - - sig { params(comment: String).void } - attr_writer :comment - - # Moderator userID - sig { returns(T.nilable(String)) } - attr_reader :reviewer - - sig { params(reviewer: String).void } - attr_writer :reviewer - - sig do - params( - id: String, - name: String, - timestamp: Float, - comment: String, - reviewer: String - ).returns(T.attached_class) - end - def self.new( - # Action ID - id:, - # Action name - name:, - # Unix timestamp of when the action was taken - timestamp:, - # Action comment - comment: nil, - # Moderator userID - reviewer: nil - ) - end - - sig do - override.returns( - { - id: String, - name: String, - timestamp: Float, - comment: String, - reviewer: String - } - ) - end - def to_hash - end - end - end - - class Pagination < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::Models::Queue::ItemListResponse::Pagination, - ModerationAPI::Internal::AnyHash - ) - end - - sig { returns(Float) } - attr_accessor :current_page - - sig { returns(T::Boolean) } - attr_accessor :has_next_page - - sig { returns(T::Boolean) } - attr_accessor :has_previous_page - - sig { returns(Float) } - attr_accessor :total_items - - sig { returns(Float) } - attr_accessor :total_pages - - sig do - params( - current_page: Float, - has_next_page: T::Boolean, - has_previous_page: T::Boolean, - total_items: Float, - total_pages: Float - ).returns(T.attached_class) - end - def self.new( - current_page:, - has_next_page:, - has_previous_page:, - total_items:, - total_pages: - ) - end - - sig do - override.returns( - { - current_page: Float, - has_next_page: T::Boolean, - has_previous_page: T::Boolean, - total_items: Float, - total_pages: Float - } - ) - end - def to_hash - end - end - end - end - end -end diff --git a/rbi/moderation_api/models/queue/item_resolve_params.rbi b/rbi/moderation_api/models/queue/item_resolve_params.rbi deleted file mode 100644 index 254907b7..00000000 --- a/rbi/moderation_api/models/queue/item_resolve_params.rbi +++ /dev/null @@ -1,67 +0,0 @@ -# typed: strong - -module ModerationAPI - module Models - module Queue - class ItemResolveParams < ModerationAPI::Internal::Type::BaseModel - extend ModerationAPI::Internal::Type::RequestParameters::Converter - include ModerationAPI::Internal::Type::RequestParameters - - OrHash = - T.type_alias do - T.any( - ModerationAPI::Queue::ItemResolveParams, - ModerationAPI::Internal::AnyHash - ) - end - - # The queue ID - sig { returns(String) } - attr_accessor :id - - # The item ID to resolve - sig { returns(String) } - attr_accessor :item_id - - # Optional comment - sig { returns(T.nilable(String)) } - attr_reader :comment - - sig { params(comment: String).void } - attr_writer :comment - - sig do - params( - id: String, - item_id: String, - comment: String, - request_options: ModerationAPI::RequestOptions::OrHash - ).returns(T.attached_class) - end - def self.new( - # The queue ID - id:, - # The item ID to resolve - item_id:, - # Optional comment - comment: nil, - request_options: {} - ) - end - - sig do - override.returns( - { - id: String, - item_id: String, - comment: String, - request_options: ModerationAPI::RequestOptions - } - ) - end - def to_hash - end - end - end - end -end diff --git a/rbi/moderation_api/models/queue/item_resolve_response.rbi b/rbi/moderation_api/models/queue/item_resolve_response.rbi deleted file mode 100644 index 03afb8d4..00000000 --- a/rbi/moderation_api/models/queue/item_resolve_response.rbi +++ /dev/null @@ -1,55 +0,0 @@ -# typed: strong - -module ModerationAPI - module Models - module Queue - class ItemResolveResponse < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::Models::Queue::ItemResolveResponse, - ModerationAPI::Internal::AnyHash - ) - end - - # Timestamp when the item was resolved - sig { returns(String) } - attr_accessor :resolved_at - - sig { returns(T::Boolean) } - attr_accessor :success - - # Optional comment - sig { returns(T.nilable(String)) } - attr_reader :comment - - sig { params(comment: String).void } - attr_writer :comment - - sig do - params( - resolved_at: String, - success: T::Boolean, - comment: String - ).returns(T.attached_class) - end - def self.new( - # Timestamp when the item was resolved - resolved_at:, - success:, - # Optional comment - comment: nil - ) - end - - sig do - override.returns( - { resolved_at: String, success: T::Boolean, comment: String } - ) - end - def to_hash - end - end - end - end -end diff --git a/rbi/moderation_api/models/queue/item_unresolve_params.rbi b/rbi/moderation_api/models/queue/item_unresolve_params.rbi deleted file mode 100644 index ae567b1d..00000000 --- a/rbi/moderation_api/models/queue/item_unresolve_params.rbi +++ /dev/null @@ -1,67 +0,0 @@ -# typed: strong - -module ModerationAPI - module Models - module Queue - class ItemUnresolveParams < ModerationAPI::Internal::Type::BaseModel - extend ModerationAPI::Internal::Type::RequestParameters::Converter - include ModerationAPI::Internal::Type::RequestParameters - - OrHash = - T.type_alias do - T.any( - ModerationAPI::Queue::ItemUnresolveParams, - ModerationAPI::Internal::AnyHash - ) - end - - # The queue ID - sig { returns(String) } - attr_accessor :id - - # The item ID to unresolve - sig { returns(String) } - attr_accessor :item_id - - # Optional reason for unresolving the item - sig { returns(T.nilable(String)) } - attr_reader :comment - - sig { params(comment: String).void } - attr_writer :comment - - sig do - params( - id: String, - item_id: String, - comment: String, - request_options: ModerationAPI::RequestOptions::OrHash - ).returns(T.attached_class) - end - def self.new( - # The queue ID - id:, - # The item ID to unresolve - item_id:, - # Optional reason for unresolving the item - comment: nil, - request_options: {} - ) - end - - sig do - override.returns( - { - id: String, - item_id: String, - comment: String, - request_options: ModerationAPI::RequestOptions - } - ) - end - def to_hash - end - end - end - end -end diff --git a/rbi/moderation_api/models/queue/item_unresolve_response.rbi b/rbi/moderation_api/models/queue/item_unresolve_response.rbi deleted file mode 100644 index f78a0f22..00000000 --- a/rbi/moderation_api/models/queue/item_unresolve_response.rbi +++ /dev/null @@ -1,52 +0,0 @@ -# typed: strong - -module ModerationAPI - module Models - module Queue - class ItemUnresolveResponse < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::Models::Queue::ItemUnresolveResponse, - ModerationAPI::Internal::AnyHash - ) - end - - # New status of the item - sig { returns(String) } - attr_accessor :status - - sig { returns(T::Boolean) } - attr_accessor :success - - # Timestamp when the item was unresolved - sig { returns(String) } - attr_accessor :unresolved_at - - sig do - params( - status: String, - success: T::Boolean, - unresolved_at: String - ).returns(T.attached_class) - end - def self.new( - # New status of the item - status:, - success:, - # Timestamp when the item was unresolved - unresolved_at: - ) - end - - sig do - override.returns( - { status: String, success: T::Boolean, unresolved_at: String } - ) - end - def to_hash - end - end - end - end -end diff --git a/rbi/moderation_api/models/queue_get_stats_params.rbi b/rbi/moderation_api/models/queue_get_stats_params.rbi deleted file mode 100644 index 70f6ed1d..00000000 --- a/rbi/moderation_api/models/queue_get_stats_params.rbi +++ /dev/null @@ -1,57 +0,0 @@ -# typed: strong - -module ModerationAPI - module Models - class QueueGetStatsParams < ModerationAPI::Internal::Type::BaseModel - extend ModerationAPI::Internal::Type::RequestParameters::Converter - include ModerationAPI::Internal::Type::RequestParameters - - OrHash = - T.type_alias do - T.any( - ModerationAPI::QueueGetStatsParams, - ModerationAPI::Internal::AnyHash - ) - end - - # The queue ID - sig { returns(String) } - attr_accessor :id - - # Number of days to analyze statistics for - sig { returns(T.nilable(String)) } - attr_reader :within_days - - sig { params(within_days: String).void } - attr_writer :within_days - - sig do - params( - id: String, - within_days: String, - request_options: ModerationAPI::RequestOptions::OrHash - ).returns(T.attached_class) - end - def self.new( - # The queue ID - id:, - # Number of days to analyze statistics for - within_days: nil, - request_options: {} - ) - end - - sig do - override.returns( - { - id: String, - within_days: String, - request_options: ModerationAPI::RequestOptions - } - ) - end - def to_hash - end - end - end -end diff --git a/rbi/moderation_api/models/queue_get_stats_response.rbi b/rbi/moderation_api/models/queue_get_stats_response.rbi deleted file mode 100644 index 633ff22e..00000000 --- a/rbi/moderation_api/models/queue_get_stats_response.rbi +++ /dev/null @@ -1,466 +0,0 @@ -# typed: strong - -module ModerationAPI - module Models - class QueueGetStatsResponse < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::Models::QueueGetStatsResponse, - ModerationAPI::Internal::AnyHash - ) - end - - sig do - returns( - T::Array[ModerationAPI::Models::QueueGetStatsResponse::ActionStat] - ) - end - attr_accessor :action_stats - - sig { returns(ModerationAPI::Models::QueueGetStatsResponse::ReviewStats) } - attr_reader :review_stats - - sig do - params( - review_stats: - ModerationAPI::Models::QueueGetStatsResponse::ReviewStats::OrHash - ).void - end - attr_writer :review_stats - - # List of top reviewers and their statistics - sig do - returns( - T::Array[ModerationAPI::Models::QueueGetStatsResponse::TopReviewer] - ) - end - attr_accessor :top_reviewers - - sig { returns(ModerationAPI::Models::QueueGetStatsResponse::Trends) } - attr_reader :trends - - sig do - params( - trends: ModerationAPI::Models::QueueGetStatsResponse::Trends::OrHash - ).void - end - attr_writer :trends - - sig do - params( - action_stats: - T::Array[ - ModerationAPI::Models::QueueGetStatsResponse::ActionStat::OrHash - ], - review_stats: - ModerationAPI::Models::QueueGetStatsResponse::ReviewStats::OrHash, - top_reviewers: - T::Array[ - ModerationAPI::Models::QueueGetStatsResponse::TopReviewer::OrHash - ], - trends: ModerationAPI::Models::QueueGetStatsResponse::Trends::OrHash - ).returns(T.attached_class) - end - def self.new( - action_stats:, - review_stats:, - # List of top reviewers and their statistics - top_reviewers:, - trends: - ) - end - - sig do - override.returns( - { - action_stats: - T::Array[ - ModerationAPI::Models::QueueGetStatsResponse::ActionStat - ], - review_stats: - ModerationAPI::Models::QueueGetStatsResponse::ReviewStats, - top_reviewers: - T::Array[ - ModerationAPI::Models::QueueGetStatsResponse::TopReviewer - ], - trends: ModerationAPI::Models::QueueGetStatsResponse::Trends - } - ) - end - def to_hash - end - - class ActionStat < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::Models::QueueGetStatsResponse::ActionStat, - ModerationAPI::Internal::AnyHash - ) - end - - # ID of the moderation action - sig { returns(String) } - attr_accessor :action_id - - # Name of the moderation action - sig { returns(String) } - attr_accessor :action_name - - # Number of times this action was taken - sig { returns(Float) } - attr_accessor :count - - # Percentage this action represents of all actions - sig { returns(Float) } - attr_accessor :percentage_of_total - - sig do - params( - action_id: String, - action_name: String, - count: Float, - percentage_of_total: Float - ).returns(T.attached_class) - end - def self.new( - # ID of the moderation action - action_id:, - # Name of the moderation action - action_name:, - # Number of times this action was taken - count:, - # Percentage this action represents of all actions - percentage_of_total: - ) - end - - sig do - override.returns( - { - action_id: String, - action_name: String, - count: Float, - percentage_of_total: Float - } - ) - end - def to_hash - end - end - - class ReviewStats < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::Models::QueueGetStatsResponse::ReviewStats, - ModerationAPI::Internal::AnyHash - ) - end - - # Average time in milliseconds to review an item - sig { returns(Float) } - attr_accessor :average_time_to_review - - # Total number of items pending review - sig { returns(Float) } - attr_accessor :total_pending - - # Total number of items reviewed - sig { returns(Float) } - attr_accessor :total_reviewed - - sig do - params( - average_time_to_review: Float, - total_pending: Float, - total_reviewed: Float - ).returns(T.attached_class) - end - def self.new( - # Average time in milliseconds to review an item - average_time_to_review:, - # Total number of items pending review - total_pending:, - # Total number of items reviewed - total_reviewed: - ) - end - - sig do - override.returns( - { - average_time_to_review: Float, - total_pending: Float, - total_reviewed: Float - } - ) - end - def to_hash - end - end - - class TopReviewer < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::Models::QueueGetStatsResponse::TopReviewer, - ModerationAPI::Internal::AnyHash - ) - end - - # Average review time in milliseconds - sig { returns(Float) } - attr_accessor :average_time_per_review - - # Name of the reviewer - sig { returns(String) } - attr_accessor :name - - # Number of items reviewed - sig { returns(Float) } - attr_accessor :review_count - - # Most common actions taken by this reviewer - sig do - returns( - T::Array[ - ModerationAPI::Models::QueueGetStatsResponse::TopReviewer::TopAction - ] - ) - end - attr_accessor :top_actions - - # ID of the reviewer - sig { returns(String) } - attr_accessor :user_id - - # Optional accuracy score based on review quality metrics - sig { returns(T.nilable(Float)) } - attr_reader :accuracy_score - - sig { params(accuracy_score: Float).void } - attr_writer :accuracy_score - - sig do - params( - average_time_per_review: Float, - name: String, - review_count: Float, - top_actions: - T::Array[ - ModerationAPI::Models::QueueGetStatsResponse::TopReviewer::TopAction::OrHash - ], - user_id: String, - accuracy_score: Float - ).returns(T.attached_class) - end - def self.new( - # Average review time in milliseconds - average_time_per_review:, - # Name of the reviewer - name:, - # Number of items reviewed - review_count:, - # Most common actions taken by this reviewer - top_actions:, - # ID of the reviewer - user_id:, - # Optional accuracy score based on review quality metrics - accuracy_score: nil - ) - end - - sig do - override.returns( - { - average_time_per_review: Float, - name: String, - review_count: Float, - top_actions: - T::Array[ - ModerationAPI::Models::QueueGetStatsResponse::TopReviewer::TopAction - ], - user_id: String, - accuracy_score: Float - } - ) - end - def to_hash - end - - class TopAction < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::Models::QueueGetStatsResponse::TopReviewer::TopAction, - ModerationAPI::Internal::AnyHash - ) - end - - # Most used action by this reviewer - sig { returns(String) } - attr_accessor :action_id - - # Name of the most used action - sig { returns(String) } - attr_accessor :action_name - - # Number of times this action was used - sig { returns(Float) } - attr_accessor :count - - sig do - params( - action_id: String, - action_name: String, - count: Float - ).returns(T.attached_class) - end - def self.new( - # Most used action by this reviewer - action_id:, - # Name of the most used action - action_name:, - # Number of times this action was used - count: - ) - end - - sig do - override.returns( - { action_id: String, action_name: String, count: Float } - ) - end - def to_hash - end - end - end - - class Trends < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::Models::QueueGetStatsResponse::Trends, - ModerationAPI::Internal::AnyHash - ) - end - - sig do - returns( - T::Array[ - ModerationAPI::Models::QueueGetStatsResponse::Trends::DailyReviewCount - ] - ) - end - attr_accessor :daily_review_counts - - sig do - returns( - T::Array[ - ModerationAPI::Models::QueueGetStatsResponse::Trends::FlaggedContentTrend - ] - ) - end - attr_accessor :flagged_content_trends - - sig do - params( - daily_review_counts: - T::Array[ - ModerationAPI::Models::QueueGetStatsResponse::Trends::DailyReviewCount::OrHash - ], - flagged_content_trends: - T::Array[ - ModerationAPI::Models::QueueGetStatsResponse::Trends::FlaggedContentTrend::OrHash - ] - ).returns(T.attached_class) - end - def self.new(daily_review_counts:, flagged_content_trends:) - end - - sig do - override.returns( - { - daily_review_counts: - T::Array[ - ModerationAPI::Models::QueueGetStatsResponse::Trends::DailyReviewCount - ], - flagged_content_trends: - T::Array[ - ModerationAPI::Models::QueueGetStatsResponse::Trends::FlaggedContentTrend - ] - } - ) - end - def to_hash - end - - class DailyReviewCount < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::Models::QueueGetStatsResponse::Trends::DailyReviewCount, - ModerationAPI::Internal::AnyHash - ) - end - - # Number of reviews on this date - sig { returns(Float) } - attr_accessor :count - - # Date in YYYY-MM-DD format - sig { returns(String) } - attr_accessor :date - - sig { params(count: Float, date: String).returns(T.attached_class) } - def self.new( - # Number of reviews on this date - count:, - # Date in YYYY-MM-DD format - date: - ) - end - - sig { override.returns({ count: Float, date: String }) } - def to_hash - end - end - - class FlaggedContentTrend < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::Models::QueueGetStatsResponse::Trends::FlaggedContentTrend, - ModerationAPI::Internal::AnyHash - ) - end - - # Content flag/label - sig { returns(String) } - attr_accessor :label - - # Trend indicator (-1 to 1) showing if this type of flagged content is increasing - # or decreasing - sig { returns(Float) } - attr_accessor :trend - - sig { params(label: String, trend: Float).returns(T.attached_class) } - def self.new( - # Content flag/label - label:, - # Trend indicator (-1 to 1) showing if this type of flagged content is increasing - # or decreasing - trend: - ) - end - - sig { override.returns({ label: String, trend: Float }) } - def to_hash - end - end - end - end - end -end diff --git a/rbi/moderation_api/models/queue_retrieve_params.rbi b/rbi/moderation_api/models/queue_retrieve_params.rbi deleted file mode 100644 index 191a21fd..00000000 --- a/rbi/moderation_api/models/queue_retrieve_params.rbi +++ /dev/null @@ -1,43 +0,0 @@ -# typed: strong - -module ModerationAPI - module Models - class QueueRetrieveParams < ModerationAPI::Internal::Type::BaseModel - extend ModerationAPI::Internal::Type::RequestParameters::Converter - include ModerationAPI::Internal::Type::RequestParameters - - OrHash = - T.type_alias do - T.any( - ModerationAPI::QueueRetrieveParams, - ModerationAPI::Internal::AnyHash - ) - end - - # The queue ID - sig { returns(String) } - attr_accessor :id - - sig do - params( - id: String, - request_options: ModerationAPI::RequestOptions::OrHash - ).returns(T.attached_class) - end - def self.new( - # The queue ID - id:, - request_options: {} - ) - end - - sig do - override.returns( - { id: String, request_options: ModerationAPI::RequestOptions } - ) - end - def to_hash - end - end - end -end diff --git a/rbi/moderation_api/models/queue_retrieve_response.rbi b/rbi/moderation_api/models/queue_retrieve_response.rbi deleted file mode 100644 index 175b17bb..00000000 --- a/rbi/moderation_api/models/queue_retrieve_response.rbi +++ /dev/null @@ -1,1037 +0,0 @@ -# typed: strong - -module ModerationAPI - module Models - class QueueRetrieveResponse < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::Models::QueueRetrieveResponse, - ModerationAPI::Internal::AnyHash - ) - end - - sig { returns(ModerationAPI::Models::QueueRetrieveResponse::Queue) } - attr_reader :queue - - sig do - params( - queue: ModerationAPI::Models::QueueRetrieveResponse::Queue::OrHash - ).void - end - attr_writer :queue - - sig do - params( - queue: ModerationAPI::Models::QueueRetrieveResponse::Queue::OrHash - ).returns(T.attached_class) - end - def self.new(queue:) - end - - sig do - override.returns( - { queue: ModerationAPI::Models::QueueRetrieveResponse::Queue } - ) - end - def to_hash - end - - class Queue < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::Models::QueueRetrieveResponse::Queue, - ModerationAPI::Internal::AnyHash - ) - end - - sig { returns(String) } - attr_accessor :id - - sig { returns(String) } - attr_accessor :description - - sig do - returns(ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter) - end - attr_reader :filter - - sig do - params( - filter: - ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::OrHash - ).void - end - attr_writer :filter - - sig { returns(String) } - attr_accessor :name - - sig { returns(Float) } - attr_accessor :resolved_items_count - - sig { returns(Float) } - attr_accessor :total_items_count - - sig { returns(Float) } - attr_accessor :unresolved_items_count - - sig do - params( - id: String, - description: String, - filter: - ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::OrHash, - name: String, - resolved_items_count: Float, - total_items_count: Float, - unresolved_items_count: Float - ).returns(T.attached_class) - end - def self.new( - id:, - description:, - filter:, - name:, - resolved_items_count:, - total_items_count:, - unresolved_items_count: - ) - end - - sig do - override.returns( - { - id: String, - description: String, - filter: - ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter, - name: String, - resolved_items_count: Float, - total_items_count: Float, - unresolved_items_count: Float - } - ) - end - def to_hash - end - - class Filter < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter, - ModerationAPI::Internal::AnyHash - ) - end - - sig { returns(T.nilable(String)) } - attr_reader :after_date - - sig { params(after_date: String).void } - attr_writer :after_date - - sig { returns(T.nilable(String)) } - attr_reader :author_id - - sig { params(author_id: String).void } - attr_writer :author_id - - sig { returns(T.nilable(T::Array[Integer])) } - attr_reader :author_trust_levels - - sig { params(author_trust_levels: T::Array[Integer]).void } - attr_writer :author_trust_levels - - sig { returns(T.nilable(String)) } - attr_reader :before_date - - sig { params(before_date: String).void } - attr_writer :before_date - - sig do - returns( - T.nilable( - ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::CasebookAgreement::TaggedSymbol - ) - ) - end - attr_reader :casebook_agreement - - sig do - params( - casebook_agreement: - ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::CasebookAgreement::OrSymbol - ).void - end - attr_writer :casebook_agreement - - sig do - returns( - T.nilable( - ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::CasebookAnswer::TaggedSymbol - ) - ) - end - attr_reader :casebook_answer - - sig do - params( - casebook_answer: - ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::CasebookAnswer::OrSymbol - ).void - end - attr_writer :casebook_answer - - sig do - returns( - T.nilable( - ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::CheckStatus::TaggedSymbol - ) - ) - end - attr_accessor :check_status - - sig { returns(T.nilable(T::Boolean)) } - attr_reader :clear_date_window - - sig { params(clear_date_window: T::Boolean).void } - attr_writer :clear_date_window - - sig { returns(T.nilable(String)) } - attr_reader :content_id - - sig { params(content_id: String).void } - attr_writer :content_id - - sig do - returns( - T.nilable( - T::Array[ - ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::ContentType::TaggedSymbol - ] - ) - ) - end - attr_reader :content_types - - sig do - params( - content_types: - T::Array[ - ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::ContentType::OrSymbol - ] - ).void - end - attr_writer :content_types - - sig { returns(T.nilable(T::Array[T.nilable(String)])) } - attr_reader :conversation_ids - - sig { params(conversation_ids: T::Array[T.nilable(String)]).void } - attr_writer :conversation_ids - - sig { returns(T.nilable(T::Array[String])) } - attr_reader :filtered_action_ids - - sig { params(filtered_action_ids: T::Array[String]).void } - attr_writer :filtered_action_ids - - sig { returns(T.nilable(T::Array[String])) } - attr_reader :filtered_channel_ids - - sig { params(filtered_channel_ids: T::Array[String]).void } - attr_writer :filtered_channel_ids - - sig do - returns( - T.nilable( - T::Array[ - ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::FilterLabel - ] - ) - ) - end - attr_reader :filter_labels - - sig do - params( - filter_labels: - T::Array[ - ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::FilterLabel::OrHash - ] - ).void - end - attr_writer :filter_labels - - sig do - returns( - T.nilable( - ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::IsFlagged::TaggedSymbol - ) - ) - end - attr_reader :is_flagged - - sig do - params( - is_flagged: - ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::IsFlagged::OrSymbol - ).void - end - attr_writer :is_flagged - - sig { returns(T.nilable(T::Array[String])) } - attr_reader :labels - - sig { params(labels: T::Array[String]).void } - attr_writer :labels - - sig { returns(T.nilable(T::Array[String])) } - attr_reader :languages - - sig { params(languages: T::Array[String]).void } - attr_writer :languages - - sig { returns(T.nilable(Integer)) } - attr_reader :max_severity - - sig { params(max_severity: Integer).void } - attr_writer :max_severity - - sig do - returns( - T.nilable( - T::Array[ - ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::MediaType::TaggedSymbol - ] - ) - ) - end - attr_reader :media_types - - sig do - params( - media_types: - T::Array[ - ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::MediaType::OrSymbol - ] - ).void - end - attr_writer :media_types - - sig do - returns( - T.nilable( - T::Array[ - ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::MetadataFilter - ] - ) - ) - end - attr_reader :metadata_filters - - sig do - params( - metadata_filters: - T::Array[ - ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::MetadataFilter::OrHash - ] - ).void - end - attr_writer :metadata_filters - - sig { returns(T.nilable(Integer)) } - attr_reader :min_severity - - sig { params(min_severity: Integer).void } - attr_writer :min_severity - - sig do - returns( - T.nilable( - T::Array[ - ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::RecommendationAction::TaggedSymbol - ] - ) - ) - end - attr_reader :recommendation_actions - - sig do - params( - recommendation_actions: - T::Array[ - ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::RecommendationAction::OrSymbol - ] - ).void - end - attr_writer :recommendation_actions - - sig { returns(T.nilable(T::Array[String])) } - attr_reader :search - - sig { params(search: T::Array[String]).void } - attr_writer :search - - sig { returns(T.nilable(Float)) } - attr_reader :within - - sig { params(within: Float).void } - attr_writer :within - - sig do - returns( - T.nilable( - ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::WithinUnit::TaggedSymbol - ) - ) - end - attr_reader :within_unit - - sig do - params( - within_unit: - ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::WithinUnit::OrSymbol - ).void - end - attr_writer :within_unit - - sig do - params( - after_date: String, - author_id: String, - author_trust_levels: T::Array[Integer], - before_date: String, - casebook_agreement: - ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::CasebookAgreement::OrSymbol, - casebook_answer: - ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::CasebookAnswer::OrSymbol, - check_status: - T.nilable( - ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::CheckStatus::OrSymbol - ), - clear_date_window: T::Boolean, - content_id: String, - content_types: - T::Array[ - ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::ContentType::OrSymbol - ], - conversation_ids: T::Array[T.nilable(String)], - filtered_action_ids: T::Array[String], - filtered_channel_ids: T::Array[String], - filter_labels: - T::Array[ - ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::FilterLabel::OrHash - ], - is_flagged: - ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::IsFlagged::OrSymbol, - labels: T::Array[String], - languages: T::Array[String], - max_severity: Integer, - media_types: - T::Array[ - ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::MediaType::OrSymbol - ], - metadata_filters: - T::Array[ - ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::MetadataFilter::OrHash - ], - min_severity: Integer, - recommendation_actions: - T::Array[ - ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::RecommendationAction::OrSymbol - ], - search: T::Array[String], - within: Float, - within_unit: - ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::WithinUnit::OrSymbol - ).returns(T.attached_class) - end - def self.new( - after_date: nil, - author_id: nil, - author_trust_levels: nil, - before_date: nil, - casebook_agreement: nil, - casebook_answer: nil, - check_status: nil, - clear_date_window: nil, - content_id: nil, - content_types: nil, - conversation_ids: nil, - filtered_action_ids: nil, - filtered_channel_ids: nil, - filter_labels: nil, - is_flagged: nil, - labels: nil, - languages: nil, - max_severity: nil, - media_types: nil, - metadata_filters: nil, - min_severity: nil, - recommendation_actions: nil, - search: nil, - within: nil, - within_unit: nil - ) - end - - sig do - override.returns( - { - after_date: String, - author_id: String, - author_trust_levels: T::Array[Integer], - before_date: String, - casebook_agreement: - ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::CasebookAgreement::TaggedSymbol, - casebook_answer: - ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::CasebookAnswer::TaggedSymbol, - check_status: - T.nilable( - ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::CheckStatus::TaggedSymbol - ), - clear_date_window: T::Boolean, - content_id: String, - content_types: - T::Array[ - ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::ContentType::TaggedSymbol - ], - conversation_ids: T::Array[T.nilable(String)], - filtered_action_ids: T::Array[String], - filtered_channel_ids: T::Array[String], - filter_labels: - T::Array[ - ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::FilterLabel - ], - is_flagged: - ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::IsFlagged::TaggedSymbol, - labels: T::Array[String], - languages: T::Array[String], - max_severity: Integer, - media_types: - T::Array[ - ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::MediaType::TaggedSymbol - ], - metadata_filters: - T::Array[ - ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::MetadataFilter - ], - min_severity: Integer, - recommendation_actions: - T::Array[ - ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::RecommendationAction::TaggedSymbol - ], - search: T::Array[String], - within: Float, - within_unit: - ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::WithinUnit::TaggedSymbol - } - ) - end - def to_hash - end - - module CasebookAgreement - extend ModerationAPI::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all( - Symbol, - ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::CasebookAgreement - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - ALL = - T.let( - :ALL, - ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::CasebookAgreement::TaggedSymbol - ) - OVERRULED = - T.let( - :OVERRULED, - ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::CasebookAgreement::TaggedSymbol - ) - AGREED = - T.let( - :AGREED, - ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::CasebookAgreement::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::CasebookAgreement::TaggedSymbol - ] - ) - end - def self.values - end - end - - module CasebookAnswer - extend ModerationAPI::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all( - Symbol, - ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::CasebookAnswer - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - ALL = - T.let( - :ALL, - ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::CasebookAnswer::TaggedSymbol - ) - ALLOWED = - T.let( - :ALLOWED, - ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::CasebookAnswer::TaggedSymbol - ) - REJECTED = - T.let( - :REJECTED, - ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::CasebookAnswer::TaggedSymbol - ) - NO_ANSWER = - T.let( - :NO_ANSWER, - ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::CasebookAnswer::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::CasebookAnswer::TaggedSymbol - ] - ) - end - def self.values - end - end - - module CheckStatus - extend ModerationAPI::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all( - Symbol, - ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::CheckStatus - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - ALL = - T.let( - :all, - ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::CheckStatus::TaggedSymbol - ) - CHECKED = - T.let( - :checked, - ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::CheckStatus::TaggedSymbol - ) - UNCHECKED = - T.let( - :unchecked, - ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::CheckStatus::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::CheckStatus::TaggedSymbol - ] - ) - end - def self.values - end - end - - module ContentType - extend ModerationAPI::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all( - Symbol, - ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::ContentType - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - PROFILE = - T.let( - :profile, - ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::ContentType::TaggedSymbol - ) - MESSAGE = - T.let( - :message, - ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::ContentType::TaggedSymbol - ) - POST = - T.let( - :post, - ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::ContentType::TaggedSymbol - ) - COMMENT = - T.let( - :comment, - ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::ContentType::TaggedSymbol - ) - EVENT = - T.let( - :event, - ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::ContentType::TaggedSymbol - ) - PRODUCT = - T.let( - :product, - ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::ContentType::TaggedSymbol - ) - REVIEW = - T.let( - :review, - ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::ContentType::TaggedSymbol - ) - VOICE = - T.let( - :voice, - ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::ContentType::TaggedSymbol - ) - OTHER = - T.let( - :other, - ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::ContentType::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::ContentType::TaggedSymbol - ] - ) - end - def self.values - end - end - - class FilterLabel < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::FilterLabel, - ModerationAPI::Internal::AnyHash - ) - end - - sig { returns(String) } - attr_accessor :label - - sig do - returns( - ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::FilterLabel::Type::TaggedSymbol - ) - end - attr_accessor :type - - sig { returns(T.nilable(Float)) } - attr_accessor :max_threshold - - sig { returns(T.nilable(Float)) } - attr_accessor :min_threshold - - sig do - params( - label: String, - type: - ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::FilterLabel::Type::OrSymbol, - max_threshold: T.nilable(Float), - min_threshold: T.nilable(Float) - ).returns(T.attached_class) - end - def self.new(label:, type:, max_threshold: nil, min_threshold: nil) - end - - sig do - override.returns( - { - label: String, - type: - ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::FilterLabel::Type::TaggedSymbol, - max_threshold: T.nilable(Float), - min_threshold: T.nilable(Float) - } - ) - end - def to_hash - end - - module Type - extend ModerationAPI::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all( - Symbol, - ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::FilterLabel::Type - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - FLAGGED = - T.let( - :FLAGGED, - ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::FilterLabel::Type::TaggedSymbol - ) - NOT_FLAGGED = - T.let( - :NOT_FLAGGED, - ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::FilterLabel::Type::TaggedSymbol - ) - THRESHOLDS = - T.let( - :THRESHOLDS, - ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::FilterLabel::Type::TaggedSymbol - ) - MATCHED = - T.let( - :MATCHED, - ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::FilterLabel::Type::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::FilterLabel::Type::TaggedSymbol - ] - ) - end - def self.values - end - end - end - - module IsFlagged - extend ModerationAPI::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all( - Symbol, - ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::IsFlagged - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - ALL = - T.let( - :ALL, - ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::IsFlagged::TaggedSymbol - ) - FLAGGED = - T.let( - :FLAGGED, - ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::IsFlagged::TaggedSymbol - ) - NOT_FLAGGED = - T.let( - :NOT_FLAGGED, - ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::IsFlagged::TaggedSymbol - ) - SHADOW_FLAGGED = - T.let( - :SHADOW_FLAGGED, - ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::IsFlagged::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::IsFlagged::TaggedSymbol - ] - ) - end - def self.values - end - end - - module MediaType - extend ModerationAPI::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all( - Symbol, - ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::MediaType - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - TEXT = - T.let( - :text, - ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::MediaType::TaggedSymbol - ) - IMAGE = - T.let( - :image, - ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::MediaType::TaggedSymbol - ) - VIDEO = - T.let( - :video, - ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::MediaType::TaggedSymbol - ) - OBJECT = - T.let( - :object, - ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::MediaType::TaggedSymbol - ) - AUDIO = - T.let( - :audio, - ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::MediaType::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::MediaType::TaggedSymbol - ] - ) - end - def self.values - end - end - - class MetadataFilter < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::MetadataFilter, - ModerationAPI::Internal::AnyHash - ) - end - - sig { returns(String) } - attr_accessor :key - - sig { returns(String) } - attr_accessor :value - - sig { params(key: String, value: String).returns(T.attached_class) } - def self.new(key:, value:) - end - - sig { override.returns({ key: String, value: String }) } - def to_hash - end - end - - module RecommendationAction - extend ModerationAPI::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all( - Symbol, - ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::RecommendationAction - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - REVIEW = - T.let( - :review, - ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::RecommendationAction::TaggedSymbol - ) - ALLOW = - T.let( - :allow, - ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::RecommendationAction::TaggedSymbol - ) - REJECT = - T.let( - :reject, - ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::RecommendationAction::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::RecommendationAction::TaggedSymbol - ] - ) - end - def self.values - end - end - - module WithinUnit - extend ModerationAPI::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all( - Symbol, - ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::WithinUnit - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - MINUTES = - T.let( - :MINUTES, - ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::WithinUnit::TaggedSymbol - ) - HOURS = - T.let( - :HOURS, - ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::WithinUnit::TaggedSymbol - ) - DAYS = - T.let( - :DAYS, - ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::WithinUnit::TaggedSymbol - ) - WEEKS = - T.let( - :WEEKS, - ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::WithinUnit::TaggedSymbol - ) - MONTHS = - T.let( - :MONTHS, - ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::WithinUnit::TaggedSymbol - ) - YEARS = - T.let( - :YEARS, - ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::WithinUnit::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::WithinUnit::TaggedSymbol - ] - ) - end - def self.values - end - end - end - end - end - end -end diff --git a/rbi/moderation_api/models/webhook_create_params.rbi b/rbi/moderation_api/models/webhook_create_params.rbi deleted file mode 100644 index 4984ef6f..00000000 --- a/rbi/moderation_api/models/webhook_create_params.rbi +++ /dev/null @@ -1,154 +0,0 @@ -# typed: strong - -module ModerationAPI - module Models - class WebhookCreateParams < ModerationAPI::Internal::Type::BaseModel - extend ModerationAPI::Internal::Type::RequestParameters::Converter - include ModerationAPI::Internal::Type::RequestParameters - - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookCreateParams, - ModerationAPI::Internal::AnyHash - ) - end - - # Event types this webhook subscribes to. One webhook URL receives all events you - # list here. - sig do - returns( - T::Array[ModerationAPI::WebhookCreateParams::EventType::OrSymbol] - ) - end - attr_accessor :event_types - - # The webhook's name, used to identify it in the dashboard - sig { returns(String) } - attr_accessor :name - - # The webhook's URL. We'll call this URL when an event occurs. - sig { returns(String) } - attr_accessor :url - - # The webhook's description - sig { returns(T.nilable(String)) } - attr_accessor :description - - sig do - params( - event_types: - T::Array[ModerationAPI::WebhookCreateParams::EventType::OrSymbol], - name: String, - url: String, - description: T.nilable(String), - request_options: ModerationAPI::RequestOptions::OrHash - ).returns(T.attached_class) - end - def self.new( - # Event types this webhook subscribes to. One webhook URL receives all events you - # list here. - event_types:, - # The webhook's name, used to identify it in the dashboard - name:, - # The webhook's URL. We'll call this URL when an event occurs. - url:, - # The webhook's description - description: nil, - request_options: {} - ) - end - - sig do - override.returns( - { - event_types: - T::Array[ModerationAPI::WebhookCreateParams::EventType::OrSymbol], - name: String, - url: String, - description: T.nilable(String), - request_options: ModerationAPI::RequestOptions - } - ) - end - def to_hash - end - - module EventType - extend ModerationAPI::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all(Symbol, ModerationAPI::WebhookCreateParams::EventType) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - QUEUE_ITEM_NEW = - T.let( - :QUEUE_ITEM_NEW, - ModerationAPI::WebhookCreateParams::EventType::TaggedSymbol - ) - QUEUE_ITEM_COMPLETED = - T.let( - :QUEUE_ITEM_COMPLETED, - ModerationAPI::WebhookCreateParams::EventType::TaggedSymbol - ) - QUEUE_ITEM_ACTION = - T.let( - :QUEUE_ITEM_ACTION, - ModerationAPI::WebhookCreateParams::EventType::TaggedSymbol - ) - QUEUE_ITEM_REJECTED = - T.let( - :QUEUE_ITEM_REJECTED, - ModerationAPI::WebhookCreateParams::EventType::TaggedSymbol - ) - QUEUE_ITEM_ALLOWED = - T.let( - :QUEUE_ITEM_ALLOWED, - ModerationAPI::WebhookCreateParams::EventType::TaggedSymbol - ) - AUTHOR_BLOCKED = - T.let( - :AUTHOR_BLOCKED, - ModerationAPI::WebhookCreateParams::EventType::TaggedSymbol - ) - AUTHOR_UNBLOCKED = - T.let( - :AUTHOR_UNBLOCKED, - ModerationAPI::WebhookCreateParams::EventType::TaggedSymbol - ) - AUTHOR_SUSPENDED = - T.let( - :AUTHOR_SUSPENDED, - ModerationAPI::WebhookCreateParams::EventType::TaggedSymbol - ) - AUTHOR_UPDATED = - T.let( - :AUTHOR_UPDATED, - ModerationAPI::WebhookCreateParams::EventType::TaggedSymbol - ) - AUTHOR_TRUST_LEVEL_CHANGED = - T.let( - :AUTHOR_TRUST_LEVEL_CHANGED, - ModerationAPI::WebhookCreateParams::EventType::TaggedSymbol - ) - AUTHOR_ACTION = - T.let( - :AUTHOR_ACTION, - ModerationAPI::WebhookCreateParams::EventType::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - ModerationAPI::WebhookCreateParams::EventType::TaggedSymbol - ] - ) - end - def self.values - end - end - end - end -end diff --git a/rbi/moderation_api/models/webhook_create_response.rbi b/rbi/moderation_api/models/webhook_create_response.rbi deleted file mode 100644 index 5ea15c4f..00000000 --- a/rbi/moderation_api/models/webhook_create_response.rbi +++ /dev/null @@ -1,225 +0,0 @@ -# typed: strong - -module ModerationAPI - module Models - class WebhookCreateResponse < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::Models::WebhookCreateResponse, - ModerationAPI::Internal::AnyHash - ) - end - - # The ID of the webhook. - sig { returns(String) } - attr_accessor :id - - # The date the webhook was created. - sig { returns(String) } - attr_accessor :created_at - - # Event types this webhook subscribes to. Empty for legacy v1 webhooks, which - # subscribe via their single deprecated `type` instead. - sig do - returns( - T::Array[ - ModerationAPI::Models::WebhookCreateResponse::EventType::TaggedSymbol - ] - ) - end - attr_accessor :event_types - - # The webhook's name. - sig { returns(String) } - attr_accessor :name - - # Payload envelope version. V2 is the Stripe-style envelope; V1 is the legacy flat - # shape and is read-only via this API. - sig do - returns( - ModerationAPI::Models::WebhookCreateResponse::PayloadVersion::TaggedSymbol - ) - end - attr_accessor :payload_version - - # The URL we call when a subscribed event occurs. - sig { returns(String) } - attr_accessor :url - - # The webhook's description. - sig { returns(T.nilable(String)) } - attr_accessor :description - - sig do - params( - id: String, - created_at: String, - event_types: - T::Array[ - ModerationAPI::Models::WebhookCreateResponse::EventType::OrSymbol - ], - name: String, - payload_version: - ModerationAPI::Models::WebhookCreateResponse::PayloadVersion::OrSymbol, - url: String, - description: T.nilable(String) - ).returns(T.attached_class) - end - def self.new( - # The ID of the webhook. - id:, - # The date the webhook was created. - created_at:, - # Event types this webhook subscribes to. Empty for legacy v1 webhooks, which - # subscribe via their single deprecated `type` instead. - event_types:, - # The webhook's name. - name:, - # Payload envelope version. V2 is the Stripe-style envelope; V1 is the legacy flat - # shape and is read-only via this API. - payload_version:, - # The URL we call when a subscribed event occurs. - url:, - # The webhook's description. - description: nil - ) - end - - sig do - override.returns( - { - id: String, - created_at: String, - event_types: - T::Array[ - ModerationAPI::Models::WebhookCreateResponse::EventType::TaggedSymbol - ], - name: String, - payload_version: - ModerationAPI::Models::WebhookCreateResponse::PayloadVersion::TaggedSymbol, - url: String, - description: T.nilable(String) - } - ) - end - def to_hash - end - - module EventType - extend ModerationAPI::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all( - Symbol, - ModerationAPI::Models::WebhookCreateResponse::EventType - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - QUEUE_ITEM_NEW = - T.let( - :QUEUE_ITEM_NEW, - ModerationAPI::Models::WebhookCreateResponse::EventType::TaggedSymbol - ) - QUEUE_ITEM_COMPLETED = - T.let( - :QUEUE_ITEM_COMPLETED, - ModerationAPI::Models::WebhookCreateResponse::EventType::TaggedSymbol - ) - QUEUE_ITEM_ACTION = - T.let( - :QUEUE_ITEM_ACTION, - ModerationAPI::Models::WebhookCreateResponse::EventType::TaggedSymbol - ) - QUEUE_ITEM_REJECTED = - T.let( - :QUEUE_ITEM_REJECTED, - ModerationAPI::Models::WebhookCreateResponse::EventType::TaggedSymbol - ) - QUEUE_ITEM_ALLOWED = - T.let( - :QUEUE_ITEM_ALLOWED, - ModerationAPI::Models::WebhookCreateResponse::EventType::TaggedSymbol - ) - AUTHOR_BLOCKED = - T.let( - :AUTHOR_BLOCKED, - ModerationAPI::Models::WebhookCreateResponse::EventType::TaggedSymbol - ) - AUTHOR_UNBLOCKED = - T.let( - :AUTHOR_UNBLOCKED, - ModerationAPI::Models::WebhookCreateResponse::EventType::TaggedSymbol - ) - AUTHOR_SUSPENDED = - T.let( - :AUTHOR_SUSPENDED, - ModerationAPI::Models::WebhookCreateResponse::EventType::TaggedSymbol - ) - AUTHOR_UPDATED = - T.let( - :AUTHOR_UPDATED, - ModerationAPI::Models::WebhookCreateResponse::EventType::TaggedSymbol - ) - AUTHOR_TRUST_LEVEL_CHANGED = - T.let( - :AUTHOR_TRUST_LEVEL_CHANGED, - ModerationAPI::Models::WebhookCreateResponse::EventType::TaggedSymbol - ) - AUTHOR_ACTION = - T.let( - :AUTHOR_ACTION, - ModerationAPI::Models::WebhookCreateResponse::EventType::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - ModerationAPI::Models::WebhookCreateResponse::EventType::TaggedSymbol - ] - ) - end - def self.values - end - end - - # Payload envelope version. V2 is the Stripe-style envelope; V1 is the legacy flat - # shape and is read-only via this API. - module PayloadVersion - extend ModerationAPI::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all( - Symbol, - ModerationAPI::Models::WebhookCreateResponse::PayloadVersion - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - V1 = - T.let( - :V1, - ModerationAPI::Models::WebhookCreateResponse::PayloadVersion::TaggedSymbol - ) - V2 = - T.let( - :V2, - ModerationAPI::Models::WebhookCreateResponse::PayloadVersion::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - ModerationAPI::Models::WebhookCreateResponse::PayloadVersion::TaggedSymbol - ] - ) - end - def self.values - end - end - end - end -end diff --git a/rbi/moderation_api/models/webhook_delete_params.rbi b/rbi/moderation_api/models/webhook_delete_params.rbi deleted file mode 100644 index c095fa45..00000000 --- a/rbi/moderation_api/models/webhook_delete_params.rbi +++ /dev/null @@ -1,43 +0,0 @@ -# typed: strong - -module ModerationAPI - module Models - class WebhookDeleteParams < ModerationAPI::Internal::Type::BaseModel - extend ModerationAPI::Internal::Type::RequestParameters::Converter - include ModerationAPI::Internal::Type::RequestParameters - - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookDeleteParams, - ModerationAPI::Internal::AnyHash - ) - end - - # The ID of the webhook to delete. - sig { returns(String) } - attr_accessor :id - - sig do - params( - id: String, - request_options: ModerationAPI::RequestOptions::OrHash - ).returns(T.attached_class) - end - def self.new( - # The ID of the webhook to delete. - id:, - request_options: {} - ) - end - - sig do - override.returns( - { id: String, request_options: ModerationAPI::RequestOptions } - ) - end - def to_hash - end - end - end -end diff --git a/rbi/moderation_api/models/webhook_delete_response.rbi b/rbi/moderation_api/models/webhook_delete_response.rbi deleted file mode 100644 index 9b792e3d..00000000 --- a/rbi/moderation_api/models/webhook_delete_response.rbi +++ /dev/null @@ -1,36 +0,0 @@ -# typed: strong - -module ModerationAPI - module Models - class WebhookDeleteResponse < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::Models::WebhookDeleteResponse, - ModerationAPI::Internal::AnyHash - ) - end - - # The ID of the webhook. - sig { returns(String) } - attr_accessor :id - - # Whether the webhook was deleted. - sig { returns(T::Boolean) } - attr_accessor :deleted - - sig { params(id: String, deleted: T::Boolean).returns(T.attached_class) } - def self.new( - # The ID of the webhook. - id:, - # Whether the webhook was deleted. - deleted: - ) - end - - sig { override.returns({ id: String, deleted: T::Boolean }) } - def to_hash - end - end - end -end diff --git a/rbi/moderation_api/models/webhook_event.rbi b/rbi/moderation_api/models/webhook_event.rbi deleted file mode 100644 index acb188c4..00000000 --- a/rbi/moderation_api/models/webhook_event.rbi +++ /dev/null @@ -1,12275 +0,0 @@ -# typed: strong - -module ModerationAPI - module Models - # Discriminated union of every v2 webhook event. Switch on `type` to narrow to a - # specific event shape. - module WebhookEvent - extend ModerationAPI::Internal::Type::Union - - Variants = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::AuthorBlocked, - ModerationAPI::WebhookEvent::AuthorUnblocked, - ModerationAPI::WebhookEvent::AuthorSuspended, - ModerationAPI::WebhookEvent::AuthorUpdated, - ModerationAPI::WebhookEvent::AuthorTrustLevelChanged, - ModerationAPI::WebhookEvent::AuthorAction, - ModerationAPI::WebhookEvent::QueueItemResolved, - ModerationAPI::WebhookEvent::QueueItemAction, - ModerationAPI::WebhookEvent::QueueItemRejected, - ModerationAPI::WebhookEvent::QueueItemAllowed - ) - end - - class AuthorBlocked < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::AuthorBlocked, - ModerationAPI::Internal::AnyHash - ) - end - - # Stable event ID. Use this to dedupe retries. - sig { returns(String) } - attr_accessor :id - - sig { returns(Symbol) } - attr_accessor :api_version - - # ISO 8601 timestamp of when the event was emitted. - sig { returns(Time) } - attr_accessor :created - - sig { returns(ModerationAPI::WebhookEvent::AuthorBlocked::Data) } - attr_reader :data - - sig do - params( - data: ModerationAPI::WebhookEvent::AuthorBlocked::Data::OrHash - ).void - end - attr_writer :data - - # The event type. - sig { returns(Symbol) } - attr_accessor :type - - sig do - params( - id: String, - created: Time, - data: ModerationAPI::WebhookEvent::AuthorBlocked::Data::OrHash, - api_version: Symbol, - type: Symbol - ).returns(T.attached_class) - end - def self.new( - # Stable event ID. Use this to dedupe retries. - id:, - # ISO 8601 timestamp of when the event was emitted. - created:, - data:, - api_version: :v2, - # The event type. - type: :"author.blocked" - ) - end - - sig do - override.returns( - { - id: String, - api_version: Symbol, - created: Time, - data: ModerationAPI::WebhookEvent::AuthorBlocked::Data, - type: Symbol - } - ) - end - def to_hash - end - - class Data < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::AuthorBlocked::Data, - ModerationAPI::Internal::AnyHash - ) - end - - sig do - returns(ModerationAPI::WebhookEvent::AuthorBlocked::Data::Object) - end - attr_reader :object - - sig do - params( - object: - ModerationAPI::WebhookEvent::AuthorBlocked::Data::Object::OrHash - ).void - end - attr_writer :object - - sig do - params( - object: - ModerationAPI::WebhookEvent::AuthorBlocked::Data::Object::OrHash - ).returns(T.attached_class) - end - def self.new(object:) - end - - sig do - override.returns( - { - object: ModerationAPI::WebhookEvent::AuthorBlocked::Data::Object - } - ) - end - def to_hash - end - - class Object < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::AuthorBlocked::Data::Object, - ModerationAPI::Internal::AnyHash - ) - end - - # Moderation action ID - sig { returns(String) } - attr_accessor :id - - # The author the action was performed on - sig do - returns( - ModerationAPI::WebhookEvent::AuthorBlocked::Data::Object::Author - ) - end - attr_reader :author - - sig do - params( - author: - ModerationAPI::WebhookEvent::AuthorBlocked::Data::Object::Author::OrHash - ).void - end - attr_writer :author - - # ISO 8601 timestamp of when the action was performed - sig { returns(Time) } - attr_accessor :created_at - - # Customer-defined key identifying this action - sig { returns(T.nilable(String)) } - attr_accessor :key - - # Display name of the action - sig { returns(T.nilable(String)) } - attr_accessor :name - - # The value passed to the action when it ran - sig { returns(T.nilable(String)) } - attr_accessor :value - - # The queue the item belongs to, if any - sig do - returns( - T.nilable( - ModerationAPI::WebhookEvent::AuthorBlocked::Data::Object::Queue - ) - ) - end - attr_reader :queue - - sig do - params( - queue: - ModerationAPI::WebhookEvent::AuthorBlocked::Data::Object::Queue::OrHash - ).void - end - attr_writer :queue - - sig do - params( - id: String, - author: - ModerationAPI::WebhookEvent::AuthorBlocked::Data::Object::Author::OrHash, - created_at: Time, - key: T.nilable(String), - name: T.nilable(String), - value: T.nilable(String), - queue: - ModerationAPI::WebhookEvent::AuthorBlocked::Data::Object::Queue::OrHash - ).returns(T.attached_class) - end - def self.new( - # Moderation action ID - id:, - # The author the action was performed on - author:, - # ISO 8601 timestamp of when the action was performed - created_at:, - # Customer-defined key identifying this action - key:, - # Display name of the action - name:, - # The value passed to the action when it ran - value:, - # The queue the item belongs to, if any - queue: nil - ) - end - - sig do - override.returns( - { - id: String, - author: - ModerationAPI::WebhookEvent::AuthorBlocked::Data::Object::Author, - created_at: Time, - key: T.nilable(String), - name: T.nilable(String), - value: T.nilable(String), - queue: - ModerationAPI::WebhookEvent::AuthorBlocked::Data::Object::Queue - } - ) - end - def to_hash - end - - class Author < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::AuthorBlocked::Data::Object::Author, - ModerationAPI::Internal::AnyHash - ) - end - - # Author ID in Moderation API - sig { returns(String) } - attr_accessor :id - - # Block or suspension details, if applicable. Null if the author is enabled. - sig do - returns( - T.nilable( - ModerationAPI::WebhookEvent::AuthorBlocked::Data::Object::Author::Block - ) - ) - end - attr_reader :block - - sig do - params( - block: - T.nilable( - ModerationAPI::WebhookEvent::AuthorBlocked::Data::Object::Author::Block::OrHash - ) - ).void - end - attr_writer :block - - # Timestamp when author first appeared - sig { returns(Float) } - attr_accessor :first_seen - - # Timestamp of last activity - sig { returns(Float) } - attr_accessor :last_seen - - # Additional metadata provided by your system. We recommend including any relevant - # information that may assist in the moderation process. - sig do - returns( - ModerationAPI::WebhookEvent::AuthorBlocked::Data::Object::Author::Metadata - ) - end - attr_reader :metadata - - sig do - params( - metadata: - ModerationAPI::WebhookEvent::AuthorBlocked::Data::Object::Author::Metadata::OrHash - ).void - end - attr_writer :metadata - - sig do - returns( - ModerationAPI::WebhookEvent::AuthorBlocked::Data::Object::Author::Metrics - ) - end - attr_reader :metrics - - sig do - params( - metrics: - ModerationAPI::WebhookEvent::AuthorBlocked::Data::Object::Author::Metrics::OrHash - ).void - end - attr_writer :metrics - - # Risk assessment details, if available. - sig do - returns( - T.nilable( - ModerationAPI::WebhookEvent::AuthorBlocked::Data::Object::Author::RiskEvaluation - ) - ) - end - attr_reader :risk_evaluation - - sig do - params( - risk_evaluation: - T.nilable( - ModerationAPI::WebhookEvent::AuthorBlocked::Data::Object::Author::RiskEvaluation::OrHash - ) - ).void - end - attr_writer :risk_evaluation - - # Current author status - sig do - returns( - ModerationAPI::WebhookEvent::AuthorBlocked::Data::Object::Author::Status::OrSymbol - ) - end - attr_accessor :status - - sig do - returns( - ModerationAPI::WebhookEvent::AuthorBlocked::Data::Object::Author::TrustLevel - ) - end - attr_reader :trust_level - - sig do - params( - trust_level: - ModerationAPI::WebhookEvent::AuthorBlocked::Data::Object::Author::TrustLevel::OrHash - ).void - end - attr_writer :trust_level - - # The author's company or organization - sig { returns(T.nilable(String)) } - attr_accessor :company - - # Author email address - sig { returns(T.nilable(String)) } - attr_accessor :email - - # The author's ID from your system - sig { returns(T.nilable(String)) } - attr_accessor :external_id - - # URL of the author's external profile - sig { returns(T.nilable(String)) } - attr_accessor :external_link - - # Timestamp of last incident - sig { returns(T.nilable(Float)) } - attr_accessor :last_incident - - # Author name or identifier - sig { returns(T.nilable(String)) } - attr_accessor :name - - # URL of the author's profile picture - sig { returns(T.nilable(String)) } - attr_accessor :profile_picture - - # The author the action was performed on - sig do - params( - id: String, - block: - T.nilable( - ModerationAPI::WebhookEvent::AuthorBlocked::Data::Object::Author::Block::OrHash - ), - first_seen: Float, - last_seen: Float, - metadata: - ModerationAPI::WebhookEvent::AuthorBlocked::Data::Object::Author::Metadata::OrHash, - metrics: - ModerationAPI::WebhookEvent::AuthorBlocked::Data::Object::Author::Metrics::OrHash, - risk_evaluation: - T.nilable( - ModerationAPI::WebhookEvent::AuthorBlocked::Data::Object::Author::RiskEvaluation::OrHash - ), - status: - ModerationAPI::WebhookEvent::AuthorBlocked::Data::Object::Author::Status::OrSymbol, - trust_level: - ModerationAPI::WebhookEvent::AuthorBlocked::Data::Object::Author::TrustLevel::OrHash, - company: T.nilable(String), - email: T.nilable(String), - external_id: T.nilable(String), - external_link: T.nilable(String), - last_incident: T.nilable(Float), - name: T.nilable(String), - profile_picture: T.nilable(String) - ).returns(T.attached_class) - end - def self.new( - # Author ID in Moderation API - id:, - # Block or suspension details, if applicable. Null if the author is enabled. - block:, - # Timestamp when author first appeared - first_seen:, - # Timestamp of last activity - last_seen:, - # Additional metadata provided by your system. We recommend including any relevant - # information that may assist in the moderation process. - metadata:, - metrics:, - # Risk assessment details, if available. - risk_evaluation:, - # Current author status - status:, - trust_level:, - # The author's company or organization - company: nil, - # Author email address - email: nil, - # The author's ID from your system - external_id: nil, - # URL of the author's external profile - external_link: nil, - # Timestamp of last incident - last_incident: nil, - # Author name or identifier - name: nil, - # URL of the author's profile picture - profile_picture: nil - ) - end - - sig do - override.returns( - { - id: String, - block: - T.nilable( - ModerationAPI::WebhookEvent::AuthorBlocked::Data::Object::Author::Block - ), - first_seen: Float, - last_seen: Float, - metadata: - ModerationAPI::WebhookEvent::AuthorBlocked::Data::Object::Author::Metadata, - metrics: - ModerationAPI::WebhookEvent::AuthorBlocked::Data::Object::Author::Metrics, - risk_evaluation: - T.nilable( - ModerationAPI::WebhookEvent::AuthorBlocked::Data::Object::Author::RiskEvaluation - ), - status: - ModerationAPI::WebhookEvent::AuthorBlocked::Data::Object::Author::Status::OrSymbol, - trust_level: - ModerationAPI::WebhookEvent::AuthorBlocked::Data::Object::Author::TrustLevel, - company: T.nilable(String), - email: T.nilable(String), - external_id: T.nilable(String), - external_link: T.nilable(String), - last_incident: T.nilable(Float), - name: T.nilable(String), - profile_picture: T.nilable(String) - } - ) - end - def to_hash - end - - class Block < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::AuthorBlocked::Data::Object::Author::Block, - ModerationAPI::Internal::AnyHash - ) - end - - # The moderators reason why the author was blocked or suspended. - sig { returns(T.nilable(String)) } - attr_accessor :reason - - # The timestamp until which they are blocked if the author is suspended. - sig { returns(T.nilable(Float)) } - attr_accessor :until_ - - # Block or suspension details, if applicable. Null if the author is enabled. - sig do - params( - reason: T.nilable(String), - until_: T.nilable(Float) - ).returns(T.attached_class) - end - def self.new( - # The moderators reason why the author was blocked or suspended. - reason: nil, - # The timestamp until which they are blocked if the author is suspended. - until_: nil - ) - end - - sig do - override.returns( - { reason: T.nilable(String), until_: T.nilable(Float) } - ) - end - def to_hash - end - end - - class Metadata < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::AuthorBlocked::Data::Object::Author::Metadata, - ModerationAPI::Internal::AnyHash - ) - end - - # Whether the author's email is verified - sig { returns(T.nilable(T::Boolean)) } - attr_accessor :email_verified - - # Whether the author's identity is verified - sig { returns(T.nilable(T::Boolean)) } - attr_accessor :identity_verified - - # Whether the author is a paying customer - sig { returns(T.nilable(T::Boolean)) } - attr_accessor :is_paying_customer - - # Whether the author's phone number is verified - sig { returns(T.nilable(T::Boolean)) } - attr_accessor :phone_verified - - # Additional metadata provided by your system. We recommend including any relevant - # information that may assist in the moderation process. - sig do - params( - email_verified: T.nilable(T::Boolean), - identity_verified: T.nilable(T::Boolean), - is_paying_customer: T.nilable(T::Boolean), - phone_verified: T.nilable(T::Boolean) - ).returns(T.attached_class) - end - def self.new( - # Whether the author's email is verified - email_verified: nil, - # Whether the author's identity is verified - identity_verified: nil, - # Whether the author is a paying customer - is_paying_customer: nil, - # Whether the author's phone number is verified - phone_verified: nil - ) - end - - sig do - override.returns( - { - email_verified: T.nilable(T::Boolean), - identity_verified: T.nilable(T::Boolean), - is_paying_customer: T.nilable(T::Boolean), - phone_verified: T.nilable(T::Boolean) - } - ) - end - def to_hash - end - end - - class Metrics < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::AuthorBlocked::Data::Object::Author::Metrics, - ModerationAPI::Internal::AnyHash - ) - end - - # Number of flagged content pieces - sig { returns(Float) } - attr_accessor :flagged_content - - # Total pieces of content - sig { returns(Float) } - attr_accessor :total_content - - # Average sentiment score of content (-1 to 1). Requires a sentiment model in your - # project. - sig { returns(T.nilable(Float)) } - attr_accessor :average_sentiment - - sig do - params( - flagged_content: Float, - total_content: Float, - average_sentiment: T.nilable(Float) - ).returns(T.attached_class) - end - def self.new( - # Number of flagged content pieces - flagged_content:, - # Total pieces of content - total_content:, - # Average sentiment score of content (-1 to 1). Requires a sentiment model in your - # project. - average_sentiment: nil - ) - end - - sig do - override.returns( - { - flagged_content: Float, - total_content: Float, - average_sentiment: T.nilable(Float) - } - ) - end - def to_hash - end - end - - class RiskEvaluation < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::AuthorBlocked::Data::Object::Author::RiskEvaluation, - ModerationAPI::Internal::AnyHash - ) - end - - # Calculated risk level based on more than 10 behavioral signals. - sig { returns(T.nilable(Float)) } - attr_accessor :risk_level - - # Risk assessment details, if available. - sig do - params(risk_level: T.nilable(Float)).returns(T.attached_class) - end - def self.new( - # Calculated risk level based on more than 10 behavioral signals. - risk_level: nil - ) - end - - sig { override.returns({ risk_level: T.nilable(Float) }) } - def to_hash - end - end - - # Current author status - module Status - extend ModerationAPI::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all( - Symbol, - ModerationAPI::WebhookEvent::AuthorBlocked::Data::Object::Author::Status - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - ENABLED = - T.let( - :enabled, - ModerationAPI::WebhookEvent::AuthorBlocked::Data::Object::Author::Status::TaggedSymbol - ) - SUSPENDED = - T.let( - :suspended, - ModerationAPI::WebhookEvent::AuthorBlocked::Data::Object::Author::Status::TaggedSymbol - ) - BLOCKED = - T.let( - :blocked, - ModerationAPI::WebhookEvent::AuthorBlocked::Data::Object::Author::Status::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - ModerationAPI::WebhookEvent::AuthorBlocked::Data::Object::Author::Status::TaggedSymbol - ] - ) - end - def self.values - end - end - - class TrustLevel < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::AuthorBlocked::Data::Object::Author::TrustLevel, - ModerationAPI::Internal::AnyHash - ) - end - - # Author trust level (-1, 0, 1, 2, 3, or 4) - sig { returns(Float) } - attr_accessor :level - - # True if the trust level was set manually by a moderator - sig { returns(T::Boolean) } - attr_accessor :manual - - sig do - params(level: Float, manual: T::Boolean).returns( - T.attached_class - ) - end - def self.new( - # Author trust level (-1, 0, 1, 2, 3, or 4) - level:, - # True if the trust level was set manually by a moderator - manual: - ) - end - - sig { override.returns({ level: Float, manual: T::Boolean }) } - def to_hash - end - end - end - - class Queue < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::AuthorBlocked::Data::Object::Queue, - ModerationAPI::Internal::AnyHash - ) - end - - sig { returns(String) } - attr_accessor :id - - # The queue the item belongs to, if any - sig { params(id: String).returns(T.attached_class) } - def self.new(id:) - end - - sig { override.returns({ id: String }) } - def to_hash - end - end - end - end - end - - class AuthorUnblocked < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::AuthorUnblocked, - ModerationAPI::Internal::AnyHash - ) - end - - # Stable event ID. Use this to dedupe retries. - sig { returns(String) } - attr_accessor :id - - sig { returns(Symbol) } - attr_accessor :api_version - - # ISO 8601 timestamp of when the event was emitted. - sig { returns(Time) } - attr_accessor :created - - sig { returns(ModerationAPI::WebhookEvent::AuthorUnblocked::Data) } - attr_reader :data - - sig do - params( - data: ModerationAPI::WebhookEvent::AuthorUnblocked::Data::OrHash - ).void - end - attr_writer :data - - # The event type. - sig { returns(Symbol) } - attr_accessor :type - - sig do - params( - id: String, - created: Time, - data: ModerationAPI::WebhookEvent::AuthorUnblocked::Data::OrHash, - api_version: Symbol, - type: Symbol - ).returns(T.attached_class) - end - def self.new( - # Stable event ID. Use this to dedupe retries. - id:, - # ISO 8601 timestamp of when the event was emitted. - created:, - data:, - api_version: :v2, - # The event type. - type: :"author.unblocked" - ) - end - - sig do - override.returns( - { - id: String, - api_version: Symbol, - created: Time, - data: ModerationAPI::WebhookEvent::AuthorUnblocked::Data, - type: Symbol - } - ) - end - def to_hash - end - - class Data < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::AuthorUnblocked::Data, - ModerationAPI::Internal::AnyHash - ) - end - - sig do - returns(ModerationAPI::WebhookEvent::AuthorUnblocked::Data::Object) - end - attr_reader :object - - sig do - params( - object: - ModerationAPI::WebhookEvent::AuthorUnblocked::Data::Object::OrHash - ).void - end - attr_writer :object - - sig do - params( - object: - ModerationAPI::WebhookEvent::AuthorUnblocked::Data::Object::OrHash - ).returns(T.attached_class) - end - def self.new(object:) - end - - sig do - override.returns( - { - object: - ModerationAPI::WebhookEvent::AuthorUnblocked::Data::Object - } - ) - end - def to_hash - end - - class Object < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::AuthorUnblocked::Data::Object, - ModerationAPI::Internal::AnyHash - ) - end - - # Moderation action ID - sig { returns(String) } - attr_accessor :id - - # The author the action was performed on - sig do - returns( - ModerationAPI::WebhookEvent::AuthorUnblocked::Data::Object::Author - ) - end - attr_reader :author - - sig do - params( - author: - ModerationAPI::WebhookEvent::AuthorUnblocked::Data::Object::Author::OrHash - ).void - end - attr_writer :author - - # ISO 8601 timestamp of when the action was performed - sig { returns(Time) } - attr_accessor :created_at - - # Customer-defined key identifying this action - sig { returns(T.nilable(String)) } - attr_accessor :key - - # Display name of the action - sig { returns(T.nilable(String)) } - attr_accessor :name - - # The value passed to the action when it ran - sig { returns(T.nilable(String)) } - attr_accessor :value - - # The queue the item belongs to, if any - sig do - returns( - T.nilable( - ModerationAPI::WebhookEvent::AuthorUnblocked::Data::Object::Queue - ) - ) - end - attr_reader :queue - - sig do - params( - queue: - ModerationAPI::WebhookEvent::AuthorUnblocked::Data::Object::Queue::OrHash - ).void - end - attr_writer :queue - - sig do - params( - id: String, - author: - ModerationAPI::WebhookEvent::AuthorUnblocked::Data::Object::Author::OrHash, - created_at: Time, - key: T.nilable(String), - name: T.nilable(String), - value: T.nilable(String), - queue: - ModerationAPI::WebhookEvent::AuthorUnblocked::Data::Object::Queue::OrHash - ).returns(T.attached_class) - end - def self.new( - # Moderation action ID - id:, - # The author the action was performed on - author:, - # ISO 8601 timestamp of when the action was performed - created_at:, - # Customer-defined key identifying this action - key:, - # Display name of the action - name:, - # The value passed to the action when it ran - value:, - # The queue the item belongs to, if any - queue: nil - ) - end - - sig do - override.returns( - { - id: String, - author: - ModerationAPI::WebhookEvent::AuthorUnblocked::Data::Object::Author, - created_at: Time, - key: T.nilable(String), - name: T.nilable(String), - value: T.nilable(String), - queue: - ModerationAPI::WebhookEvent::AuthorUnblocked::Data::Object::Queue - } - ) - end - def to_hash - end - - class Author < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::AuthorUnblocked::Data::Object::Author, - ModerationAPI::Internal::AnyHash - ) - end - - # Author ID in Moderation API - sig { returns(String) } - attr_accessor :id - - # Block or suspension details, if applicable. Null if the author is enabled. - sig do - returns( - T.nilable( - ModerationAPI::WebhookEvent::AuthorUnblocked::Data::Object::Author::Block - ) - ) - end - attr_reader :block - - sig do - params( - block: - T.nilable( - ModerationAPI::WebhookEvent::AuthorUnblocked::Data::Object::Author::Block::OrHash - ) - ).void - end - attr_writer :block - - # Timestamp when author first appeared - sig { returns(Float) } - attr_accessor :first_seen - - # Timestamp of last activity - sig { returns(Float) } - attr_accessor :last_seen - - # Additional metadata provided by your system. We recommend including any relevant - # information that may assist in the moderation process. - sig do - returns( - ModerationAPI::WebhookEvent::AuthorUnblocked::Data::Object::Author::Metadata - ) - end - attr_reader :metadata - - sig do - params( - metadata: - ModerationAPI::WebhookEvent::AuthorUnblocked::Data::Object::Author::Metadata::OrHash - ).void - end - attr_writer :metadata - - sig do - returns( - ModerationAPI::WebhookEvent::AuthorUnblocked::Data::Object::Author::Metrics - ) - end - attr_reader :metrics - - sig do - params( - metrics: - ModerationAPI::WebhookEvent::AuthorUnblocked::Data::Object::Author::Metrics::OrHash - ).void - end - attr_writer :metrics - - # Risk assessment details, if available. - sig do - returns( - T.nilable( - ModerationAPI::WebhookEvent::AuthorUnblocked::Data::Object::Author::RiskEvaluation - ) - ) - end - attr_reader :risk_evaluation - - sig do - params( - risk_evaluation: - T.nilable( - ModerationAPI::WebhookEvent::AuthorUnblocked::Data::Object::Author::RiskEvaluation::OrHash - ) - ).void - end - attr_writer :risk_evaluation - - # Current author status - sig do - returns( - ModerationAPI::WebhookEvent::AuthorUnblocked::Data::Object::Author::Status::OrSymbol - ) - end - attr_accessor :status - - sig do - returns( - ModerationAPI::WebhookEvent::AuthorUnblocked::Data::Object::Author::TrustLevel - ) - end - attr_reader :trust_level - - sig do - params( - trust_level: - ModerationAPI::WebhookEvent::AuthorUnblocked::Data::Object::Author::TrustLevel::OrHash - ).void - end - attr_writer :trust_level - - # The author's company or organization - sig { returns(T.nilable(String)) } - attr_accessor :company - - # Author email address - sig { returns(T.nilable(String)) } - attr_accessor :email - - # The author's ID from your system - sig { returns(T.nilable(String)) } - attr_accessor :external_id - - # URL of the author's external profile - sig { returns(T.nilable(String)) } - attr_accessor :external_link - - # Timestamp of last incident - sig { returns(T.nilable(Float)) } - attr_accessor :last_incident - - # Author name or identifier - sig { returns(T.nilable(String)) } - attr_accessor :name - - # URL of the author's profile picture - sig { returns(T.nilable(String)) } - attr_accessor :profile_picture - - # The author the action was performed on - sig do - params( - id: String, - block: - T.nilable( - ModerationAPI::WebhookEvent::AuthorUnblocked::Data::Object::Author::Block::OrHash - ), - first_seen: Float, - last_seen: Float, - metadata: - ModerationAPI::WebhookEvent::AuthorUnblocked::Data::Object::Author::Metadata::OrHash, - metrics: - ModerationAPI::WebhookEvent::AuthorUnblocked::Data::Object::Author::Metrics::OrHash, - risk_evaluation: - T.nilable( - ModerationAPI::WebhookEvent::AuthorUnblocked::Data::Object::Author::RiskEvaluation::OrHash - ), - status: - ModerationAPI::WebhookEvent::AuthorUnblocked::Data::Object::Author::Status::OrSymbol, - trust_level: - ModerationAPI::WebhookEvent::AuthorUnblocked::Data::Object::Author::TrustLevel::OrHash, - company: T.nilable(String), - email: T.nilable(String), - external_id: T.nilable(String), - external_link: T.nilable(String), - last_incident: T.nilable(Float), - name: T.nilable(String), - profile_picture: T.nilable(String) - ).returns(T.attached_class) - end - def self.new( - # Author ID in Moderation API - id:, - # Block or suspension details, if applicable. Null if the author is enabled. - block:, - # Timestamp when author first appeared - first_seen:, - # Timestamp of last activity - last_seen:, - # Additional metadata provided by your system. We recommend including any relevant - # information that may assist in the moderation process. - metadata:, - metrics:, - # Risk assessment details, if available. - risk_evaluation:, - # Current author status - status:, - trust_level:, - # The author's company or organization - company: nil, - # Author email address - email: nil, - # The author's ID from your system - external_id: nil, - # URL of the author's external profile - external_link: nil, - # Timestamp of last incident - last_incident: nil, - # Author name or identifier - name: nil, - # URL of the author's profile picture - profile_picture: nil - ) - end - - sig do - override.returns( - { - id: String, - block: - T.nilable( - ModerationAPI::WebhookEvent::AuthorUnblocked::Data::Object::Author::Block - ), - first_seen: Float, - last_seen: Float, - metadata: - ModerationAPI::WebhookEvent::AuthorUnblocked::Data::Object::Author::Metadata, - metrics: - ModerationAPI::WebhookEvent::AuthorUnblocked::Data::Object::Author::Metrics, - risk_evaluation: - T.nilable( - ModerationAPI::WebhookEvent::AuthorUnblocked::Data::Object::Author::RiskEvaluation - ), - status: - ModerationAPI::WebhookEvent::AuthorUnblocked::Data::Object::Author::Status::OrSymbol, - trust_level: - ModerationAPI::WebhookEvent::AuthorUnblocked::Data::Object::Author::TrustLevel, - company: T.nilable(String), - email: T.nilable(String), - external_id: T.nilable(String), - external_link: T.nilable(String), - last_incident: T.nilable(Float), - name: T.nilable(String), - profile_picture: T.nilable(String) - } - ) - end - def to_hash - end - - class Block < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::AuthorUnblocked::Data::Object::Author::Block, - ModerationAPI::Internal::AnyHash - ) - end - - # The moderators reason why the author was blocked or suspended. - sig { returns(T.nilable(String)) } - attr_accessor :reason - - # The timestamp until which they are blocked if the author is suspended. - sig { returns(T.nilable(Float)) } - attr_accessor :until_ - - # Block or suspension details, if applicable. Null if the author is enabled. - sig do - params( - reason: T.nilable(String), - until_: T.nilable(Float) - ).returns(T.attached_class) - end - def self.new( - # The moderators reason why the author was blocked or suspended. - reason: nil, - # The timestamp until which they are blocked if the author is suspended. - until_: nil - ) - end - - sig do - override.returns( - { reason: T.nilable(String), until_: T.nilable(Float) } - ) - end - def to_hash - end - end - - class Metadata < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::AuthorUnblocked::Data::Object::Author::Metadata, - ModerationAPI::Internal::AnyHash - ) - end - - # Whether the author's email is verified - sig { returns(T.nilable(T::Boolean)) } - attr_accessor :email_verified - - # Whether the author's identity is verified - sig { returns(T.nilable(T::Boolean)) } - attr_accessor :identity_verified - - # Whether the author is a paying customer - sig { returns(T.nilable(T::Boolean)) } - attr_accessor :is_paying_customer - - # Whether the author's phone number is verified - sig { returns(T.nilable(T::Boolean)) } - attr_accessor :phone_verified - - # Additional metadata provided by your system. We recommend including any relevant - # information that may assist in the moderation process. - sig do - params( - email_verified: T.nilable(T::Boolean), - identity_verified: T.nilable(T::Boolean), - is_paying_customer: T.nilable(T::Boolean), - phone_verified: T.nilable(T::Boolean) - ).returns(T.attached_class) - end - def self.new( - # Whether the author's email is verified - email_verified: nil, - # Whether the author's identity is verified - identity_verified: nil, - # Whether the author is a paying customer - is_paying_customer: nil, - # Whether the author's phone number is verified - phone_verified: nil - ) - end - - sig do - override.returns( - { - email_verified: T.nilable(T::Boolean), - identity_verified: T.nilable(T::Boolean), - is_paying_customer: T.nilable(T::Boolean), - phone_verified: T.nilable(T::Boolean) - } - ) - end - def to_hash - end - end - - class Metrics < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::AuthorUnblocked::Data::Object::Author::Metrics, - ModerationAPI::Internal::AnyHash - ) - end - - # Number of flagged content pieces - sig { returns(Float) } - attr_accessor :flagged_content - - # Total pieces of content - sig { returns(Float) } - attr_accessor :total_content - - # Average sentiment score of content (-1 to 1). Requires a sentiment model in your - # project. - sig { returns(T.nilable(Float)) } - attr_accessor :average_sentiment - - sig do - params( - flagged_content: Float, - total_content: Float, - average_sentiment: T.nilable(Float) - ).returns(T.attached_class) - end - def self.new( - # Number of flagged content pieces - flagged_content:, - # Total pieces of content - total_content:, - # Average sentiment score of content (-1 to 1). Requires a sentiment model in your - # project. - average_sentiment: nil - ) - end - - sig do - override.returns( - { - flagged_content: Float, - total_content: Float, - average_sentiment: T.nilable(Float) - } - ) - end - def to_hash - end - end - - class RiskEvaluation < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::AuthorUnblocked::Data::Object::Author::RiskEvaluation, - ModerationAPI::Internal::AnyHash - ) - end - - # Calculated risk level based on more than 10 behavioral signals. - sig { returns(T.nilable(Float)) } - attr_accessor :risk_level - - # Risk assessment details, if available. - sig do - params(risk_level: T.nilable(Float)).returns(T.attached_class) - end - def self.new( - # Calculated risk level based on more than 10 behavioral signals. - risk_level: nil - ) - end - - sig { override.returns({ risk_level: T.nilable(Float) }) } - def to_hash - end - end - - # Current author status - module Status - extend ModerationAPI::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all( - Symbol, - ModerationAPI::WebhookEvent::AuthorUnblocked::Data::Object::Author::Status - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - ENABLED = - T.let( - :enabled, - ModerationAPI::WebhookEvent::AuthorUnblocked::Data::Object::Author::Status::TaggedSymbol - ) - SUSPENDED = - T.let( - :suspended, - ModerationAPI::WebhookEvent::AuthorUnblocked::Data::Object::Author::Status::TaggedSymbol - ) - BLOCKED = - T.let( - :blocked, - ModerationAPI::WebhookEvent::AuthorUnblocked::Data::Object::Author::Status::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - ModerationAPI::WebhookEvent::AuthorUnblocked::Data::Object::Author::Status::TaggedSymbol - ] - ) - end - def self.values - end - end - - class TrustLevel < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::AuthorUnblocked::Data::Object::Author::TrustLevel, - ModerationAPI::Internal::AnyHash - ) - end - - # Author trust level (-1, 0, 1, 2, 3, or 4) - sig { returns(Float) } - attr_accessor :level - - # True if the trust level was set manually by a moderator - sig { returns(T::Boolean) } - attr_accessor :manual - - sig do - params(level: Float, manual: T::Boolean).returns( - T.attached_class - ) - end - def self.new( - # Author trust level (-1, 0, 1, 2, 3, or 4) - level:, - # True if the trust level was set manually by a moderator - manual: - ) - end - - sig { override.returns({ level: Float, manual: T::Boolean }) } - def to_hash - end - end - end - - class Queue < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::AuthorUnblocked::Data::Object::Queue, - ModerationAPI::Internal::AnyHash - ) - end - - sig { returns(String) } - attr_accessor :id - - # The queue the item belongs to, if any - sig { params(id: String).returns(T.attached_class) } - def self.new(id:) - end - - sig { override.returns({ id: String }) } - def to_hash - end - end - end - end - end - - class AuthorSuspended < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::AuthorSuspended, - ModerationAPI::Internal::AnyHash - ) - end - - # Stable event ID. Use this to dedupe retries. - sig { returns(String) } - attr_accessor :id - - sig { returns(Symbol) } - attr_accessor :api_version - - # ISO 8601 timestamp of when the event was emitted. - sig { returns(Time) } - attr_accessor :created - - sig { returns(ModerationAPI::WebhookEvent::AuthorSuspended::Data) } - attr_reader :data - - sig do - params( - data: ModerationAPI::WebhookEvent::AuthorSuspended::Data::OrHash - ).void - end - attr_writer :data - - # The event type. - sig { returns(Symbol) } - attr_accessor :type - - sig do - params( - id: String, - created: Time, - data: ModerationAPI::WebhookEvent::AuthorSuspended::Data::OrHash, - api_version: Symbol, - type: Symbol - ).returns(T.attached_class) - end - def self.new( - # Stable event ID. Use this to dedupe retries. - id:, - # ISO 8601 timestamp of when the event was emitted. - created:, - data:, - api_version: :v2, - # The event type. - type: :"author.suspended" - ) - end - - sig do - override.returns( - { - id: String, - api_version: Symbol, - created: Time, - data: ModerationAPI::WebhookEvent::AuthorSuspended::Data, - type: Symbol - } - ) - end - def to_hash - end - - class Data < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::AuthorSuspended::Data, - ModerationAPI::Internal::AnyHash - ) - end - - sig do - returns(ModerationAPI::WebhookEvent::AuthorSuspended::Data::Object) - end - attr_reader :object - - sig do - params( - object: - ModerationAPI::WebhookEvent::AuthorSuspended::Data::Object::OrHash - ).void - end - attr_writer :object - - sig do - params( - object: - ModerationAPI::WebhookEvent::AuthorSuspended::Data::Object::OrHash - ).returns(T.attached_class) - end - def self.new(object:) - end - - sig do - override.returns( - { - object: - ModerationAPI::WebhookEvent::AuthorSuspended::Data::Object - } - ) - end - def to_hash - end - - class Object < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::AuthorSuspended::Data::Object, - ModerationAPI::Internal::AnyHash - ) - end - - # Moderation action ID - sig { returns(String) } - attr_accessor :id - - # The author the action was performed on - sig do - returns( - ModerationAPI::WebhookEvent::AuthorSuspended::Data::Object::Author - ) - end - attr_reader :author - - sig do - params( - author: - ModerationAPI::WebhookEvent::AuthorSuspended::Data::Object::Author::OrHash - ).void - end - attr_writer :author - - # ISO 8601 timestamp of when the action was performed - sig { returns(Time) } - attr_accessor :created_at - - # Customer-defined key identifying this action - sig { returns(T.nilable(String)) } - attr_accessor :key - - # Display name of the action - sig { returns(T.nilable(String)) } - attr_accessor :name - - # The value passed to the action when it ran - sig { returns(T.nilable(String)) } - attr_accessor :value - - # The queue the item belongs to, if any - sig do - returns( - T.nilable( - ModerationAPI::WebhookEvent::AuthorSuspended::Data::Object::Queue - ) - ) - end - attr_reader :queue - - sig do - params( - queue: - ModerationAPI::WebhookEvent::AuthorSuspended::Data::Object::Queue::OrHash - ).void - end - attr_writer :queue - - sig do - params( - id: String, - author: - ModerationAPI::WebhookEvent::AuthorSuspended::Data::Object::Author::OrHash, - created_at: Time, - key: T.nilable(String), - name: T.nilable(String), - value: T.nilable(String), - queue: - ModerationAPI::WebhookEvent::AuthorSuspended::Data::Object::Queue::OrHash - ).returns(T.attached_class) - end - def self.new( - # Moderation action ID - id:, - # The author the action was performed on - author:, - # ISO 8601 timestamp of when the action was performed - created_at:, - # Customer-defined key identifying this action - key:, - # Display name of the action - name:, - # The value passed to the action when it ran - value:, - # The queue the item belongs to, if any - queue: nil - ) - end - - sig do - override.returns( - { - id: String, - author: - ModerationAPI::WebhookEvent::AuthorSuspended::Data::Object::Author, - created_at: Time, - key: T.nilable(String), - name: T.nilable(String), - value: T.nilable(String), - queue: - ModerationAPI::WebhookEvent::AuthorSuspended::Data::Object::Queue - } - ) - end - def to_hash - end - - class Author < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::AuthorSuspended::Data::Object::Author, - ModerationAPI::Internal::AnyHash - ) - end - - # Author ID in Moderation API - sig { returns(String) } - attr_accessor :id - - # Block or suspension details, if applicable. Null if the author is enabled. - sig do - returns( - T.nilable( - ModerationAPI::WebhookEvent::AuthorSuspended::Data::Object::Author::Block - ) - ) - end - attr_reader :block - - sig do - params( - block: - T.nilable( - ModerationAPI::WebhookEvent::AuthorSuspended::Data::Object::Author::Block::OrHash - ) - ).void - end - attr_writer :block - - # Timestamp when author first appeared - sig { returns(Float) } - attr_accessor :first_seen - - # Timestamp of last activity - sig { returns(Float) } - attr_accessor :last_seen - - # Additional metadata provided by your system. We recommend including any relevant - # information that may assist in the moderation process. - sig do - returns( - ModerationAPI::WebhookEvent::AuthorSuspended::Data::Object::Author::Metadata - ) - end - attr_reader :metadata - - sig do - params( - metadata: - ModerationAPI::WebhookEvent::AuthorSuspended::Data::Object::Author::Metadata::OrHash - ).void - end - attr_writer :metadata - - sig do - returns( - ModerationAPI::WebhookEvent::AuthorSuspended::Data::Object::Author::Metrics - ) - end - attr_reader :metrics - - sig do - params( - metrics: - ModerationAPI::WebhookEvent::AuthorSuspended::Data::Object::Author::Metrics::OrHash - ).void - end - attr_writer :metrics - - # Risk assessment details, if available. - sig do - returns( - T.nilable( - ModerationAPI::WebhookEvent::AuthorSuspended::Data::Object::Author::RiskEvaluation - ) - ) - end - attr_reader :risk_evaluation - - sig do - params( - risk_evaluation: - T.nilable( - ModerationAPI::WebhookEvent::AuthorSuspended::Data::Object::Author::RiskEvaluation::OrHash - ) - ).void - end - attr_writer :risk_evaluation - - # Current author status - sig do - returns( - ModerationAPI::WebhookEvent::AuthorSuspended::Data::Object::Author::Status::OrSymbol - ) - end - attr_accessor :status - - sig do - returns( - ModerationAPI::WebhookEvent::AuthorSuspended::Data::Object::Author::TrustLevel - ) - end - attr_reader :trust_level - - sig do - params( - trust_level: - ModerationAPI::WebhookEvent::AuthorSuspended::Data::Object::Author::TrustLevel::OrHash - ).void - end - attr_writer :trust_level - - # The author's company or organization - sig { returns(T.nilable(String)) } - attr_accessor :company - - # Author email address - sig { returns(T.nilable(String)) } - attr_accessor :email - - # The author's ID from your system - sig { returns(T.nilable(String)) } - attr_accessor :external_id - - # URL of the author's external profile - sig { returns(T.nilable(String)) } - attr_accessor :external_link - - # Timestamp of last incident - sig { returns(T.nilable(Float)) } - attr_accessor :last_incident - - # Author name or identifier - sig { returns(T.nilable(String)) } - attr_accessor :name - - # URL of the author's profile picture - sig { returns(T.nilable(String)) } - attr_accessor :profile_picture - - # The author the action was performed on - sig do - params( - id: String, - block: - T.nilable( - ModerationAPI::WebhookEvent::AuthorSuspended::Data::Object::Author::Block::OrHash - ), - first_seen: Float, - last_seen: Float, - metadata: - ModerationAPI::WebhookEvent::AuthorSuspended::Data::Object::Author::Metadata::OrHash, - metrics: - ModerationAPI::WebhookEvent::AuthorSuspended::Data::Object::Author::Metrics::OrHash, - risk_evaluation: - T.nilable( - ModerationAPI::WebhookEvent::AuthorSuspended::Data::Object::Author::RiskEvaluation::OrHash - ), - status: - ModerationAPI::WebhookEvent::AuthorSuspended::Data::Object::Author::Status::OrSymbol, - trust_level: - ModerationAPI::WebhookEvent::AuthorSuspended::Data::Object::Author::TrustLevel::OrHash, - company: T.nilable(String), - email: T.nilable(String), - external_id: T.nilable(String), - external_link: T.nilable(String), - last_incident: T.nilable(Float), - name: T.nilable(String), - profile_picture: T.nilable(String) - ).returns(T.attached_class) - end - def self.new( - # Author ID in Moderation API - id:, - # Block or suspension details, if applicable. Null if the author is enabled. - block:, - # Timestamp when author first appeared - first_seen:, - # Timestamp of last activity - last_seen:, - # Additional metadata provided by your system. We recommend including any relevant - # information that may assist in the moderation process. - metadata:, - metrics:, - # Risk assessment details, if available. - risk_evaluation:, - # Current author status - status:, - trust_level:, - # The author's company or organization - company: nil, - # Author email address - email: nil, - # The author's ID from your system - external_id: nil, - # URL of the author's external profile - external_link: nil, - # Timestamp of last incident - last_incident: nil, - # Author name or identifier - name: nil, - # URL of the author's profile picture - profile_picture: nil - ) - end - - sig do - override.returns( - { - id: String, - block: - T.nilable( - ModerationAPI::WebhookEvent::AuthorSuspended::Data::Object::Author::Block - ), - first_seen: Float, - last_seen: Float, - metadata: - ModerationAPI::WebhookEvent::AuthorSuspended::Data::Object::Author::Metadata, - metrics: - ModerationAPI::WebhookEvent::AuthorSuspended::Data::Object::Author::Metrics, - risk_evaluation: - T.nilable( - ModerationAPI::WebhookEvent::AuthorSuspended::Data::Object::Author::RiskEvaluation - ), - status: - ModerationAPI::WebhookEvent::AuthorSuspended::Data::Object::Author::Status::OrSymbol, - trust_level: - ModerationAPI::WebhookEvent::AuthorSuspended::Data::Object::Author::TrustLevel, - company: T.nilable(String), - email: T.nilable(String), - external_id: T.nilable(String), - external_link: T.nilable(String), - last_incident: T.nilable(Float), - name: T.nilable(String), - profile_picture: T.nilable(String) - } - ) - end - def to_hash - end - - class Block < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::AuthorSuspended::Data::Object::Author::Block, - ModerationAPI::Internal::AnyHash - ) - end - - # The moderators reason why the author was blocked or suspended. - sig { returns(T.nilable(String)) } - attr_accessor :reason - - # The timestamp until which they are blocked if the author is suspended. - sig { returns(T.nilable(Float)) } - attr_accessor :until_ - - # Block or suspension details, if applicable. Null if the author is enabled. - sig do - params( - reason: T.nilable(String), - until_: T.nilable(Float) - ).returns(T.attached_class) - end - def self.new( - # The moderators reason why the author was blocked or suspended. - reason: nil, - # The timestamp until which they are blocked if the author is suspended. - until_: nil - ) - end - - sig do - override.returns( - { reason: T.nilable(String), until_: T.nilable(Float) } - ) - end - def to_hash - end - end - - class Metadata < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::AuthorSuspended::Data::Object::Author::Metadata, - ModerationAPI::Internal::AnyHash - ) - end - - # Whether the author's email is verified - sig { returns(T.nilable(T::Boolean)) } - attr_accessor :email_verified - - # Whether the author's identity is verified - sig { returns(T.nilable(T::Boolean)) } - attr_accessor :identity_verified - - # Whether the author is a paying customer - sig { returns(T.nilable(T::Boolean)) } - attr_accessor :is_paying_customer - - # Whether the author's phone number is verified - sig { returns(T.nilable(T::Boolean)) } - attr_accessor :phone_verified - - # Additional metadata provided by your system. We recommend including any relevant - # information that may assist in the moderation process. - sig do - params( - email_verified: T.nilable(T::Boolean), - identity_verified: T.nilable(T::Boolean), - is_paying_customer: T.nilable(T::Boolean), - phone_verified: T.nilable(T::Boolean) - ).returns(T.attached_class) - end - def self.new( - # Whether the author's email is verified - email_verified: nil, - # Whether the author's identity is verified - identity_verified: nil, - # Whether the author is a paying customer - is_paying_customer: nil, - # Whether the author's phone number is verified - phone_verified: nil - ) - end - - sig do - override.returns( - { - email_verified: T.nilable(T::Boolean), - identity_verified: T.nilable(T::Boolean), - is_paying_customer: T.nilable(T::Boolean), - phone_verified: T.nilable(T::Boolean) - } - ) - end - def to_hash - end - end - - class Metrics < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::AuthorSuspended::Data::Object::Author::Metrics, - ModerationAPI::Internal::AnyHash - ) - end - - # Number of flagged content pieces - sig { returns(Float) } - attr_accessor :flagged_content - - # Total pieces of content - sig { returns(Float) } - attr_accessor :total_content - - # Average sentiment score of content (-1 to 1). Requires a sentiment model in your - # project. - sig { returns(T.nilable(Float)) } - attr_accessor :average_sentiment - - sig do - params( - flagged_content: Float, - total_content: Float, - average_sentiment: T.nilable(Float) - ).returns(T.attached_class) - end - def self.new( - # Number of flagged content pieces - flagged_content:, - # Total pieces of content - total_content:, - # Average sentiment score of content (-1 to 1). Requires a sentiment model in your - # project. - average_sentiment: nil - ) - end - - sig do - override.returns( - { - flagged_content: Float, - total_content: Float, - average_sentiment: T.nilable(Float) - } - ) - end - def to_hash - end - end - - class RiskEvaluation < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::AuthorSuspended::Data::Object::Author::RiskEvaluation, - ModerationAPI::Internal::AnyHash - ) - end - - # Calculated risk level based on more than 10 behavioral signals. - sig { returns(T.nilable(Float)) } - attr_accessor :risk_level - - # Risk assessment details, if available. - sig do - params(risk_level: T.nilable(Float)).returns(T.attached_class) - end - def self.new( - # Calculated risk level based on more than 10 behavioral signals. - risk_level: nil - ) - end - - sig { override.returns({ risk_level: T.nilable(Float) }) } - def to_hash - end - end - - # Current author status - module Status - extend ModerationAPI::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all( - Symbol, - ModerationAPI::WebhookEvent::AuthorSuspended::Data::Object::Author::Status - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - ENABLED = - T.let( - :enabled, - ModerationAPI::WebhookEvent::AuthorSuspended::Data::Object::Author::Status::TaggedSymbol - ) - SUSPENDED = - T.let( - :suspended, - ModerationAPI::WebhookEvent::AuthorSuspended::Data::Object::Author::Status::TaggedSymbol - ) - BLOCKED = - T.let( - :blocked, - ModerationAPI::WebhookEvent::AuthorSuspended::Data::Object::Author::Status::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - ModerationAPI::WebhookEvent::AuthorSuspended::Data::Object::Author::Status::TaggedSymbol - ] - ) - end - def self.values - end - end - - class TrustLevel < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::AuthorSuspended::Data::Object::Author::TrustLevel, - ModerationAPI::Internal::AnyHash - ) - end - - # Author trust level (-1, 0, 1, 2, 3, or 4) - sig { returns(Float) } - attr_accessor :level - - # True if the trust level was set manually by a moderator - sig { returns(T::Boolean) } - attr_accessor :manual - - sig do - params(level: Float, manual: T::Boolean).returns( - T.attached_class - ) - end - def self.new( - # Author trust level (-1, 0, 1, 2, 3, or 4) - level:, - # True if the trust level was set manually by a moderator - manual: - ) - end - - sig { override.returns({ level: Float, manual: T::Boolean }) } - def to_hash - end - end - end - - class Queue < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::AuthorSuspended::Data::Object::Queue, - ModerationAPI::Internal::AnyHash - ) - end - - sig { returns(String) } - attr_accessor :id - - # The queue the item belongs to, if any - sig { params(id: String).returns(T.attached_class) } - def self.new(id:) - end - - sig { override.returns({ id: String }) } - def to_hash - end - end - end - end - end - - class AuthorUpdated < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::AuthorUpdated, - ModerationAPI::Internal::AnyHash - ) - end - - # Stable event ID. Use this to dedupe retries. - sig { returns(String) } - attr_accessor :id - - sig { returns(Symbol) } - attr_accessor :api_version - - # ISO 8601 timestamp of when the event was emitted. - sig { returns(Time) } - attr_accessor :created - - sig { returns(ModerationAPI::WebhookEvent::AuthorUpdated::Data) } - attr_reader :data - - sig do - params( - data: ModerationAPI::WebhookEvent::AuthorUpdated::Data::OrHash - ).void - end - attr_writer :data - - # The event type. - sig { returns(Symbol) } - attr_accessor :type - - sig do - params( - id: String, - created: Time, - data: ModerationAPI::WebhookEvent::AuthorUpdated::Data::OrHash, - api_version: Symbol, - type: Symbol - ).returns(T.attached_class) - end - def self.new( - # Stable event ID. Use this to dedupe retries. - id:, - # ISO 8601 timestamp of when the event was emitted. - created:, - data:, - api_version: :v2, - # The event type. - type: :"author.updated" - ) - end - - sig do - override.returns( - { - id: String, - api_version: Symbol, - created: Time, - data: ModerationAPI::WebhookEvent::AuthorUpdated::Data, - type: Symbol - } - ) - end - def to_hash - end - - class Data < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::AuthorUpdated::Data, - ModerationAPI::Internal::AnyHash - ) - end - - sig do - returns(ModerationAPI::WebhookEvent::AuthorUpdated::Data::Object) - end - attr_reader :object - - sig do - params( - object: - ModerationAPI::WebhookEvent::AuthorUpdated::Data::Object::OrHash - ).void - end - attr_writer :object - - sig do - params( - object: - ModerationAPI::WebhookEvent::AuthorUpdated::Data::Object::OrHash - ).returns(T.attached_class) - end - def self.new(object:) - end - - sig do - override.returns( - { - object: ModerationAPI::WebhookEvent::AuthorUpdated::Data::Object - } - ) - end - def to_hash - end - - class Object < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::AuthorUpdated::Data::Object, - ModerationAPI::Internal::AnyHash - ) - end - - # Author ID in Moderation API - sig { returns(String) } - attr_accessor :id - - # Block or suspension details, if applicable. Null if the author is enabled. - sig do - returns( - T.nilable( - ModerationAPI::WebhookEvent::AuthorUpdated::Data::Object::Block - ) - ) - end - attr_reader :block - - sig do - params( - block: - T.nilable( - ModerationAPI::WebhookEvent::AuthorUpdated::Data::Object::Block::OrHash - ) - ).void - end - attr_writer :block - - # Timestamp when author first appeared - sig { returns(Float) } - attr_accessor :first_seen - - # Timestamp of last activity - sig { returns(Float) } - attr_accessor :last_seen - - # Additional metadata provided by your system. We recommend including any relevant - # information that may assist in the moderation process. - sig do - returns( - ModerationAPI::WebhookEvent::AuthorUpdated::Data::Object::Metadata - ) - end - attr_reader :metadata - - sig do - params( - metadata: - ModerationAPI::WebhookEvent::AuthorUpdated::Data::Object::Metadata::OrHash - ).void - end - attr_writer :metadata - - sig do - returns( - ModerationAPI::WebhookEvent::AuthorUpdated::Data::Object::Metrics - ) - end - attr_reader :metrics - - sig do - params( - metrics: - ModerationAPI::WebhookEvent::AuthorUpdated::Data::Object::Metrics::OrHash - ).void - end - attr_writer :metrics - - # Risk assessment details, if available. - sig do - returns( - T.nilable( - ModerationAPI::WebhookEvent::AuthorUpdated::Data::Object::RiskEvaluation - ) - ) - end - attr_reader :risk_evaluation - - sig do - params( - risk_evaluation: - T.nilable( - ModerationAPI::WebhookEvent::AuthorUpdated::Data::Object::RiskEvaluation::OrHash - ) - ).void - end - attr_writer :risk_evaluation - - # Current author status - sig do - returns( - ModerationAPI::WebhookEvent::AuthorUpdated::Data::Object::Status::OrSymbol - ) - end - attr_accessor :status - - sig do - returns( - ModerationAPI::WebhookEvent::AuthorUpdated::Data::Object::TrustLevel - ) - end - attr_reader :trust_level - - sig do - params( - trust_level: - ModerationAPI::WebhookEvent::AuthorUpdated::Data::Object::TrustLevel::OrHash - ).void - end - attr_writer :trust_level - - # The author's company or organization - sig { returns(T.nilable(String)) } - attr_accessor :company - - # Author email address - sig { returns(T.nilable(String)) } - attr_accessor :email - - # The author's ID from your system - sig { returns(T.nilable(String)) } - attr_accessor :external_id - - # URL of the author's external profile - sig { returns(T.nilable(String)) } - attr_accessor :external_link - - # Timestamp of last incident - sig { returns(T.nilable(Float)) } - attr_accessor :last_incident - - # Author name or identifier - sig { returns(T.nilable(String)) } - attr_accessor :name - - # URL of the author's profile picture - sig { returns(T.nilable(String)) } - attr_accessor :profile_picture - - sig do - params( - id: String, - block: - T.nilable( - ModerationAPI::WebhookEvent::AuthorUpdated::Data::Object::Block::OrHash - ), - first_seen: Float, - last_seen: Float, - metadata: - ModerationAPI::WebhookEvent::AuthorUpdated::Data::Object::Metadata::OrHash, - metrics: - ModerationAPI::WebhookEvent::AuthorUpdated::Data::Object::Metrics::OrHash, - risk_evaluation: - T.nilable( - ModerationAPI::WebhookEvent::AuthorUpdated::Data::Object::RiskEvaluation::OrHash - ), - status: - ModerationAPI::WebhookEvent::AuthorUpdated::Data::Object::Status::OrSymbol, - trust_level: - ModerationAPI::WebhookEvent::AuthorUpdated::Data::Object::TrustLevel::OrHash, - company: T.nilable(String), - email: T.nilable(String), - external_id: T.nilable(String), - external_link: T.nilable(String), - last_incident: T.nilable(Float), - name: T.nilable(String), - profile_picture: T.nilable(String) - ).returns(T.attached_class) - end - def self.new( - # Author ID in Moderation API - id:, - # Block or suspension details, if applicable. Null if the author is enabled. - block:, - # Timestamp when author first appeared - first_seen:, - # Timestamp of last activity - last_seen:, - # Additional metadata provided by your system. We recommend including any relevant - # information that may assist in the moderation process. - metadata:, - metrics:, - # Risk assessment details, if available. - risk_evaluation:, - # Current author status - status:, - trust_level:, - # The author's company or organization - company: nil, - # Author email address - email: nil, - # The author's ID from your system - external_id: nil, - # URL of the author's external profile - external_link: nil, - # Timestamp of last incident - last_incident: nil, - # Author name or identifier - name: nil, - # URL of the author's profile picture - profile_picture: nil - ) - end - - sig do - override.returns( - { - id: String, - block: - T.nilable( - ModerationAPI::WebhookEvent::AuthorUpdated::Data::Object::Block - ), - first_seen: Float, - last_seen: Float, - metadata: - ModerationAPI::WebhookEvent::AuthorUpdated::Data::Object::Metadata, - metrics: - ModerationAPI::WebhookEvent::AuthorUpdated::Data::Object::Metrics, - risk_evaluation: - T.nilable( - ModerationAPI::WebhookEvent::AuthorUpdated::Data::Object::RiskEvaluation - ), - status: - ModerationAPI::WebhookEvent::AuthorUpdated::Data::Object::Status::OrSymbol, - trust_level: - ModerationAPI::WebhookEvent::AuthorUpdated::Data::Object::TrustLevel, - company: T.nilable(String), - email: T.nilable(String), - external_id: T.nilable(String), - external_link: T.nilable(String), - last_incident: T.nilable(Float), - name: T.nilable(String), - profile_picture: T.nilable(String) - } - ) - end - def to_hash - end - - class Block < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::AuthorUpdated::Data::Object::Block, - ModerationAPI::Internal::AnyHash - ) - end - - # The moderators reason why the author was blocked or suspended. - sig { returns(T.nilable(String)) } - attr_accessor :reason - - # The timestamp until which they are blocked if the author is suspended. - sig { returns(T.nilable(Float)) } - attr_accessor :until_ - - # Block or suspension details, if applicable. Null if the author is enabled. - sig do - params( - reason: T.nilable(String), - until_: T.nilable(Float) - ).returns(T.attached_class) - end - def self.new( - # The moderators reason why the author was blocked or suspended. - reason: nil, - # The timestamp until which they are blocked if the author is suspended. - until_: nil - ) - end - - sig do - override.returns( - { reason: T.nilable(String), until_: T.nilable(Float) } - ) - end - def to_hash - end - end - - class Metadata < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::AuthorUpdated::Data::Object::Metadata, - ModerationAPI::Internal::AnyHash - ) - end - - # Whether the author's email is verified - sig { returns(T.nilable(T::Boolean)) } - attr_accessor :email_verified - - # Whether the author's identity is verified - sig { returns(T.nilable(T::Boolean)) } - attr_accessor :identity_verified - - # Whether the author is a paying customer - sig { returns(T.nilable(T::Boolean)) } - attr_accessor :is_paying_customer - - # Whether the author's phone number is verified - sig { returns(T.nilable(T::Boolean)) } - attr_accessor :phone_verified - - # Additional metadata provided by your system. We recommend including any relevant - # information that may assist in the moderation process. - sig do - params( - email_verified: T.nilable(T::Boolean), - identity_verified: T.nilable(T::Boolean), - is_paying_customer: T.nilable(T::Boolean), - phone_verified: T.nilable(T::Boolean) - ).returns(T.attached_class) - end - def self.new( - # Whether the author's email is verified - email_verified: nil, - # Whether the author's identity is verified - identity_verified: nil, - # Whether the author is a paying customer - is_paying_customer: nil, - # Whether the author's phone number is verified - phone_verified: nil - ) - end - - sig do - override.returns( - { - email_verified: T.nilable(T::Boolean), - identity_verified: T.nilable(T::Boolean), - is_paying_customer: T.nilable(T::Boolean), - phone_verified: T.nilable(T::Boolean) - } - ) - end - def to_hash - end - end - - class Metrics < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::AuthorUpdated::Data::Object::Metrics, - ModerationAPI::Internal::AnyHash - ) - end - - # Number of flagged content pieces - sig { returns(Float) } - attr_accessor :flagged_content - - # Total pieces of content - sig { returns(Float) } - attr_accessor :total_content - - # Average sentiment score of content (-1 to 1). Requires a sentiment model in your - # project. - sig { returns(T.nilable(Float)) } - attr_accessor :average_sentiment - - sig do - params( - flagged_content: Float, - total_content: Float, - average_sentiment: T.nilable(Float) - ).returns(T.attached_class) - end - def self.new( - # Number of flagged content pieces - flagged_content:, - # Total pieces of content - total_content:, - # Average sentiment score of content (-1 to 1). Requires a sentiment model in your - # project. - average_sentiment: nil - ) - end - - sig do - override.returns( - { - flagged_content: Float, - total_content: Float, - average_sentiment: T.nilable(Float) - } - ) - end - def to_hash - end - end - - class RiskEvaluation < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::AuthorUpdated::Data::Object::RiskEvaluation, - ModerationAPI::Internal::AnyHash - ) - end - - # Calculated risk level based on more than 10 behavioral signals. - sig { returns(T.nilable(Float)) } - attr_accessor :risk_level - - # Risk assessment details, if available. - sig do - params(risk_level: T.nilable(Float)).returns(T.attached_class) - end - def self.new( - # Calculated risk level based on more than 10 behavioral signals. - risk_level: nil - ) - end - - sig { override.returns({ risk_level: T.nilable(Float) }) } - def to_hash - end - end - - # Current author status - module Status - extend ModerationAPI::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all( - Symbol, - ModerationAPI::WebhookEvent::AuthorUpdated::Data::Object::Status - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - ENABLED = - T.let( - :enabled, - ModerationAPI::WebhookEvent::AuthorUpdated::Data::Object::Status::TaggedSymbol - ) - SUSPENDED = - T.let( - :suspended, - ModerationAPI::WebhookEvent::AuthorUpdated::Data::Object::Status::TaggedSymbol - ) - BLOCKED = - T.let( - :blocked, - ModerationAPI::WebhookEvent::AuthorUpdated::Data::Object::Status::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - ModerationAPI::WebhookEvent::AuthorUpdated::Data::Object::Status::TaggedSymbol - ] - ) - end - def self.values - end - end - - class TrustLevel < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::AuthorUpdated::Data::Object::TrustLevel, - ModerationAPI::Internal::AnyHash - ) - end - - # Author trust level (-1, 0, 1, 2, 3, or 4) - sig { returns(Float) } - attr_accessor :level - - # True if the trust level was set manually by a moderator - sig { returns(T::Boolean) } - attr_accessor :manual - - sig do - params(level: Float, manual: T::Boolean).returns( - T.attached_class - ) - end - def self.new( - # Author trust level (-1, 0, 1, 2, 3, or 4) - level:, - # True if the trust level was set manually by a moderator - manual: - ) - end - - sig { override.returns({ level: Float, manual: T::Boolean }) } - def to_hash - end - end - end - end - end - - class AuthorTrustLevelChanged < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::AuthorTrustLevelChanged, - ModerationAPI::Internal::AnyHash - ) - end - - # Stable event ID. Use this to dedupe retries. - sig { returns(String) } - attr_accessor :id - - sig { returns(Symbol) } - attr_accessor :api_version - - # ISO 8601 timestamp of when the event was emitted. - sig { returns(Time) } - attr_accessor :created - - sig do - returns(ModerationAPI::WebhookEvent::AuthorTrustLevelChanged::Data) - end - attr_reader :data - - sig do - params( - data: - ModerationAPI::WebhookEvent::AuthorTrustLevelChanged::Data::OrHash - ).void - end - attr_writer :data - - # The event type. - sig { returns(Symbol) } - attr_accessor :type - - sig do - params( - id: String, - created: Time, - data: - ModerationAPI::WebhookEvent::AuthorTrustLevelChanged::Data::OrHash, - api_version: Symbol, - type: Symbol - ).returns(T.attached_class) - end - def self.new( - # Stable event ID. Use this to dedupe retries. - id:, - # ISO 8601 timestamp of when the event was emitted. - created:, - data:, - api_version: :v2, - # The event type. - type: :"author.trust_level_changed" - ) - end - - sig do - override.returns( - { - id: String, - api_version: Symbol, - created: Time, - data: ModerationAPI::WebhookEvent::AuthorTrustLevelChanged::Data, - type: Symbol - } - ) - end - def to_hash - end - - class Data < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::AuthorTrustLevelChanged::Data, - ModerationAPI::Internal::AnyHash - ) - end - - sig do - returns( - ModerationAPI::WebhookEvent::AuthorTrustLevelChanged::Data::Object - ) - end - attr_reader :object - - sig do - params( - object: - ModerationAPI::WebhookEvent::AuthorTrustLevelChanged::Data::Object::OrHash - ).void - end - attr_writer :object - - sig do - params( - object: - ModerationAPI::WebhookEvent::AuthorTrustLevelChanged::Data::Object::OrHash - ).returns(T.attached_class) - end - def self.new(object:) - end - - sig do - override.returns( - { - object: - ModerationAPI::WebhookEvent::AuthorTrustLevelChanged::Data::Object - } - ) - end - def to_hash - end - - class Object < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::AuthorTrustLevelChanged::Data::Object, - ModerationAPI::Internal::AnyHash - ) - end - - # Author ID in Moderation API - sig { returns(String) } - attr_accessor :id - - # Block or suspension details, if applicable. Null if the author is enabled. - sig do - returns( - T.nilable( - ModerationAPI::WebhookEvent::AuthorTrustLevelChanged::Data::Object::Block - ) - ) - end - attr_reader :block - - sig do - params( - block: - T.nilable( - ModerationAPI::WebhookEvent::AuthorTrustLevelChanged::Data::Object::Block::OrHash - ) - ).void - end - attr_writer :block - - # Timestamp when author first appeared - sig { returns(Float) } - attr_accessor :first_seen - - # Timestamp of last activity - sig { returns(Float) } - attr_accessor :last_seen - - # Additional metadata provided by your system. We recommend including any relevant - # information that may assist in the moderation process. - sig do - returns( - ModerationAPI::WebhookEvent::AuthorTrustLevelChanged::Data::Object::Metadata - ) - end - attr_reader :metadata - - sig do - params( - metadata: - ModerationAPI::WebhookEvent::AuthorTrustLevelChanged::Data::Object::Metadata::OrHash - ).void - end - attr_writer :metadata - - sig do - returns( - ModerationAPI::WebhookEvent::AuthorTrustLevelChanged::Data::Object::Metrics - ) - end - attr_reader :metrics - - sig do - params( - metrics: - ModerationAPI::WebhookEvent::AuthorTrustLevelChanged::Data::Object::Metrics::OrHash - ).void - end - attr_writer :metrics - - # Risk assessment details, if available. - sig do - returns( - T.nilable( - ModerationAPI::WebhookEvent::AuthorTrustLevelChanged::Data::Object::RiskEvaluation - ) - ) - end - attr_reader :risk_evaluation - - sig do - params( - risk_evaluation: - T.nilable( - ModerationAPI::WebhookEvent::AuthorTrustLevelChanged::Data::Object::RiskEvaluation::OrHash - ) - ).void - end - attr_writer :risk_evaluation - - # Current author status - sig do - returns( - ModerationAPI::WebhookEvent::AuthorTrustLevelChanged::Data::Object::Status::OrSymbol - ) - end - attr_accessor :status - - sig do - returns( - ModerationAPI::WebhookEvent::AuthorTrustLevelChanged::Data::Object::TrustLevel - ) - end - attr_reader :trust_level - - sig do - params( - trust_level: - ModerationAPI::WebhookEvent::AuthorTrustLevelChanged::Data::Object::TrustLevel::OrHash - ).void - end - attr_writer :trust_level - - # The author's company or organization - sig { returns(T.nilable(String)) } - attr_accessor :company - - # Author email address - sig { returns(T.nilable(String)) } - attr_accessor :email - - # The author's ID from your system - sig { returns(T.nilable(String)) } - attr_accessor :external_id - - # URL of the author's external profile - sig { returns(T.nilable(String)) } - attr_accessor :external_link - - # Timestamp of last incident - sig { returns(T.nilable(Float)) } - attr_accessor :last_incident - - # Author name or identifier - sig { returns(T.nilable(String)) } - attr_accessor :name - - # URL of the author's profile picture - sig { returns(T.nilable(String)) } - attr_accessor :profile_picture - - sig do - params( - id: String, - block: - T.nilable( - ModerationAPI::WebhookEvent::AuthorTrustLevelChanged::Data::Object::Block::OrHash - ), - first_seen: Float, - last_seen: Float, - metadata: - ModerationAPI::WebhookEvent::AuthorTrustLevelChanged::Data::Object::Metadata::OrHash, - metrics: - ModerationAPI::WebhookEvent::AuthorTrustLevelChanged::Data::Object::Metrics::OrHash, - risk_evaluation: - T.nilable( - ModerationAPI::WebhookEvent::AuthorTrustLevelChanged::Data::Object::RiskEvaluation::OrHash - ), - status: - ModerationAPI::WebhookEvent::AuthorTrustLevelChanged::Data::Object::Status::OrSymbol, - trust_level: - ModerationAPI::WebhookEvent::AuthorTrustLevelChanged::Data::Object::TrustLevel::OrHash, - company: T.nilable(String), - email: T.nilable(String), - external_id: T.nilable(String), - external_link: T.nilable(String), - last_incident: T.nilable(Float), - name: T.nilable(String), - profile_picture: T.nilable(String) - ).returns(T.attached_class) - end - def self.new( - # Author ID in Moderation API - id:, - # Block or suspension details, if applicable. Null if the author is enabled. - block:, - # Timestamp when author first appeared - first_seen:, - # Timestamp of last activity - last_seen:, - # Additional metadata provided by your system. We recommend including any relevant - # information that may assist in the moderation process. - metadata:, - metrics:, - # Risk assessment details, if available. - risk_evaluation:, - # Current author status - status:, - trust_level:, - # The author's company or organization - company: nil, - # Author email address - email: nil, - # The author's ID from your system - external_id: nil, - # URL of the author's external profile - external_link: nil, - # Timestamp of last incident - last_incident: nil, - # Author name or identifier - name: nil, - # URL of the author's profile picture - profile_picture: nil - ) - end - - sig do - override.returns( - { - id: String, - block: - T.nilable( - ModerationAPI::WebhookEvent::AuthorTrustLevelChanged::Data::Object::Block - ), - first_seen: Float, - last_seen: Float, - metadata: - ModerationAPI::WebhookEvent::AuthorTrustLevelChanged::Data::Object::Metadata, - metrics: - ModerationAPI::WebhookEvent::AuthorTrustLevelChanged::Data::Object::Metrics, - risk_evaluation: - T.nilable( - ModerationAPI::WebhookEvent::AuthorTrustLevelChanged::Data::Object::RiskEvaluation - ), - status: - ModerationAPI::WebhookEvent::AuthorTrustLevelChanged::Data::Object::Status::OrSymbol, - trust_level: - ModerationAPI::WebhookEvent::AuthorTrustLevelChanged::Data::Object::TrustLevel, - company: T.nilable(String), - email: T.nilable(String), - external_id: T.nilable(String), - external_link: T.nilable(String), - last_incident: T.nilable(Float), - name: T.nilable(String), - profile_picture: T.nilable(String) - } - ) - end - def to_hash - end - - class Block < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::AuthorTrustLevelChanged::Data::Object::Block, - ModerationAPI::Internal::AnyHash - ) - end - - # The moderators reason why the author was blocked or suspended. - sig { returns(T.nilable(String)) } - attr_accessor :reason - - # The timestamp until which they are blocked if the author is suspended. - sig { returns(T.nilable(Float)) } - attr_accessor :until_ - - # Block or suspension details, if applicable. Null if the author is enabled. - sig do - params( - reason: T.nilable(String), - until_: T.nilable(Float) - ).returns(T.attached_class) - end - def self.new( - # The moderators reason why the author was blocked or suspended. - reason: nil, - # The timestamp until which they are blocked if the author is suspended. - until_: nil - ) - end - - sig do - override.returns( - { reason: T.nilable(String), until_: T.nilable(Float) } - ) - end - def to_hash - end - end - - class Metadata < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::AuthorTrustLevelChanged::Data::Object::Metadata, - ModerationAPI::Internal::AnyHash - ) - end - - # Whether the author's email is verified - sig { returns(T.nilable(T::Boolean)) } - attr_accessor :email_verified - - # Whether the author's identity is verified - sig { returns(T.nilable(T::Boolean)) } - attr_accessor :identity_verified - - # Whether the author is a paying customer - sig { returns(T.nilable(T::Boolean)) } - attr_accessor :is_paying_customer - - # Whether the author's phone number is verified - sig { returns(T.nilable(T::Boolean)) } - attr_accessor :phone_verified - - # Additional metadata provided by your system. We recommend including any relevant - # information that may assist in the moderation process. - sig do - params( - email_verified: T.nilable(T::Boolean), - identity_verified: T.nilable(T::Boolean), - is_paying_customer: T.nilable(T::Boolean), - phone_verified: T.nilable(T::Boolean) - ).returns(T.attached_class) - end - def self.new( - # Whether the author's email is verified - email_verified: nil, - # Whether the author's identity is verified - identity_verified: nil, - # Whether the author is a paying customer - is_paying_customer: nil, - # Whether the author's phone number is verified - phone_verified: nil - ) - end - - sig do - override.returns( - { - email_verified: T.nilable(T::Boolean), - identity_verified: T.nilable(T::Boolean), - is_paying_customer: T.nilable(T::Boolean), - phone_verified: T.nilable(T::Boolean) - } - ) - end - def to_hash - end - end - - class Metrics < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::AuthorTrustLevelChanged::Data::Object::Metrics, - ModerationAPI::Internal::AnyHash - ) - end - - # Number of flagged content pieces - sig { returns(Float) } - attr_accessor :flagged_content - - # Total pieces of content - sig { returns(Float) } - attr_accessor :total_content - - # Average sentiment score of content (-1 to 1). Requires a sentiment model in your - # project. - sig { returns(T.nilable(Float)) } - attr_accessor :average_sentiment - - sig do - params( - flagged_content: Float, - total_content: Float, - average_sentiment: T.nilable(Float) - ).returns(T.attached_class) - end - def self.new( - # Number of flagged content pieces - flagged_content:, - # Total pieces of content - total_content:, - # Average sentiment score of content (-1 to 1). Requires a sentiment model in your - # project. - average_sentiment: nil - ) - end - - sig do - override.returns( - { - flagged_content: Float, - total_content: Float, - average_sentiment: T.nilable(Float) - } - ) - end - def to_hash - end - end - - class RiskEvaluation < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::AuthorTrustLevelChanged::Data::Object::RiskEvaluation, - ModerationAPI::Internal::AnyHash - ) - end - - # Calculated risk level based on more than 10 behavioral signals. - sig { returns(T.nilable(Float)) } - attr_accessor :risk_level - - # Risk assessment details, if available. - sig do - params(risk_level: T.nilable(Float)).returns(T.attached_class) - end - def self.new( - # Calculated risk level based on more than 10 behavioral signals. - risk_level: nil - ) - end - - sig { override.returns({ risk_level: T.nilable(Float) }) } - def to_hash - end - end - - # Current author status - module Status - extend ModerationAPI::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all( - Symbol, - ModerationAPI::WebhookEvent::AuthorTrustLevelChanged::Data::Object::Status - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - ENABLED = - T.let( - :enabled, - ModerationAPI::WebhookEvent::AuthorTrustLevelChanged::Data::Object::Status::TaggedSymbol - ) - SUSPENDED = - T.let( - :suspended, - ModerationAPI::WebhookEvent::AuthorTrustLevelChanged::Data::Object::Status::TaggedSymbol - ) - BLOCKED = - T.let( - :blocked, - ModerationAPI::WebhookEvent::AuthorTrustLevelChanged::Data::Object::Status::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - ModerationAPI::WebhookEvent::AuthorTrustLevelChanged::Data::Object::Status::TaggedSymbol - ] - ) - end - def self.values - end - end - - class TrustLevel < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::AuthorTrustLevelChanged::Data::Object::TrustLevel, - ModerationAPI::Internal::AnyHash - ) - end - - # Author trust level (-1, 0, 1, 2, 3, or 4) - sig { returns(Float) } - attr_accessor :level - - # True if the trust level was set manually by a moderator - sig { returns(T::Boolean) } - attr_accessor :manual - - sig do - params(level: Float, manual: T::Boolean).returns( - T.attached_class - ) - end - def self.new( - # Author trust level (-1, 0, 1, 2, 3, or 4) - level:, - # True if the trust level was set manually by a moderator - manual: - ) - end - - sig { override.returns({ level: Float, manual: T::Boolean }) } - def to_hash - end - end - end - end - end - - class AuthorAction < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::AuthorAction, - ModerationAPI::Internal::AnyHash - ) - end - - # Stable event ID. Use this to dedupe retries. - sig { returns(String) } - attr_accessor :id - - sig { returns(Symbol) } - attr_accessor :api_version - - # ISO 8601 timestamp of when the event was emitted. - sig { returns(Time) } - attr_accessor :created - - sig { returns(ModerationAPI::WebhookEvent::AuthorAction::Data) } - attr_reader :data - - sig do - params( - data: ModerationAPI::WebhookEvent::AuthorAction::Data::OrHash - ).void - end - attr_writer :data - - # The event type. - sig { returns(Symbol) } - attr_accessor :type - - sig do - params( - id: String, - created: Time, - data: ModerationAPI::WebhookEvent::AuthorAction::Data::OrHash, - api_version: Symbol, - type: Symbol - ).returns(T.attached_class) - end - def self.new( - # Stable event ID. Use this to dedupe retries. - id:, - # ISO 8601 timestamp of when the event was emitted. - created:, - data:, - api_version: :v2, - # The event type. - type: :"author.action" - ) - end - - sig do - override.returns( - { - id: String, - api_version: Symbol, - created: Time, - data: ModerationAPI::WebhookEvent::AuthorAction::Data, - type: Symbol - } - ) - end - def to_hash - end - - class Data < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::AuthorAction::Data, - ModerationAPI::Internal::AnyHash - ) - end - - sig do - returns(ModerationAPI::WebhookEvent::AuthorAction::Data::Object) - end - attr_reader :object - - sig do - params( - object: - ModerationAPI::WebhookEvent::AuthorAction::Data::Object::OrHash - ).void - end - attr_writer :object - - sig do - params( - object: - ModerationAPI::WebhookEvent::AuthorAction::Data::Object::OrHash - ).returns(T.attached_class) - end - def self.new(object:) - end - - sig do - override.returns( - { - object: ModerationAPI::WebhookEvent::AuthorAction::Data::Object - } - ) - end - def to_hash - end - - class Object < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::AuthorAction::Data::Object, - ModerationAPI::Internal::AnyHash - ) - end - - # Moderation action ID - sig { returns(String) } - attr_accessor :id - - # The author the action was performed on - sig do - returns( - ModerationAPI::WebhookEvent::AuthorAction::Data::Object::Author - ) - end - attr_reader :author - - sig do - params( - author: - ModerationAPI::WebhookEvent::AuthorAction::Data::Object::Author::OrHash - ).void - end - attr_writer :author - - # ISO 8601 timestamp of when the action was performed - sig { returns(Time) } - attr_accessor :created_at - - # Customer-defined key identifying this action - sig { returns(T.nilable(String)) } - attr_accessor :key - - # Display name of the action - sig { returns(T.nilable(String)) } - attr_accessor :name - - # The value passed to the action when it ran - sig { returns(T.nilable(String)) } - attr_accessor :value - - # The queue the item belongs to, if any - sig do - returns( - T.nilable( - ModerationAPI::WebhookEvent::AuthorAction::Data::Object::Queue - ) - ) - end - attr_reader :queue - - sig do - params( - queue: - ModerationAPI::WebhookEvent::AuthorAction::Data::Object::Queue::OrHash - ).void - end - attr_writer :queue - - sig do - params( - id: String, - author: - ModerationAPI::WebhookEvent::AuthorAction::Data::Object::Author::OrHash, - created_at: Time, - key: T.nilable(String), - name: T.nilable(String), - value: T.nilable(String), - queue: - ModerationAPI::WebhookEvent::AuthorAction::Data::Object::Queue::OrHash - ).returns(T.attached_class) - end - def self.new( - # Moderation action ID - id:, - # The author the action was performed on - author:, - # ISO 8601 timestamp of when the action was performed - created_at:, - # Customer-defined key identifying this action - key:, - # Display name of the action - name:, - # The value passed to the action when it ran - value:, - # The queue the item belongs to, if any - queue: nil - ) - end - - sig do - override.returns( - { - id: String, - author: - ModerationAPI::WebhookEvent::AuthorAction::Data::Object::Author, - created_at: Time, - key: T.nilable(String), - name: T.nilable(String), - value: T.nilable(String), - queue: - ModerationAPI::WebhookEvent::AuthorAction::Data::Object::Queue - } - ) - end - def to_hash - end - - class Author < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::AuthorAction::Data::Object::Author, - ModerationAPI::Internal::AnyHash - ) - end - - # Author ID in Moderation API - sig { returns(String) } - attr_accessor :id - - # Block or suspension details, if applicable. Null if the author is enabled. - sig do - returns( - T.nilable( - ModerationAPI::WebhookEvent::AuthorAction::Data::Object::Author::Block - ) - ) - end - attr_reader :block - - sig do - params( - block: - T.nilable( - ModerationAPI::WebhookEvent::AuthorAction::Data::Object::Author::Block::OrHash - ) - ).void - end - attr_writer :block - - # Timestamp when author first appeared - sig { returns(Float) } - attr_accessor :first_seen - - # Timestamp of last activity - sig { returns(Float) } - attr_accessor :last_seen - - # Additional metadata provided by your system. We recommend including any relevant - # information that may assist in the moderation process. - sig do - returns( - ModerationAPI::WebhookEvent::AuthorAction::Data::Object::Author::Metadata - ) - end - attr_reader :metadata - - sig do - params( - metadata: - ModerationAPI::WebhookEvent::AuthorAction::Data::Object::Author::Metadata::OrHash - ).void - end - attr_writer :metadata - - sig do - returns( - ModerationAPI::WebhookEvent::AuthorAction::Data::Object::Author::Metrics - ) - end - attr_reader :metrics - - sig do - params( - metrics: - ModerationAPI::WebhookEvent::AuthorAction::Data::Object::Author::Metrics::OrHash - ).void - end - attr_writer :metrics - - # Risk assessment details, if available. - sig do - returns( - T.nilable( - ModerationAPI::WebhookEvent::AuthorAction::Data::Object::Author::RiskEvaluation - ) - ) - end - attr_reader :risk_evaluation - - sig do - params( - risk_evaluation: - T.nilable( - ModerationAPI::WebhookEvent::AuthorAction::Data::Object::Author::RiskEvaluation::OrHash - ) - ).void - end - attr_writer :risk_evaluation - - # Current author status - sig do - returns( - ModerationAPI::WebhookEvent::AuthorAction::Data::Object::Author::Status::OrSymbol - ) - end - attr_accessor :status - - sig do - returns( - ModerationAPI::WebhookEvent::AuthorAction::Data::Object::Author::TrustLevel - ) - end - attr_reader :trust_level - - sig do - params( - trust_level: - ModerationAPI::WebhookEvent::AuthorAction::Data::Object::Author::TrustLevel::OrHash - ).void - end - attr_writer :trust_level - - # The author's company or organization - sig { returns(T.nilable(String)) } - attr_accessor :company - - # Author email address - sig { returns(T.nilable(String)) } - attr_accessor :email - - # The author's ID from your system - sig { returns(T.nilable(String)) } - attr_accessor :external_id - - # URL of the author's external profile - sig { returns(T.nilable(String)) } - attr_accessor :external_link - - # Timestamp of last incident - sig { returns(T.nilable(Float)) } - attr_accessor :last_incident - - # Author name or identifier - sig { returns(T.nilable(String)) } - attr_accessor :name - - # URL of the author's profile picture - sig { returns(T.nilable(String)) } - attr_accessor :profile_picture - - # The author the action was performed on - sig do - params( - id: String, - block: - T.nilable( - ModerationAPI::WebhookEvent::AuthorAction::Data::Object::Author::Block::OrHash - ), - first_seen: Float, - last_seen: Float, - metadata: - ModerationAPI::WebhookEvent::AuthorAction::Data::Object::Author::Metadata::OrHash, - metrics: - ModerationAPI::WebhookEvent::AuthorAction::Data::Object::Author::Metrics::OrHash, - risk_evaluation: - T.nilable( - ModerationAPI::WebhookEvent::AuthorAction::Data::Object::Author::RiskEvaluation::OrHash - ), - status: - ModerationAPI::WebhookEvent::AuthorAction::Data::Object::Author::Status::OrSymbol, - trust_level: - ModerationAPI::WebhookEvent::AuthorAction::Data::Object::Author::TrustLevel::OrHash, - company: T.nilable(String), - email: T.nilable(String), - external_id: T.nilable(String), - external_link: T.nilable(String), - last_incident: T.nilable(Float), - name: T.nilable(String), - profile_picture: T.nilable(String) - ).returns(T.attached_class) - end - def self.new( - # Author ID in Moderation API - id:, - # Block or suspension details, if applicable. Null if the author is enabled. - block:, - # Timestamp when author first appeared - first_seen:, - # Timestamp of last activity - last_seen:, - # Additional metadata provided by your system. We recommend including any relevant - # information that may assist in the moderation process. - metadata:, - metrics:, - # Risk assessment details, if available. - risk_evaluation:, - # Current author status - status:, - trust_level:, - # The author's company or organization - company: nil, - # Author email address - email: nil, - # The author's ID from your system - external_id: nil, - # URL of the author's external profile - external_link: nil, - # Timestamp of last incident - last_incident: nil, - # Author name or identifier - name: nil, - # URL of the author's profile picture - profile_picture: nil - ) - end - - sig do - override.returns( - { - id: String, - block: - T.nilable( - ModerationAPI::WebhookEvent::AuthorAction::Data::Object::Author::Block - ), - first_seen: Float, - last_seen: Float, - metadata: - ModerationAPI::WebhookEvent::AuthorAction::Data::Object::Author::Metadata, - metrics: - ModerationAPI::WebhookEvent::AuthorAction::Data::Object::Author::Metrics, - risk_evaluation: - T.nilable( - ModerationAPI::WebhookEvent::AuthorAction::Data::Object::Author::RiskEvaluation - ), - status: - ModerationAPI::WebhookEvent::AuthorAction::Data::Object::Author::Status::OrSymbol, - trust_level: - ModerationAPI::WebhookEvent::AuthorAction::Data::Object::Author::TrustLevel, - company: T.nilable(String), - email: T.nilable(String), - external_id: T.nilable(String), - external_link: T.nilable(String), - last_incident: T.nilable(Float), - name: T.nilable(String), - profile_picture: T.nilable(String) - } - ) - end - def to_hash - end - - class Block < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::AuthorAction::Data::Object::Author::Block, - ModerationAPI::Internal::AnyHash - ) - end - - # The moderators reason why the author was blocked or suspended. - sig { returns(T.nilable(String)) } - attr_accessor :reason - - # The timestamp until which they are blocked if the author is suspended. - sig { returns(T.nilable(Float)) } - attr_accessor :until_ - - # Block or suspension details, if applicable. Null if the author is enabled. - sig do - params( - reason: T.nilable(String), - until_: T.nilable(Float) - ).returns(T.attached_class) - end - def self.new( - # The moderators reason why the author was blocked or suspended. - reason: nil, - # The timestamp until which they are blocked if the author is suspended. - until_: nil - ) - end - - sig do - override.returns( - { reason: T.nilable(String), until_: T.nilable(Float) } - ) - end - def to_hash - end - end - - class Metadata < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::AuthorAction::Data::Object::Author::Metadata, - ModerationAPI::Internal::AnyHash - ) - end - - # Whether the author's email is verified - sig { returns(T.nilable(T::Boolean)) } - attr_accessor :email_verified - - # Whether the author's identity is verified - sig { returns(T.nilable(T::Boolean)) } - attr_accessor :identity_verified - - # Whether the author is a paying customer - sig { returns(T.nilable(T::Boolean)) } - attr_accessor :is_paying_customer - - # Whether the author's phone number is verified - sig { returns(T.nilable(T::Boolean)) } - attr_accessor :phone_verified - - # Additional metadata provided by your system. We recommend including any relevant - # information that may assist in the moderation process. - sig do - params( - email_verified: T.nilable(T::Boolean), - identity_verified: T.nilable(T::Boolean), - is_paying_customer: T.nilable(T::Boolean), - phone_verified: T.nilable(T::Boolean) - ).returns(T.attached_class) - end - def self.new( - # Whether the author's email is verified - email_verified: nil, - # Whether the author's identity is verified - identity_verified: nil, - # Whether the author is a paying customer - is_paying_customer: nil, - # Whether the author's phone number is verified - phone_verified: nil - ) - end - - sig do - override.returns( - { - email_verified: T.nilable(T::Boolean), - identity_verified: T.nilable(T::Boolean), - is_paying_customer: T.nilable(T::Boolean), - phone_verified: T.nilable(T::Boolean) - } - ) - end - def to_hash - end - end - - class Metrics < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::AuthorAction::Data::Object::Author::Metrics, - ModerationAPI::Internal::AnyHash - ) - end - - # Number of flagged content pieces - sig { returns(Float) } - attr_accessor :flagged_content - - # Total pieces of content - sig { returns(Float) } - attr_accessor :total_content - - # Average sentiment score of content (-1 to 1). Requires a sentiment model in your - # project. - sig { returns(T.nilable(Float)) } - attr_accessor :average_sentiment - - sig do - params( - flagged_content: Float, - total_content: Float, - average_sentiment: T.nilable(Float) - ).returns(T.attached_class) - end - def self.new( - # Number of flagged content pieces - flagged_content:, - # Total pieces of content - total_content:, - # Average sentiment score of content (-1 to 1). Requires a sentiment model in your - # project. - average_sentiment: nil - ) - end - - sig do - override.returns( - { - flagged_content: Float, - total_content: Float, - average_sentiment: T.nilable(Float) - } - ) - end - def to_hash - end - end - - class RiskEvaluation < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::AuthorAction::Data::Object::Author::RiskEvaluation, - ModerationAPI::Internal::AnyHash - ) - end - - # Calculated risk level based on more than 10 behavioral signals. - sig { returns(T.nilable(Float)) } - attr_accessor :risk_level - - # Risk assessment details, if available. - sig do - params(risk_level: T.nilable(Float)).returns(T.attached_class) - end - def self.new( - # Calculated risk level based on more than 10 behavioral signals. - risk_level: nil - ) - end - - sig { override.returns({ risk_level: T.nilable(Float) }) } - def to_hash - end - end - - # Current author status - module Status - extend ModerationAPI::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all( - Symbol, - ModerationAPI::WebhookEvent::AuthorAction::Data::Object::Author::Status - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - ENABLED = - T.let( - :enabled, - ModerationAPI::WebhookEvent::AuthorAction::Data::Object::Author::Status::TaggedSymbol - ) - SUSPENDED = - T.let( - :suspended, - ModerationAPI::WebhookEvent::AuthorAction::Data::Object::Author::Status::TaggedSymbol - ) - BLOCKED = - T.let( - :blocked, - ModerationAPI::WebhookEvent::AuthorAction::Data::Object::Author::Status::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - ModerationAPI::WebhookEvent::AuthorAction::Data::Object::Author::Status::TaggedSymbol - ] - ) - end - def self.values - end - end - - class TrustLevel < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::AuthorAction::Data::Object::Author::TrustLevel, - ModerationAPI::Internal::AnyHash - ) - end - - # Author trust level (-1, 0, 1, 2, 3, or 4) - sig { returns(Float) } - attr_accessor :level - - # True if the trust level was set manually by a moderator - sig { returns(T::Boolean) } - attr_accessor :manual - - sig do - params(level: Float, manual: T::Boolean).returns( - T.attached_class - ) - end - def self.new( - # Author trust level (-1, 0, 1, 2, 3, or 4) - level:, - # True if the trust level was set manually by a moderator - manual: - ) - end - - sig { override.returns({ level: Float, manual: T::Boolean }) } - def to_hash - end - end - end - - class Queue < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::AuthorAction::Data::Object::Queue, - ModerationAPI::Internal::AnyHash - ) - end - - sig { returns(String) } - attr_accessor :id - - # The queue the item belongs to, if any - sig { params(id: String).returns(T.attached_class) } - def self.new(id:) - end - - sig { override.returns({ id: String }) } - def to_hash - end - end - end - end - end - - class QueueItemResolved < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::QueueItemResolved, - ModerationAPI::Internal::AnyHash - ) - end - - # Stable event ID. Use this to dedupe retries. - sig { returns(String) } - attr_accessor :id - - sig { returns(Symbol) } - attr_accessor :api_version - - # ISO 8601 timestamp of when the event was emitted. - sig { returns(Time) } - attr_accessor :created - - sig { returns(ModerationAPI::WebhookEvent::QueueItemResolved::Data) } - attr_reader :data - - sig do - params( - data: ModerationAPI::WebhookEvent::QueueItemResolved::Data::OrHash - ).void - end - attr_writer :data - - # The event type. - sig { returns(Symbol) } - attr_accessor :type - - sig do - params( - id: String, - created: Time, - data: ModerationAPI::WebhookEvent::QueueItemResolved::Data::OrHash, - api_version: Symbol, - type: Symbol - ).returns(T.attached_class) - end - def self.new( - # Stable event ID. Use this to dedupe retries. - id:, - # ISO 8601 timestamp of when the event was emitted. - created:, - data:, - api_version: :v2, - # The event type. - type: :"queue_item.resolved" - ) - end - - sig do - override.returns( - { - id: String, - api_version: Symbol, - created: Time, - data: ModerationAPI::WebhookEvent::QueueItemResolved::Data, - type: Symbol - } - ) - end - def to_hash - end - - class Data < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::QueueItemResolved::Data, - ModerationAPI::Internal::AnyHash - ) - end - - sig do - returns( - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object - ) - end - attr_reader :object - - sig do - params( - object: - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::OrHash - ).void - end - attr_writer :object - - sig do - params( - object: - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::OrHash - ).returns(T.attached_class) - end - def self.new(object:) - end - - sig do - override.returns( - { - object: - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object - } - ) - end - def to_hash - end - - class Object < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object, - ModerationAPI::Internal::AnyHash - ) - end - - sig do - returns( - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item - ) - end - attr_reader :item - - sig do - params( - item: - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::OrHash - ).void - end - attr_writer :item - - sig do - returns( - T.nilable( - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Author - ) - ) - end - attr_reader :author - - sig do - params( - author: - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Author::OrHash - ).void - end - attr_writer :author - - sig do - returns( - T.nilable( - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Queue - ) - ) - end - attr_reader :queue - - sig do - params( - queue: - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Queue::OrHash - ).void - end - attr_writer :queue - - sig do - params( - item: - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::OrHash, - author: - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Author::OrHash, - queue: - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Queue::OrHash - ).returns(T.attached_class) - end - def self.new(item:, author: nil, queue: nil) - end - - sig do - override.returns( - { - item: - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item, - author: - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Author, - queue: - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Queue - } - ) - end - def to_hash - end - - class Item < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item, - ModerationAPI::Internal::AnyHash - ) - end - - # Content ID from your system - sig { returns(String) } - attr_accessor :id - - # External author ID (the customer's identifier, not Moderation API's internal id) - sig { returns(T.nilable(String)) } - attr_accessor :author_id - - # The channel the content was submitted to, identified by your customer-defined - # channel key. - sig { returns(T.nilable(String)) } - attr_accessor :channel_key - - # A recommendation from your own client-side flagging. - sig do - returns( - T.nilable( - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::ClientAction - ) - ) - end - attr_reader :client_action - - sig do - params( - client_action: - T.nilable( - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::ClientAction::OrHash - ) - ).void - end - attr_writer :client_action - - # The original content payload - sig do - returns( - T.any( - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::Content::Text, - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::Content::Image, - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::Content::Video, - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::Content::Audio, - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::Content::Object - ) - ) - end - attr_accessor :content - - # Conversation grouping ID, if any - sig { returns(T.nilable(String)) } - attr_accessor :conversation_id - - # Whether the content was flagged by moderation - sig { returns(T.nilable(T::Boolean)) } - attr_accessor :flagged - - # For object content, the field keys (e.g. "bio") that triggered a flag. Empty - # when no fields were flagged or the content is not an object. - sig { returns(T::Array[String]) } - attr_accessor :flagged_fields - - # Moderation labels applied to the content - sig do - returns( - T.nilable( - T::Array[ - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::Label - ] - ) - ) - end - attr_accessor :labels - - # Detected ISO language code, if available - sig { returns(T.nilable(String)) } - attr_accessor :language - - # High-level content type (e.g. message, post, comment). Defaults to the channel's - # configured content type but can be overridden per request via the moderation API - # `type` field. - sig do - returns( - T.nilable( - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::MetaType::OrSymbol - ) - ) - end - attr_accessor :meta_type - - # Arbitrary key/value metadata. Top-level keys are strings. - sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } - attr_accessor :metadata - - # ISO 8601 timestamp of when the content was submitted - sig { returns(Time) } - attr_accessor :timestamp - - sig do - params( - id: String, - author_id: T.nilable(String), - channel_key: T.nilable(String), - client_action: - T.nilable( - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::ClientAction::OrHash - ), - content: - T.any( - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::Content::Text::OrHash, - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::Content::Image::OrHash, - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::Content::Video::OrHash, - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::Content::Audio::OrHash, - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::Content::Object::OrHash - ), - conversation_id: T.nilable(String), - flagged: T.nilable(T::Boolean), - flagged_fields: T::Array[String], - labels: - T.nilable( - T::Array[ - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::Label::OrHash - ] - ), - language: T.nilable(String), - meta_type: - T.nilable( - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::MetaType::OrSymbol - ), - metadata: T.nilable(T::Hash[Symbol, T.anything]), - timestamp: Time - ).returns(T.attached_class) - end - def self.new( - # Content ID from your system - id:, - # External author ID (the customer's identifier, not Moderation API's internal id) - author_id:, - # The channel the content was submitted to, identified by your customer-defined - # channel key. - channel_key:, - # A recommendation from your own client-side flagging. - client_action:, - # The original content payload - content:, - # Conversation grouping ID, if any - conversation_id:, - # Whether the content was flagged by moderation - flagged:, - # For object content, the field keys (e.g. "bio") that triggered a flag. Empty - # when no fields were flagged or the content is not an object. - flagged_fields:, - # Moderation labels applied to the content - labels:, - # Detected ISO language code, if available - language:, - # High-level content type (e.g. message, post, comment). Defaults to the channel's - # configured content type but can be overridden per request via the moderation API - # `type` field. - meta_type:, - # Arbitrary key/value metadata. Top-level keys are strings. - metadata:, - # ISO 8601 timestamp of when the content was submitted - timestamp: - ) - end - - sig do - override.returns( - { - id: String, - author_id: T.nilable(String), - channel_key: T.nilable(String), - client_action: - T.nilable( - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::ClientAction - ), - content: - T.any( - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::Content::Text, - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::Content::Image, - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::Content::Video, - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::Content::Audio, - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::Content::Object - ), - conversation_id: T.nilable(String), - flagged: T.nilable(T::Boolean), - flagged_fields: T::Array[String], - labels: - T.nilable( - T::Array[ - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::Label - ] - ), - language: T.nilable(String), - meta_type: - T.nilable( - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::MetaType::OrSymbol - ), - metadata: T.nilable(T::Hash[Symbol, T.anything]), - timestamp: Time - } - ) - end - def to_hash - end - - class ClientAction < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::ClientAction, - ModerationAPI::Internal::AnyHash - ) - end - - # Your recommendation for the content: allow, review, or reject. - sig do - returns( - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::ClientAction::Action::OrSymbol - ) - end - attr_accessor :action - - # How your recommendation combines with ours. Defaults to 'escalate', which only - # applies it when stricter than ours; 'override' replaces ours outright. - sig do - returns( - T.nilable( - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::ClientAction::Behavior::OrSymbol - ) - ) - end - attr_reader :behavior - - sig do - params( - behavior: - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::ClientAction::Behavior::OrSymbol - ).void - end - attr_writer :behavior - - # A human-readable explanation for your recommendation. - sig { returns(T.nilable(String)) } - attr_reader :reason - - sig { params(reason: String).void } - attr_writer :reason - - # Where your recommendation came from, e.g. "banned-ip". - sig { returns(T.nilable(String)) } - attr_reader :source - - sig { params(source: String).void } - attr_writer :source - - # A recommendation from your own client-side flagging. - sig do - params( - action: - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::ClientAction::Action::OrSymbol, - behavior: - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::ClientAction::Behavior::OrSymbol, - reason: String, - source: String - ).returns(T.attached_class) - end - def self.new( - # Your recommendation for the content: allow, review, or reject. - action:, - # How your recommendation combines with ours. Defaults to 'escalate', which only - # applies it when stricter than ours; 'override' replaces ours outright. - behavior: nil, - # A human-readable explanation for your recommendation. - reason: nil, - # Where your recommendation came from, e.g. "banned-ip". - source: nil - ) - end - - sig do - override.returns( - { - action: - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::ClientAction::Action::OrSymbol, - behavior: - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::ClientAction::Behavior::OrSymbol, - reason: String, - source: String - } - ) - end - def to_hash - end - - # Your recommendation for the content: allow, review, or reject. - module Action - extend ModerationAPI::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all( - Symbol, - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::ClientAction::Action - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - REVIEW = - T.let( - :review, - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::ClientAction::Action::TaggedSymbol - ) - ALLOW = - T.let( - :allow, - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::ClientAction::Action::TaggedSymbol - ) - REJECT = - T.let( - :reject, - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::ClientAction::Action::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::ClientAction::Action::TaggedSymbol - ] - ) - end - def self.values - end - end - - # How your recommendation combines with ours. Defaults to 'escalate', which only - # applies it when stricter than ours; 'override' replaces ours outright. - module Behavior - extend ModerationAPI::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all( - Symbol, - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::ClientAction::Behavior - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - OVERRIDE = - T.let( - :override, - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::ClientAction::Behavior::TaggedSymbol - ) - ESCALATE = - T.let( - :escalate, - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::ClientAction::Behavior::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::ClientAction::Behavior::TaggedSymbol - ] - ) - end - def self.values - end - end - end - - # The original content payload - module Content - extend ModerationAPI::Internal::Type::Union - - Variants = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::Content::Text, - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::Content::Image, - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::Content::Video, - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::Content::Audio, - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::Content::Object - ) - end - - class Text < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::Content::Text, - ModerationAPI::Internal::AnyHash - ) - end - - # The content text - sig { returns(String) } - attr_accessor :text - - sig { returns(Symbol) } - attr_accessor :type - - # Text - sig do - params(text: String, type: Symbol).returns(T.attached_class) - end - def self.new( - # The content text - text:, - type: :text - ) - end - - sig { override.returns({ text: String, type: Symbol }) } - def to_hash - end - end - - class Image < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::Content::Image, - ModerationAPI::Internal::AnyHash - ) - end - - sig { returns(Symbol) } - attr_accessor :type - - # Base64-encoded image data. Either url or data must be provided. Note: base64 - # images are not stored and will not appear in the review queue. - sig { returns(T.nilable(String)) } - attr_reader :data - - sig { params(data: String).void } - attr_writer :data - - # A public URL of the image content. Either url or data must be provided. - sig { returns(T.nilable(String)) } - attr_reader :url - - sig { params(url: String).void } - attr_writer :url - - # Image - sig do - params(data: String, url: String, type: Symbol).returns( - T.attached_class - ) - end - def self.new( - # Base64-encoded image data. Either url or data must be provided. Note: base64 - # images are not stored and will not appear in the review queue. - data: nil, - # A public URL of the image content. Either url or data must be provided. - url: nil, - type: :image - ) - end - - sig do - override.returns( - { type: Symbol, data: String, url: String } - ) - end - def to_hash - end - end - - class Video < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::Content::Video, - ModerationAPI::Internal::AnyHash - ) - end - - sig { returns(Symbol) } - attr_accessor :type - - # A public URL of the video content - sig { returns(String) } - attr_accessor :url - - # Video - sig do - params(url: String, type: Symbol).returns(T.attached_class) - end - def self.new( - # A public URL of the video content - url:, - type: :video - ) - end - - sig { override.returns({ type: Symbol, url: String }) } - def to_hash - end - end - - class Audio < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::Content::Audio, - ModerationAPI::Internal::AnyHash - ) - end - - sig { returns(Symbol) } - attr_accessor :type - - # The URL of the audio content - sig { returns(String) } - attr_accessor :url - - # Audio - sig do - params(url: String, type: Symbol).returns(T.attached_class) - end - def self.new( - # The URL of the audio content - url:, - type: :audio - ) - end - - sig { override.returns({ type: Symbol, url: String }) } - def to_hash - end - end - - class Object < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::Content::Object, - ModerationAPI::Internal::AnyHash - ) - end - - # Values in the object. Can be mixed content types. - sig do - returns( - T::Hash[ - Symbol, - T.any( - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::Content::Object::Data::Text, - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::Content::Object::Data::Image, - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::Content::Object::Data::Video, - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::Content::Object::Data::Audio - ) - ] - ) - end - attr_accessor :data - - sig { returns(Symbol) } - attr_accessor :type - - # Object - sig do - params( - data: - T::Hash[ - Symbol, - T.any( - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::Content::Object::Data::Text::OrHash, - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::Content::Object::Data::Image::OrHash, - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::Content::Object::Data::Video::OrHash, - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::Content::Object::Data::Audio::OrHash - ) - ], - type: Symbol - ).returns(T.attached_class) - end - def self.new( - # Values in the object. Can be mixed content types. - data:, - type: :object - ) - end - - sig do - override.returns( - { - data: - T::Hash[ - Symbol, - T.any( - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::Content::Object::Data::Text, - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::Content::Object::Data::Image, - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::Content::Object::Data::Video, - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::Content::Object::Data::Audio - ) - ], - type: Symbol - } - ) - end - def to_hash - end - - # Text - module Data - extend ModerationAPI::Internal::Type::Union - - Variants = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::Content::Object::Data::Text, - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::Content::Object::Data::Image, - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::Content::Object::Data::Video, - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::Content::Object::Data::Audio - ) - end - - class Text < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::Content::Object::Data::Text, - ModerationAPI::Internal::AnyHash - ) - end - - # The content text - sig { returns(String) } - attr_accessor :text - - sig { returns(Symbol) } - attr_accessor :type - - # Text - sig do - params(text: String, type: Symbol).returns( - T.attached_class - ) - end - def self.new( - # The content text - text:, - type: :text - ) - end - - sig { override.returns({ text: String, type: Symbol }) } - def to_hash - end - end - - class Image < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::Content::Object::Data::Image, - ModerationAPI::Internal::AnyHash - ) - end - - sig { returns(Symbol) } - attr_accessor :type - - # Base64-encoded image data. Either url or data must be provided. Note: base64 - # images are not stored and will not appear in the review queue. - sig { returns(T.nilable(String)) } - attr_reader :data - - sig { params(data: String).void } - attr_writer :data - - # A public URL of the image content. Either url or data must be provided. - sig { returns(T.nilable(String)) } - attr_reader :url - - sig { params(url: String).void } - attr_writer :url - - # Image - sig do - params(data: String, url: String, type: Symbol).returns( - T.attached_class - ) - end - def self.new( - # Base64-encoded image data. Either url or data must be provided. Note: base64 - # images are not stored and will not appear in the review queue. - data: nil, - # A public URL of the image content. Either url or data must be provided. - url: nil, - type: :image - ) - end - - sig do - override.returns( - { type: Symbol, data: String, url: String } - ) - end - def to_hash - end - end - - class Video < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::Content::Object::Data::Video, - ModerationAPI::Internal::AnyHash - ) - end - - sig { returns(Symbol) } - attr_accessor :type - - # A public URL of the video content - sig { returns(String) } - attr_accessor :url - - # Video - sig do - params(url: String, type: Symbol).returns( - T.attached_class - ) - end - def self.new( - # A public URL of the video content - url:, - type: :video - ) - end - - sig { override.returns({ type: Symbol, url: String }) } - def to_hash - end - end - - class Audio < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::Content::Object::Data::Audio, - ModerationAPI::Internal::AnyHash - ) - end - - sig { returns(Symbol) } - attr_accessor :type - - # The URL of the audio content - sig { returns(String) } - attr_accessor :url - - # Audio - sig do - params(url: String, type: Symbol).returns( - T.attached_class - ) - end - def self.new( - # The URL of the audio content - url:, - type: :audio - ) - end - - sig { override.returns({ type: Symbol, url: String }) } - def to_hash - end - end - - sig do - override.returns( - T::Array[ - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::Content::Object::Data::Variants - ] - ) - end - def self.variants - end - end - end - - sig do - override.returns( - T::Array[ - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::Content::Variants - ] - ) - end - def self.variants - end - end - - class Label < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::Label, - ModerationAPI::Internal::AnyHash - ) - end - - # The label name - sig { returns(String) } - attr_accessor :label - - # Confidence score between 0 and 1 - sig { returns(Float) } - attr_accessor :score - - # Whether this label crossed its flagging threshold - sig { returns(T.nilable(T::Boolean)) } - attr_reader :flagged - - sig { params(flagged: T::Boolean).void } - attr_writer :flagged - - # True if the label was applied manually by a moderator - sig { returns(T.nilable(T::Boolean)) } - attr_reader :manual - - sig { params(manual: T::Boolean).void } - attr_writer :manual - - sig do - returns( - T.nilable( - T::Array[ - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::Label::Match - ] - ) - ) - end - attr_reader :matches - - sig do - params( - matches: - T::Array[ - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::Label::Match::OrHash - ] - ).void - end - attr_writer :matches - - # Whether this label crossed its threshold under a shadowed policy — reported for - # visibility, never counted toward a flagging decision - sig { returns(T.nilable(T::Boolean)) } - attr_reader :shadow_flagged - - sig { params(shadow_flagged: T::Boolean).void } - attr_writer :shadow_flagged - - sig do - params( - label: String, - score: Float, - flagged: T::Boolean, - manual: T::Boolean, - matches: - T::Array[ - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::Label::Match::OrHash - ], - shadow_flagged: T::Boolean - ).returns(T.attached_class) - end - def self.new( - # The label name - label:, - # Confidence score between 0 and 1 - score:, - # Whether this label crossed its flagging threshold - flagged: nil, - # True if the label was applied manually by a moderator - manual: nil, - matches: nil, - # Whether this label crossed its threshold under a shadowed policy — reported for - # visibility, never counted toward a flagging decision - shadow_flagged: nil - ) - end - - sig do - override.returns( - { - label: String, - score: Float, - flagged: T::Boolean, - manual: T::Boolean, - matches: - T::Array[ - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::Label::Match - ], - shadow_flagged: T::Boolean - } - ) - end - def to_hash - end - - class Match < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::Label::Match, - ModerationAPI::Internal::AnyHash - ) - end - - # The matched substring - sig { returns(String) } - attr_accessor :match - - # Match confidence between 0 and 1 - sig { returns(Float) } - attr_accessor :probability - - # [start, end] character offsets in the source text - sig { returns(T::Array[T.anything]) } - attr_accessor :span - - sig { returns(T.nilable(String)) } - attr_reader :entity_type - - sig { params(entity_type: String).void } - attr_writer :entity_type - - sig { returns(T.nilable(String)) } - attr_accessor :mask - - sig { returns(T.nilable(T::Array[String])) } - attr_reader :reasons - - sig { params(reasons: T::Array[String]).void } - attr_writer :reasons - - sig { returns(T.nilable(T::Array[String])) } - attr_reader :scripts - - sig { params(scripts: T::Array[String]).void } - attr_writer :scripts - - sig do - returns( - T.nilable( - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::Label::Match::Signals - ) - ) - end - attr_reader :signals - - sig do - params( - signals: - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::Label::Match::Signals::OrHash - ).void - end - attr_writer :signals - - sig { returns(T.nilable(String)) } - attr_reader :skeleton - - sig { params(skeleton: String).void } - attr_writer :skeleton - - sig do - params( - match: String, - probability: Float, - span: T::Array[T.anything], - entity_type: String, - mask: T.nilable(String), - reasons: T::Array[String], - scripts: T::Array[String], - signals: - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::Label::Match::Signals::OrHash, - skeleton: String - ).returns(T.attached_class) - end - def self.new( - # The matched substring - match:, - # Match confidence between 0 and 1 - probability:, - # [start, end] character offsets in the source text - span:, - entity_type: nil, - mask: nil, - reasons: nil, - scripts: nil, - signals: nil, - skeleton: nil - ) - end - - sig do - override.returns( - { - match: String, - probability: Float, - span: T::Array[T.anything], - entity_type: String, - mask: T.nilable(String), - reasons: T::Array[String], - scripts: T::Array[String], - signals: - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::Label::Match::Signals, - skeleton: String - } - ) - end - def to_hash - end - - class Signals < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::Label::Match::Signals, - ModerationAPI::Internal::AnyHash - ) - end - - sig { returns(T.nilable(T::Boolean)) } - attr_accessor :bot_protection - - sig do - returns( - T.nilable( - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::Label::Match::Signals::BrandImpersonation - ) - ) - end - attr_reader :brand_impersonation - - sig do - params( - brand_impersonation: - T.nilable( - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::Label::Match::Signals::BrandImpersonation::OrHash - ) - ).void - end - attr_writer :brand_impersonation - - sig { returns(T.nilable(Float)) } - attr_accessor :domain_age_days - - sig { returns(T.nilable(String)) } - attr_accessor :final_url - - sig { returns(T.nilable(T::Boolean)) } - attr_accessor :has_email_setup - - sig { returns(T::Boolean) } - attr_accessor :has_suspicious_characters - - sig { returns(T::Boolean) } - attr_accessor :is_link_shortener - - sig { returns(T::Boolean) } - attr_accessor :is_reported - - sig { returns(T.nilable(Float)) } - attr_accessor :redirect_count - - sig do - params( - bot_protection: T.nilable(T::Boolean), - brand_impersonation: - T.nilable( - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::Label::Match::Signals::BrandImpersonation::OrHash - ), - domain_age_days: T.nilable(Float), - final_url: T.nilable(String), - has_email_setup: T.nilable(T::Boolean), - has_suspicious_characters: T::Boolean, - is_link_shortener: T::Boolean, - is_reported: T::Boolean, - redirect_count: T.nilable(Float) - ).returns(T.attached_class) - end - def self.new( - bot_protection:, - brand_impersonation:, - domain_age_days:, - final_url:, - has_email_setup:, - has_suspicious_characters:, - is_link_shortener:, - is_reported:, - redirect_count: - ) - end - - sig do - override.returns( - { - bot_protection: T.nilable(T::Boolean), - brand_impersonation: - T.nilable( - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::Label::Match::Signals::BrandImpersonation - ), - domain_age_days: T.nilable(Float), - final_url: T.nilable(String), - has_email_setup: T.nilable(T::Boolean), - has_suspicious_characters: T::Boolean, - is_link_shortener: T::Boolean, - is_reported: T::Boolean, - redirect_count: T.nilable(Float) - } - ) - end - def to_hash - end - - class BrandImpersonation < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::Label::Match::Signals::BrandImpersonation, - ModerationAPI::Internal::AnyHash - ) - end - - sig { returns(String) } - attr_accessor :brand - - sig { returns(String) } - attr_accessor :method_ - - sig do - params(brand: String, method_: String).returns( - T.attached_class - ) - end - def self.new(brand:, method_:) - end - - sig do - override.returns({ brand: String, method_: String }) - end - def to_hash - end - end - end - end - end - - # High-level content type (e.g. message, post, comment). Defaults to the channel's - # configured content type but can be overridden per request via the moderation API - # `type` field. - module MetaType - extend ModerationAPI::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all( - Symbol, - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::MetaType - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - PROFILE = - T.let( - :profile, - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::MetaType::TaggedSymbol - ) - MESSAGE = - T.let( - :message, - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::MetaType::TaggedSymbol - ) - POST = - T.let( - :post, - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::MetaType::TaggedSymbol - ) - COMMENT = - T.let( - :comment, - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::MetaType::TaggedSymbol - ) - EVENT = - T.let( - :event, - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::MetaType::TaggedSymbol - ) - PRODUCT = - T.let( - :product, - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::MetaType::TaggedSymbol - ) - REVIEW = - T.let( - :review, - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::MetaType::TaggedSymbol - ) - VOICE = - T.let( - :voice, - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::MetaType::TaggedSymbol - ) - OTHER = - T.let( - :other, - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::MetaType::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::MetaType::TaggedSymbol - ] - ) - end - def self.values - end - end - end - - class Author < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Author, - ModerationAPI::Internal::AnyHash - ) - end - - # Author ID in Moderation API - sig { returns(String) } - attr_accessor :id - - # Block or suspension details, if applicable. Null if the author is enabled. - sig do - returns( - T.nilable( - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Author::Block - ) - ) - end - attr_reader :block - - sig do - params( - block: - T.nilable( - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Author::Block::OrHash - ) - ).void - end - attr_writer :block - - # Timestamp when author first appeared - sig { returns(Float) } - attr_accessor :first_seen - - # Timestamp of last activity - sig { returns(Float) } - attr_accessor :last_seen - - # Additional metadata provided by your system. We recommend including any relevant - # information that may assist in the moderation process. - sig do - returns( - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Author::Metadata - ) - end - attr_reader :metadata - - sig do - params( - metadata: - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Author::Metadata::OrHash - ).void - end - attr_writer :metadata - - sig do - returns( - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Author::Metrics - ) - end - attr_reader :metrics - - sig do - params( - metrics: - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Author::Metrics::OrHash - ).void - end - attr_writer :metrics - - # Risk assessment details, if available. - sig do - returns( - T.nilable( - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Author::RiskEvaluation - ) - ) - end - attr_reader :risk_evaluation - - sig do - params( - risk_evaluation: - T.nilable( - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Author::RiskEvaluation::OrHash - ) - ).void - end - attr_writer :risk_evaluation - - # Current author status - sig do - returns( - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Author::Status::OrSymbol - ) - end - attr_accessor :status - - sig do - returns( - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Author::TrustLevel - ) - end - attr_reader :trust_level - - sig do - params( - trust_level: - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Author::TrustLevel::OrHash - ).void - end - attr_writer :trust_level - - # The author's company or organization - sig { returns(T.nilable(String)) } - attr_accessor :company - - # Author email address - sig { returns(T.nilable(String)) } - attr_accessor :email - - # The author's ID from your system - sig { returns(T.nilable(String)) } - attr_accessor :external_id - - # URL of the author's external profile - sig { returns(T.nilable(String)) } - attr_accessor :external_link - - # Timestamp of last incident - sig { returns(T.nilable(Float)) } - attr_accessor :last_incident - - # Author name or identifier - sig { returns(T.nilable(String)) } - attr_accessor :name - - # URL of the author's profile picture - sig { returns(T.nilable(String)) } - attr_accessor :profile_picture - - sig do - params( - id: String, - block: - T.nilable( - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Author::Block::OrHash - ), - first_seen: Float, - last_seen: Float, - metadata: - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Author::Metadata::OrHash, - metrics: - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Author::Metrics::OrHash, - risk_evaluation: - T.nilable( - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Author::RiskEvaluation::OrHash - ), - status: - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Author::Status::OrSymbol, - trust_level: - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Author::TrustLevel::OrHash, - company: T.nilable(String), - email: T.nilable(String), - external_id: T.nilable(String), - external_link: T.nilable(String), - last_incident: T.nilable(Float), - name: T.nilable(String), - profile_picture: T.nilable(String) - ).returns(T.attached_class) - end - def self.new( - # Author ID in Moderation API - id:, - # Block or suspension details, if applicable. Null if the author is enabled. - block:, - # Timestamp when author first appeared - first_seen:, - # Timestamp of last activity - last_seen:, - # Additional metadata provided by your system. We recommend including any relevant - # information that may assist in the moderation process. - metadata:, - metrics:, - # Risk assessment details, if available. - risk_evaluation:, - # Current author status - status:, - trust_level:, - # The author's company or organization - company: nil, - # Author email address - email: nil, - # The author's ID from your system - external_id: nil, - # URL of the author's external profile - external_link: nil, - # Timestamp of last incident - last_incident: nil, - # Author name or identifier - name: nil, - # URL of the author's profile picture - profile_picture: nil - ) - end - - sig do - override.returns( - { - id: String, - block: - T.nilable( - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Author::Block - ), - first_seen: Float, - last_seen: Float, - metadata: - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Author::Metadata, - metrics: - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Author::Metrics, - risk_evaluation: - T.nilable( - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Author::RiskEvaluation - ), - status: - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Author::Status::OrSymbol, - trust_level: - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Author::TrustLevel, - company: T.nilable(String), - email: T.nilable(String), - external_id: T.nilable(String), - external_link: T.nilable(String), - last_incident: T.nilable(Float), - name: T.nilable(String), - profile_picture: T.nilable(String) - } - ) - end - def to_hash - end - - class Block < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Author::Block, - ModerationAPI::Internal::AnyHash - ) - end - - # The moderators reason why the author was blocked or suspended. - sig { returns(T.nilable(String)) } - attr_accessor :reason - - # The timestamp until which they are blocked if the author is suspended. - sig { returns(T.nilable(Float)) } - attr_accessor :until_ - - # Block or suspension details, if applicable. Null if the author is enabled. - sig do - params( - reason: T.nilable(String), - until_: T.nilable(Float) - ).returns(T.attached_class) - end - def self.new( - # The moderators reason why the author was blocked or suspended. - reason: nil, - # The timestamp until which they are blocked if the author is suspended. - until_: nil - ) - end - - sig do - override.returns( - { reason: T.nilable(String), until_: T.nilable(Float) } - ) - end - def to_hash - end - end - - class Metadata < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Author::Metadata, - ModerationAPI::Internal::AnyHash - ) - end - - # Whether the author's email is verified - sig { returns(T.nilable(T::Boolean)) } - attr_accessor :email_verified - - # Whether the author's identity is verified - sig { returns(T.nilable(T::Boolean)) } - attr_accessor :identity_verified - - # Whether the author is a paying customer - sig { returns(T.nilable(T::Boolean)) } - attr_accessor :is_paying_customer - - # Whether the author's phone number is verified - sig { returns(T.nilable(T::Boolean)) } - attr_accessor :phone_verified - - # Additional metadata provided by your system. We recommend including any relevant - # information that may assist in the moderation process. - sig do - params( - email_verified: T.nilable(T::Boolean), - identity_verified: T.nilable(T::Boolean), - is_paying_customer: T.nilable(T::Boolean), - phone_verified: T.nilable(T::Boolean) - ).returns(T.attached_class) - end - def self.new( - # Whether the author's email is verified - email_verified: nil, - # Whether the author's identity is verified - identity_verified: nil, - # Whether the author is a paying customer - is_paying_customer: nil, - # Whether the author's phone number is verified - phone_verified: nil - ) - end - - sig do - override.returns( - { - email_verified: T.nilable(T::Boolean), - identity_verified: T.nilable(T::Boolean), - is_paying_customer: T.nilable(T::Boolean), - phone_verified: T.nilable(T::Boolean) - } - ) - end - def to_hash - end - end - - class Metrics < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Author::Metrics, - ModerationAPI::Internal::AnyHash - ) - end - - # Number of flagged content pieces - sig { returns(Float) } - attr_accessor :flagged_content - - # Total pieces of content - sig { returns(Float) } - attr_accessor :total_content - - # Average sentiment score of content (-1 to 1). Requires a sentiment model in your - # project. - sig { returns(T.nilable(Float)) } - attr_accessor :average_sentiment - - sig do - params( - flagged_content: Float, - total_content: Float, - average_sentiment: T.nilable(Float) - ).returns(T.attached_class) - end - def self.new( - # Number of flagged content pieces - flagged_content:, - # Total pieces of content - total_content:, - # Average sentiment score of content (-1 to 1). Requires a sentiment model in your - # project. - average_sentiment: nil - ) - end - - sig do - override.returns( - { - flagged_content: Float, - total_content: Float, - average_sentiment: T.nilable(Float) - } - ) - end - def to_hash - end - end - - class RiskEvaluation < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Author::RiskEvaluation, - ModerationAPI::Internal::AnyHash - ) - end - - # Calculated risk level based on more than 10 behavioral signals. - sig { returns(T.nilable(Float)) } - attr_accessor :risk_level - - # Risk assessment details, if available. - sig do - params(risk_level: T.nilable(Float)).returns(T.attached_class) - end - def self.new( - # Calculated risk level based on more than 10 behavioral signals. - risk_level: nil - ) - end - - sig { override.returns({ risk_level: T.nilable(Float) }) } - def to_hash - end - end - - # Current author status - module Status - extend ModerationAPI::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all( - Symbol, - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Author::Status - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - ENABLED = - T.let( - :enabled, - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Author::Status::TaggedSymbol - ) - SUSPENDED = - T.let( - :suspended, - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Author::Status::TaggedSymbol - ) - BLOCKED = - T.let( - :blocked, - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Author::Status::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Author::Status::TaggedSymbol - ] - ) - end - def self.values - end - end - - class TrustLevel < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Author::TrustLevel, - ModerationAPI::Internal::AnyHash - ) - end - - # Author trust level (-1, 0, 1, 2, 3, or 4) - sig { returns(Float) } - attr_accessor :level - - # True if the trust level was set manually by a moderator - sig { returns(T::Boolean) } - attr_accessor :manual - - sig do - params(level: Float, manual: T::Boolean).returns( - T.attached_class - ) - end - def self.new( - # Author trust level (-1, 0, 1, 2, 3, or 4) - level:, - # True if the trust level was set manually by a moderator - manual: - ) - end - - sig { override.returns({ level: Float, manual: T::Boolean }) } - def to_hash - end - end - end - - class Queue < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Queue, - ModerationAPI::Internal::AnyHash - ) - end - - sig { returns(String) } - attr_accessor :id - - sig { params(id: String).returns(T.attached_class) } - def self.new(id:) - end - - sig { override.returns({ id: String }) } - def to_hash - end - end - end - end - end - - class QueueItemAction < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::QueueItemAction, - ModerationAPI::Internal::AnyHash - ) - end - - # Stable event ID. Use this to dedupe retries. - sig { returns(String) } - attr_accessor :id - - sig { returns(Symbol) } - attr_accessor :api_version - - # ISO 8601 timestamp of when the event was emitted. - sig { returns(Time) } - attr_accessor :created - - sig { returns(ModerationAPI::WebhookEvent::QueueItemAction::Data) } - attr_reader :data - - sig do - params( - data: ModerationAPI::WebhookEvent::QueueItemAction::Data::OrHash - ).void - end - attr_writer :data - - # The event type. - sig { returns(Symbol) } - attr_accessor :type - - sig do - params( - id: String, - created: Time, - data: ModerationAPI::WebhookEvent::QueueItemAction::Data::OrHash, - api_version: Symbol, - type: Symbol - ).returns(T.attached_class) - end - def self.new( - # Stable event ID. Use this to dedupe retries. - id:, - # ISO 8601 timestamp of when the event was emitted. - created:, - data:, - api_version: :v2, - # The event type. - type: :"queue_item.action" - ) - end - - sig do - override.returns( - { - id: String, - api_version: Symbol, - created: Time, - data: ModerationAPI::WebhookEvent::QueueItemAction::Data, - type: Symbol - } - ) - end - def to_hash - end - - class Data < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::QueueItemAction::Data, - ModerationAPI::Internal::AnyHash - ) - end - - sig do - returns(ModerationAPI::WebhookEvent::QueueItemAction::Data::Object) - end - attr_reader :object - - sig do - params( - object: - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::OrHash - ).void - end - attr_writer :object - - sig do - params( - object: - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::OrHash - ).returns(T.attached_class) - end - def self.new(object:) - end - - sig do - override.returns( - { - object: - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object - } - ) - end - def to_hash - end - - class Object < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object, - ModerationAPI::Internal::AnyHash - ) - end - - # Moderation action ID - sig { returns(String) } - attr_accessor :id - - # ISO 8601 timestamp of when the action was performed - sig { returns(Time) } - attr_accessor :created_at - - # Customer-defined key identifying this action - sig { returns(T.nilable(String)) } - attr_accessor :key - - # Display name of the action - sig { returns(T.nilable(String)) } - attr_accessor :name - - # The value passed to the action when it ran - sig { returns(T.nilable(String)) } - attr_accessor :value - - # The author the action was performed on, if any - sig do - returns( - T.nilable( - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Author - ) - ) - end - attr_reader :author - - sig do - params( - author: - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Author::OrHash - ).void - end - attr_writer :author - - # The content item the action was performed on, if any - sig do - returns( - T.nilable( - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item - ) - ) - end - attr_reader :item - - sig do - params( - item: - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::OrHash - ).void - end - attr_writer :item - - # The queue the item belongs to, if any - sig do - returns( - T.nilable( - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Queue - ) - ) - end - attr_reader :queue - - sig do - params( - queue: - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Queue::OrHash - ).void - end - attr_writer :queue - - sig do - params( - id: String, - created_at: Time, - key: T.nilable(String), - name: T.nilable(String), - value: T.nilable(String), - author: - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Author::OrHash, - item: - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::OrHash, - queue: - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Queue::OrHash - ).returns(T.attached_class) - end - def self.new( - # Moderation action ID - id:, - # ISO 8601 timestamp of when the action was performed - created_at:, - # Customer-defined key identifying this action - key:, - # Display name of the action - name:, - # The value passed to the action when it ran - value:, - # The author the action was performed on, if any - author: nil, - # The content item the action was performed on, if any - item: nil, - # The queue the item belongs to, if any - queue: nil - ) - end - - sig do - override.returns( - { - id: String, - created_at: Time, - key: T.nilable(String), - name: T.nilable(String), - value: T.nilable(String), - author: - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Author, - item: - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item, - queue: - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Queue - } - ) - end - def to_hash - end - - class Author < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Author, - ModerationAPI::Internal::AnyHash - ) - end - - # Author ID in Moderation API - sig { returns(String) } - attr_accessor :id - - # Block or suspension details, if applicable. Null if the author is enabled. - sig do - returns( - T.nilable( - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Author::Block - ) - ) - end - attr_reader :block - - sig do - params( - block: - T.nilable( - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Author::Block::OrHash - ) - ).void - end - attr_writer :block - - # Timestamp when author first appeared - sig { returns(Float) } - attr_accessor :first_seen - - # Timestamp of last activity - sig { returns(Float) } - attr_accessor :last_seen - - # Additional metadata provided by your system. We recommend including any relevant - # information that may assist in the moderation process. - sig do - returns( - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Author::Metadata - ) - end - attr_reader :metadata - - sig do - params( - metadata: - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Author::Metadata::OrHash - ).void - end - attr_writer :metadata - - sig do - returns( - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Author::Metrics - ) - end - attr_reader :metrics - - sig do - params( - metrics: - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Author::Metrics::OrHash - ).void - end - attr_writer :metrics - - # Risk assessment details, if available. - sig do - returns( - T.nilable( - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Author::RiskEvaluation - ) - ) - end - attr_reader :risk_evaluation - - sig do - params( - risk_evaluation: - T.nilable( - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Author::RiskEvaluation::OrHash - ) - ).void - end - attr_writer :risk_evaluation - - # Current author status - sig do - returns( - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Author::Status::OrSymbol - ) - end - attr_accessor :status - - sig do - returns( - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Author::TrustLevel - ) - end - attr_reader :trust_level - - sig do - params( - trust_level: - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Author::TrustLevel::OrHash - ).void - end - attr_writer :trust_level - - # The author's company or organization - sig { returns(T.nilable(String)) } - attr_accessor :company - - # Author email address - sig { returns(T.nilable(String)) } - attr_accessor :email - - # The author's ID from your system - sig { returns(T.nilable(String)) } - attr_accessor :external_id - - # URL of the author's external profile - sig { returns(T.nilable(String)) } - attr_accessor :external_link - - # Timestamp of last incident - sig { returns(T.nilable(Float)) } - attr_accessor :last_incident - - # Author name or identifier - sig { returns(T.nilable(String)) } - attr_accessor :name - - # URL of the author's profile picture - sig { returns(T.nilable(String)) } - attr_accessor :profile_picture - - # The author the action was performed on, if any - sig do - params( - id: String, - block: - T.nilable( - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Author::Block::OrHash - ), - first_seen: Float, - last_seen: Float, - metadata: - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Author::Metadata::OrHash, - metrics: - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Author::Metrics::OrHash, - risk_evaluation: - T.nilable( - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Author::RiskEvaluation::OrHash - ), - status: - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Author::Status::OrSymbol, - trust_level: - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Author::TrustLevel::OrHash, - company: T.nilable(String), - email: T.nilable(String), - external_id: T.nilable(String), - external_link: T.nilable(String), - last_incident: T.nilable(Float), - name: T.nilable(String), - profile_picture: T.nilable(String) - ).returns(T.attached_class) - end - def self.new( - # Author ID in Moderation API - id:, - # Block or suspension details, if applicable. Null if the author is enabled. - block:, - # Timestamp when author first appeared - first_seen:, - # Timestamp of last activity - last_seen:, - # Additional metadata provided by your system. We recommend including any relevant - # information that may assist in the moderation process. - metadata:, - metrics:, - # Risk assessment details, if available. - risk_evaluation:, - # Current author status - status:, - trust_level:, - # The author's company or organization - company: nil, - # Author email address - email: nil, - # The author's ID from your system - external_id: nil, - # URL of the author's external profile - external_link: nil, - # Timestamp of last incident - last_incident: nil, - # Author name or identifier - name: nil, - # URL of the author's profile picture - profile_picture: nil - ) - end - - sig do - override.returns( - { - id: String, - block: - T.nilable( - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Author::Block - ), - first_seen: Float, - last_seen: Float, - metadata: - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Author::Metadata, - metrics: - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Author::Metrics, - risk_evaluation: - T.nilable( - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Author::RiskEvaluation - ), - status: - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Author::Status::OrSymbol, - trust_level: - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Author::TrustLevel, - company: T.nilable(String), - email: T.nilable(String), - external_id: T.nilable(String), - external_link: T.nilable(String), - last_incident: T.nilable(Float), - name: T.nilable(String), - profile_picture: T.nilable(String) - } - ) - end - def to_hash - end - - class Block < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Author::Block, - ModerationAPI::Internal::AnyHash - ) - end - - # The moderators reason why the author was blocked or suspended. - sig { returns(T.nilable(String)) } - attr_accessor :reason - - # The timestamp until which they are blocked if the author is suspended. - sig { returns(T.nilable(Float)) } - attr_accessor :until_ - - # Block or suspension details, if applicable. Null if the author is enabled. - sig do - params( - reason: T.nilable(String), - until_: T.nilable(Float) - ).returns(T.attached_class) - end - def self.new( - # The moderators reason why the author was blocked or suspended. - reason: nil, - # The timestamp until which they are blocked if the author is suspended. - until_: nil - ) - end - - sig do - override.returns( - { reason: T.nilable(String), until_: T.nilable(Float) } - ) - end - def to_hash - end - end - - class Metadata < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Author::Metadata, - ModerationAPI::Internal::AnyHash - ) - end - - # Whether the author's email is verified - sig { returns(T.nilable(T::Boolean)) } - attr_accessor :email_verified - - # Whether the author's identity is verified - sig { returns(T.nilable(T::Boolean)) } - attr_accessor :identity_verified - - # Whether the author is a paying customer - sig { returns(T.nilable(T::Boolean)) } - attr_accessor :is_paying_customer - - # Whether the author's phone number is verified - sig { returns(T.nilable(T::Boolean)) } - attr_accessor :phone_verified - - # Additional metadata provided by your system. We recommend including any relevant - # information that may assist in the moderation process. - sig do - params( - email_verified: T.nilable(T::Boolean), - identity_verified: T.nilable(T::Boolean), - is_paying_customer: T.nilable(T::Boolean), - phone_verified: T.nilable(T::Boolean) - ).returns(T.attached_class) - end - def self.new( - # Whether the author's email is verified - email_verified: nil, - # Whether the author's identity is verified - identity_verified: nil, - # Whether the author is a paying customer - is_paying_customer: nil, - # Whether the author's phone number is verified - phone_verified: nil - ) - end - - sig do - override.returns( - { - email_verified: T.nilable(T::Boolean), - identity_verified: T.nilable(T::Boolean), - is_paying_customer: T.nilable(T::Boolean), - phone_verified: T.nilable(T::Boolean) - } - ) - end - def to_hash - end - end - - class Metrics < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Author::Metrics, - ModerationAPI::Internal::AnyHash - ) - end - - # Number of flagged content pieces - sig { returns(Float) } - attr_accessor :flagged_content - - # Total pieces of content - sig { returns(Float) } - attr_accessor :total_content - - # Average sentiment score of content (-1 to 1). Requires a sentiment model in your - # project. - sig { returns(T.nilable(Float)) } - attr_accessor :average_sentiment - - sig do - params( - flagged_content: Float, - total_content: Float, - average_sentiment: T.nilable(Float) - ).returns(T.attached_class) - end - def self.new( - # Number of flagged content pieces - flagged_content:, - # Total pieces of content - total_content:, - # Average sentiment score of content (-1 to 1). Requires a sentiment model in your - # project. - average_sentiment: nil - ) - end - - sig do - override.returns( - { - flagged_content: Float, - total_content: Float, - average_sentiment: T.nilable(Float) - } - ) - end - def to_hash - end - end - - class RiskEvaluation < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Author::RiskEvaluation, - ModerationAPI::Internal::AnyHash - ) - end - - # Calculated risk level based on more than 10 behavioral signals. - sig { returns(T.nilable(Float)) } - attr_accessor :risk_level - - # Risk assessment details, if available. - sig do - params(risk_level: T.nilable(Float)).returns(T.attached_class) - end - def self.new( - # Calculated risk level based on more than 10 behavioral signals. - risk_level: nil - ) - end - - sig { override.returns({ risk_level: T.nilable(Float) }) } - def to_hash - end - end - - # Current author status - module Status - extend ModerationAPI::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all( - Symbol, - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Author::Status - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - ENABLED = - T.let( - :enabled, - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Author::Status::TaggedSymbol - ) - SUSPENDED = - T.let( - :suspended, - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Author::Status::TaggedSymbol - ) - BLOCKED = - T.let( - :blocked, - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Author::Status::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Author::Status::TaggedSymbol - ] - ) - end - def self.values - end - end - - class TrustLevel < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Author::TrustLevel, - ModerationAPI::Internal::AnyHash - ) - end - - # Author trust level (-1, 0, 1, 2, 3, or 4) - sig { returns(Float) } - attr_accessor :level - - # True if the trust level was set manually by a moderator - sig { returns(T::Boolean) } - attr_accessor :manual - - sig do - params(level: Float, manual: T::Boolean).returns( - T.attached_class - ) - end - def self.new( - # Author trust level (-1, 0, 1, 2, 3, or 4) - level:, - # True if the trust level was set manually by a moderator - manual: - ) - end - - sig { override.returns({ level: Float, manual: T::Boolean }) } - def to_hash - end - end - end - - class Item < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item, - ModerationAPI::Internal::AnyHash - ) - end - - # Content ID from your system - sig { returns(String) } - attr_accessor :id - - # External author ID (the customer's identifier, not Moderation API's internal id) - sig { returns(T.nilable(String)) } - attr_accessor :author_id - - # The channel the content was submitted to, identified by your customer-defined - # channel key. - sig { returns(T.nilable(String)) } - attr_accessor :channel_key - - # A recommendation from your own client-side flagging. - sig do - returns( - T.nilable( - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::ClientAction - ) - ) - end - attr_reader :client_action - - sig do - params( - client_action: - T.nilable( - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::ClientAction::OrHash - ) - ).void - end - attr_writer :client_action - - # The original content payload - sig do - returns( - T.any( - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::Content::Text, - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::Content::Image, - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::Content::Video, - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::Content::Audio, - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::Content::Object - ) - ) - end - attr_accessor :content - - # Conversation grouping ID, if any - sig { returns(T.nilable(String)) } - attr_accessor :conversation_id - - # Whether the content was flagged by moderation - sig { returns(T.nilable(T::Boolean)) } - attr_accessor :flagged - - # For object content, the field keys (e.g. "bio") that triggered a flag. Empty - # when no fields were flagged or the content is not an object. - sig { returns(T::Array[String]) } - attr_accessor :flagged_fields - - # Moderation labels applied to the content - sig do - returns( - T.nilable( - T::Array[ - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::Label - ] - ) - ) - end - attr_accessor :labels - - # Detected ISO language code, if available - sig { returns(T.nilable(String)) } - attr_accessor :language - - # High-level content type (e.g. message, post, comment). Defaults to the channel's - # configured content type but can be overridden per request via the moderation API - # `type` field. - sig do - returns( - T.nilable( - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::MetaType::OrSymbol - ) - ) - end - attr_accessor :meta_type - - # Arbitrary key/value metadata. Top-level keys are strings. - sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } - attr_accessor :metadata - - # ISO 8601 timestamp of when the content was submitted - sig { returns(Time) } - attr_accessor :timestamp - - # The content item the action was performed on, if any - sig do - params( - id: String, - author_id: T.nilable(String), - channel_key: T.nilable(String), - client_action: - T.nilable( - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::ClientAction::OrHash - ), - content: - T.any( - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::Content::Text::OrHash, - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::Content::Image::OrHash, - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::Content::Video::OrHash, - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::Content::Audio::OrHash, - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::Content::Object::OrHash - ), - conversation_id: T.nilable(String), - flagged: T.nilable(T::Boolean), - flagged_fields: T::Array[String], - labels: - T.nilable( - T::Array[ - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::Label::OrHash - ] - ), - language: T.nilable(String), - meta_type: - T.nilable( - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::MetaType::OrSymbol - ), - metadata: T.nilable(T::Hash[Symbol, T.anything]), - timestamp: Time - ).returns(T.attached_class) - end - def self.new( - # Content ID from your system - id:, - # External author ID (the customer's identifier, not Moderation API's internal id) - author_id:, - # The channel the content was submitted to, identified by your customer-defined - # channel key. - channel_key:, - # A recommendation from your own client-side flagging. - client_action:, - # The original content payload - content:, - # Conversation grouping ID, if any - conversation_id:, - # Whether the content was flagged by moderation - flagged:, - # For object content, the field keys (e.g. "bio") that triggered a flag. Empty - # when no fields were flagged or the content is not an object. - flagged_fields:, - # Moderation labels applied to the content - labels:, - # Detected ISO language code, if available - language:, - # High-level content type (e.g. message, post, comment). Defaults to the channel's - # configured content type but can be overridden per request via the moderation API - # `type` field. - meta_type:, - # Arbitrary key/value metadata. Top-level keys are strings. - metadata:, - # ISO 8601 timestamp of when the content was submitted - timestamp: - ) - end - - sig do - override.returns( - { - id: String, - author_id: T.nilable(String), - channel_key: T.nilable(String), - client_action: - T.nilable( - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::ClientAction - ), - content: - T.any( - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::Content::Text, - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::Content::Image, - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::Content::Video, - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::Content::Audio, - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::Content::Object - ), - conversation_id: T.nilable(String), - flagged: T.nilable(T::Boolean), - flagged_fields: T::Array[String], - labels: - T.nilable( - T::Array[ - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::Label - ] - ), - language: T.nilable(String), - meta_type: - T.nilable( - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::MetaType::OrSymbol - ), - metadata: T.nilable(T::Hash[Symbol, T.anything]), - timestamp: Time - } - ) - end - def to_hash - end - - class ClientAction < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::ClientAction, - ModerationAPI::Internal::AnyHash - ) - end - - # Your recommendation for the content: allow, review, or reject. - sig do - returns( - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::ClientAction::Action::OrSymbol - ) - end - attr_accessor :action - - # How your recommendation combines with ours. Defaults to 'escalate', which only - # applies it when stricter than ours; 'override' replaces ours outright. - sig do - returns( - T.nilable( - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::ClientAction::Behavior::OrSymbol - ) - ) - end - attr_reader :behavior - - sig do - params( - behavior: - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::ClientAction::Behavior::OrSymbol - ).void - end - attr_writer :behavior - - # A human-readable explanation for your recommendation. - sig { returns(T.nilable(String)) } - attr_reader :reason - - sig { params(reason: String).void } - attr_writer :reason - - # Where your recommendation came from, e.g. "banned-ip". - sig { returns(T.nilable(String)) } - attr_reader :source - - sig { params(source: String).void } - attr_writer :source - - # A recommendation from your own client-side flagging. - sig do - params( - action: - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::ClientAction::Action::OrSymbol, - behavior: - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::ClientAction::Behavior::OrSymbol, - reason: String, - source: String - ).returns(T.attached_class) - end - def self.new( - # Your recommendation for the content: allow, review, or reject. - action:, - # How your recommendation combines with ours. Defaults to 'escalate', which only - # applies it when stricter than ours; 'override' replaces ours outright. - behavior: nil, - # A human-readable explanation for your recommendation. - reason: nil, - # Where your recommendation came from, e.g. "banned-ip". - source: nil - ) - end - - sig do - override.returns( - { - action: - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::ClientAction::Action::OrSymbol, - behavior: - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::ClientAction::Behavior::OrSymbol, - reason: String, - source: String - } - ) - end - def to_hash - end - - # Your recommendation for the content: allow, review, or reject. - module Action - extend ModerationAPI::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all( - Symbol, - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::ClientAction::Action - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - REVIEW = - T.let( - :review, - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::ClientAction::Action::TaggedSymbol - ) - ALLOW = - T.let( - :allow, - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::ClientAction::Action::TaggedSymbol - ) - REJECT = - T.let( - :reject, - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::ClientAction::Action::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::ClientAction::Action::TaggedSymbol - ] - ) - end - def self.values - end - end - - # How your recommendation combines with ours. Defaults to 'escalate', which only - # applies it when stricter than ours; 'override' replaces ours outright. - module Behavior - extend ModerationAPI::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all( - Symbol, - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::ClientAction::Behavior - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - OVERRIDE = - T.let( - :override, - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::ClientAction::Behavior::TaggedSymbol - ) - ESCALATE = - T.let( - :escalate, - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::ClientAction::Behavior::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::ClientAction::Behavior::TaggedSymbol - ] - ) - end - def self.values - end - end - end - - # The original content payload - module Content - extend ModerationAPI::Internal::Type::Union - - Variants = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::Content::Text, - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::Content::Image, - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::Content::Video, - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::Content::Audio, - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::Content::Object - ) - end - - class Text < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::Content::Text, - ModerationAPI::Internal::AnyHash - ) - end - - # The content text - sig { returns(String) } - attr_accessor :text - - sig { returns(Symbol) } - attr_accessor :type - - # Text - sig do - params(text: String, type: Symbol).returns(T.attached_class) - end - def self.new( - # The content text - text:, - type: :text - ) - end - - sig { override.returns({ text: String, type: Symbol }) } - def to_hash - end - end - - class Image < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::Content::Image, - ModerationAPI::Internal::AnyHash - ) - end - - sig { returns(Symbol) } - attr_accessor :type - - # Base64-encoded image data. Either url or data must be provided. Note: base64 - # images are not stored and will not appear in the review queue. - sig { returns(T.nilable(String)) } - attr_reader :data - - sig { params(data: String).void } - attr_writer :data - - # A public URL of the image content. Either url or data must be provided. - sig { returns(T.nilable(String)) } - attr_reader :url - - sig { params(url: String).void } - attr_writer :url - - # Image - sig do - params(data: String, url: String, type: Symbol).returns( - T.attached_class - ) - end - def self.new( - # Base64-encoded image data. Either url or data must be provided. Note: base64 - # images are not stored and will not appear in the review queue. - data: nil, - # A public URL of the image content. Either url or data must be provided. - url: nil, - type: :image - ) - end - - sig do - override.returns( - { type: Symbol, data: String, url: String } - ) - end - def to_hash - end - end - - class Video < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::Content::Video, - ModerationAPI::Internal::AnyHash - ) - end - - sig { returns(Symbol) } - attr_accessor :type - - # A public URL of the video content - sig { returns(String) } - attr_accessor :url - - # Video - sig do - params(url: String, type: Symbol).returns(T.attached_class) - end - def self.new( - # A public URL of the video content - url:, - type: :video - ) - end - - sig { override.returns({ type: Symbol, url: String }) } - def to_hash - end - end - - class Audio < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::Content::Audio, - ModerationAPI::Internal::AnyHash - ) - end - - sig { returns(Symbol) } - attr_accessor :type - - # The URL of the audio content - sig { returns(String) } - attr_accessor :url - - # Audio - sig do - params(url: String, type: Symbol).returns(T.attached_class) - end - def self.new( - # The URL of the audio content - url:, - type: :audio - ) - end - - sig { override.returns({ type: Symbol, url: String }) } - def to_hash - end - end - - class Object < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::Content::Object, - ModerationAPI::Internal::AnyHash - ) - end - - # Values in the object. Can be mixed content types. - sig do - returns( - T::Hash[ - Symbol, - T.any( - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::Content::Object::Data::Text, - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::Content::Object::Data::Image, - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::Content::Object::Data::Video, - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::Content::Object::Data::Audio - ) - ] - ) - end - attr_accessor :data - - sig { returns(Symbol) } - attr_accessor :type - - # Object - sig do - params( - data: - T::Hash[ - Symbol, - T.any( - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::Content::Object::Data::Text::OrHash, - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::Content::Object::Data::Image::OrHash, - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::Content::Object::Data::Video::OrHash, - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::Content::Object::Data::Audio::OrHash - ) - ], - type: Symbol - ).returns(T.attached_class) - end - def self.new( - # Values in the object. Can be mixed content types. - data:, - type: :object - ) - end - - sig do - override.returns( - { - data: - T::Hash[ - Symbol, - T.any( - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::Content::Object::Data::Text, - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::Content::Object::Data::Image, - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::Content::Object::Data::Video, - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::Content::Object::Data::Audio - ) - ], - type: Symbol - } - ) - end - def to_hash - end - - # Text - module Data - extend ModerationAPI::Internal::Type::Union - - Variants = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::Content::Object::Data::Text, - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::Content::Object::Data::Image, - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::Content::Object::Data::Video, - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::Content::Object::Data::Audio - ) - end - - class Text < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::Content::Object::Data::Text, - ModerationAPI::Internal::AnyHash - ) - end - - # The content text - sig { returns(String) } - attr_accessor :text - - sig { returns(Symbol) } - attr_accessor :type - - # Text - sig do - params(text: String, type: Symbol).returns( - T.attached_class - ) - end - def self.new( - # The content text - text:, - type: :text - ) - end - - sig { override.returns({ text: String, type: Symbol }) } - def to_hash - end - end - - class Image < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::Content::Object::Data::Image, - ModerationAPI::Internal::AnyHash - ) - end - - sig { returns(Symbol) } - attr_accessor :type - - # Base64-encoded image data. Either url or data must be provided. Note: base64 - # images are not stored and will not appear in the review queue. - sig { returns(T.nilable(String)) } - attr_reader :data - - sig { params(data: String).void } - attr_writer :data - - # A public URL of the image content. Either url or data must be provided. - sig { returns(T.nilable(String)) } - attr_reader :url - - sig { params(url: String).void } - attr_writer :url - - # Image - sig do - params(data: String, url: String, type: Symbol).returns( - T.attached_class - ) - end - def self.new( - # Base64-encoded image data. Either url or data must be provided. Note: base64 - # images are not stored and will not appear in the review queue. - data: nil, - # A public URL of the image content. Either url or data must be provided. - url: nil, - type: :image - ) - end - - sig do - override.returns( - { type: Symbol, data: String, url: String } - ) - end - def to_hash - end - end - - class Video < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::Content::Object::Data::Video, - ModerationAPI::Internal::AnyHash - ) - end - - sig { returns(Symbol) } - attr_accessor :type - - # A public URL of the video content - sig { returns(String) } - attr_accessor :url - - # Video - sig do - params(url: String, type: Symbol).returns( - T.attached_class - ) - end - def self.new( - # A public URL of the video content - url:, - type: :video - ) - end - - sig { override.returns({ type: Symbol, url: String }) } - def to_hash - end - end - - class Audio < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::Content::Object::Data::Audio, - ModerationAPI::Internal::AnyHash - ) - end - - sig { returns(Symbol) } - attr_accessor :type - - # The URL of the audio content - sig { returns(String) } - attr_accessor :url - - # Audio - sig do - params(url: String, type: Symbol).returns( - T.attached_class - ) - end - def self.new( - # The URL of the audio content - url:, - type: :audio - ) - end - - sig { override.returns({ type: Symbol, url: String }) } - def to_hash - end - end - - sig do - override.returns( - T::Array[ - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::Content::Object::Data::Variants - ] - ) - end - def self.variants - end - end - end - - sig do - override.returns( - T::Array[ - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::Content::Variants - ] - ) - end - def self.variants - end - end - - class Label < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::Label, - ModerationAPI::Internal::AnyHash - ) - end - - # The label name - sig { returns(String) } - attr_accessor :label - - # Confidence score between 0 and 1 - sig { returns(Float) } - attr_accessor :score - - # Whether this label crossed its flagging threshold - sig { returns(T.nilable(T::Boolean)) } - attr_reader :flagged - - sig { params(flagged: T::Boolean).void } - attr_writer :flagged - - # True if the label was applied manually by a moderator - sig { returns(T.nilable(T::Boolean)) } - attr_reader :manual - - sig { params(manual: T::Boolean).void } - attr_writer :manual - - sig do - returns( - T.nilable( - T::Array[ - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::Label::Match - ] - ) - ) - end - attr_reader :matches - - sig do - params( - matches: - T::Array[ - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::Label::Match::OrHash - ] - ).void - end - attr_writer :matches - - # Whether this label crossed its threshold under a shadowed policy — reported for - # visibility, never counted toward a flagging decision - sig { returns(T.nilable(T::Boolean)) } - attr_reader :shadow_flagged - - sig { params(shadow_flagged: T::Boolean).void } - attr_writer :shadow_flagged - - sig do - params( - label: String, - score: Float, - flagged: T::Boolean, - manual: T::Boolean, - matches: - T::Array[ - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::Label::Match::OrHash - ], - shadow_flagged: T::Boolean - ).returns(T.attached_class) - end - def self.new( - # The label name - label:, - # Confidence score between 0 and 1 - score:, - # Whether this label crossed its flagging threshold - flagged: nil, - # True if the label was applied manually by a moderator - manual: nil, - matches: nil, - # Whether this label crossed its threshold under a shadowed policy — reported for - # visibility, never counted toward a flagging decision - shadow_flagged: nil - ) - end - - sig do - override.returns( - { - label: String, - score: Float, - flagged: T::Boolean, - manual: T::Boolean, - matches: - T::Array[ - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::Label::Match - ], - shadow_flagged: T::Boolean - } - ) - end - def to_hash - end - - class Match < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::Label::Match, - ModerationAPI::Internal::AnyHash - ) - end - - # The matched substring - sig { returns(String) } - attr_accessor :match - - # Match confidence between 0 and 1 - sig { returns(Float) } - attr_accessor :probability - - # [start, end] character offsets in the source text - sig { returns(T::Array[T.anything]) } - attr_accessor :span - - sig { returns(T.nilable(String)) } - attr_reader :entity_type - - sig { params(entity_type: String).void } - attr_writer :entity_type - - sig { returns(T.nilable(String)) } - attr_accessor :mask - - sig { returns(T.nilable(T::Array[String])) } - attr_reader :reasons - - sig { params(reasons: T::Array[String]).void } - attr_writer :reasons - - sig { returns(T.nilable(T::Array[String])) } - attr_reader :scripts - - sig { params(scripts: T::Array[String]).void } - attr_writer :scripts - - sig do - returns( - T.nilable( - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::Label::Match::Signals - ) - ) - end - attr_reader :signals - - sig do - params( - signals: - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::Label::Match::Signals::OrHash - ).void - end - attr_writer :signals - - sig { returns(T.nilable(String)) } - attr_reader :skeleton - - sig { params(skeleton: String).void } - attr_writer :skeleton - - sig do - params( - match: String, - probability: Float, - span: T::Array[T.anything], - entity_type: String, - mask: T.nilable(String), - reasons: T::Array[String], - scripts: T::Array[String], - signals: - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::Label::Match::Signals::OrHash, - skeleton: String - ).returns(T.attached_class) - end - def self.new( - # The matched substring - match:, - # Match confidence between 0 and 1 - probability:, - # [start, end] character offsets in the source text - span:, - entity_type: nil, - mask: nil, - reasons: nil, - scripts: nil, - signals: nil, - skeleton: nil - ) - end - - sig do - override.returns( - { - match: String, - probability: Float, - span: T::Array[T.anything], - entity_type: String, - mask: T.nilable(String), - reasons: T::Array[String], - scripts: T::Array[String], - signals: - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::Label::Match::Signals, - skeleton: String - } - ) - end - def to_hash - end - - class Signals < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::Label::Match::Signals, - ModerationAPI::Internal::AnyHash - ) - end - - sig { returns(T.nilable(T::Boolean)) } - attr_accessor :bot_protection - - sig do - returns( - T.nilable( - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::Label::Match::Signals::BrandImpersonation - ) - ) - end - attr_reader :brand_impersonation - - sig do - params( - brand_impersonation: - T.nilable( - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::Label::Match::Signals::BrandImpersonation::OrHash - ) - ).void - end - attr_writer :brand_impersonation - - sig { returns(T.nilable(Float)) } - attr_accessor :domain_age_days - - sig { returns(T.nilable(String)) } - attr_accessor :final_url - - sig { returns(T.nilable(T::Boolean)) } - attr_accessor :has_email_setup - - sig { returns(T::Boolean) } - attr_accessor :has_suspicious_characters - - sig { returns(T::Boolean) } - attr_accessor :is_link_shortener - - sig { returns(T::Boolean) } - attr_accessor :is_reported - - sig { returns(T.nilable(Float)) } - attr_accessor :redirect_count - - sig do - params( - bot_protection: T.nilable(T::Boolean), - brand_impersonation: - T.nilable( - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::Label::Match::Signals::BrandImpersonation::OrHash - ), - domain_age_days: T.nilable(Float), - final_url: T.nilable(String), - has_email_setup: T.nilable(T::Boolean), - has_suspicious_characters: T::Boolean, - is_link_shortener: T::Boolean, - is_reported: T::Boolean, - redirect_count: T.nilable(Float) - ).returns(T.attached_class) - end - def self.new( - bot_protection:, - brand_impersonation:, - domain_age_days:, - final_url:, - has_email_setup:, - has_suspicious_characters:, - is_link_shortener:, - is_reported:, - redirect_count: - ) - end - - sig do - override.returns( - { - bot_protection: T.nilable(T::Boolean), - brand_impersonation: - T.nilable( - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::Label::Match::Signals::BrandImpersonation - ), - domain_age_days: T.nilable(Float), - final_url: T.nilable(String), - has_email_setup: T.nilable(T::Boolean), - has_suspicious_characters: T::Boolean, - is_link_shortener: T::Boolean, - is_reported: T::Boolean, - redirect_count: T.nilable(Float) - } - ) - end - def to_hash - end - - class BrandImpersonation < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::Label::Match::Signals::BrandImpersonation, - ModerationAPI::Internal::AnyHash - ) - end - - sig { returns(String) } - attr_accessor :brand - - sig { returns(String) } - attr_accessor :method_ - - sig do - params(brand: String, method_: String).returns( - T.attached_class - ) - end - def self.new(brand:, method_:) - end - - sig do - override.returns({ brand: String, method_: String }) - end - def to_hash - end - end - end - end - end - - # High-level content type (e.g. message, post, comment). Defaults to the channel's - # configured content type but can be overridden per request via the moderation API - # `type` field. - module MetaType - extend ModerationAPI::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all( - Symbol, - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::MetaType - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - PROFILE = - T.let( - :profile, - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::MetaType::TaggedSymbol - ) - MESSAGE = - T.let( - :message, - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::MetaType::TaggedSymbol - ) - POST = - T.let( - :post, - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::MetaType::TaggedSymbol - ) - COMMENT = - T.let( - :comment, - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::MetaType::TaggedSymbol - ) - EVENT = - T.let( - :event, - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::MetaType::TaggedSymbol - ) - PRODUCT = - T.let( - :product, - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::MetaType::TaggedSymbol - ) - REVIEW = - T.let( - :review, - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::MetaType::TaggedSymbol - ) - VOICE = - T.let( - :voice, - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::MetaType::TaggedSymbol - ) - OTHER = - T.let( - :other, - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::MetaType::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::MetaType::TaggedSymbol - ] - ) - end - def self.values - end - end - end - - class Queue < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Queue, - ModerationAPI::Internal::AnyHash - ) - end - - sig { returns(String) } - attr_accessor :id - - # The queue the item belongs to, if any - sig { params(id: String).returns(T.attached_class) } - def self.new(id:) - end - - sig { override.returns({ id: String }) } - def to_hash - end - end - end - end - end - - class QueueItemRejected < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::QueueItemRejected, - ModerationAPI::Internal::AnyHash - ) - end - - # Stable event ID. Use this to dedupe retries. - sig { returns(String) } - attr_accessor :id - - sig { returns(Symbol) } - attr_accessor :api_version - - # ISO 8601 timestamp of when the event was emitted. - sig { returns(Time) } - attr_accessor :created - - sig { returns(ModerationAPI::WebhookEvent::QueueItemRejected::Data) } - attr_reader :data - - sig do - params( - data: ModerationAPI::WebhookEvent::QueueItemRejected::Data::OrHash - ).void - end - attr_writer :data - - # The event type. - sig { returns(Symbol) } - attr_accessor :type - - sig do - params( - id: String, - created: Time, - data: ModerationAPI::WebhookEvent::QueueItemRejected::Data::OrHash, - api_version: Symbol, - type: Symbol - ).returns(T.attached_class) - end - def self.new( - # Stable event ID. Use this to dedupe retries. - id:, - # ISO 8601 timestamp of when the event was emitted. - created:, - data:, - api_version: :v2, - # The event type. - type: :"queue_item.rejected" - ) - end - - sig do - override.returns( - { - id: String, - api_version: Symbol, - created: Time, - data: ModerationAPI::WebhookEvent::QueueItemRejected::Data, - type: Symbol - } - ) - end - def to_hash - end - - class Data < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::QueueItemRejected::Data, - ModerationAPI::Internal::AnyHash - ) - end - - sig do - returns( - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object - ) - end - attr_reader :object - - sig do - params( - object: - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::OrHash - ).void - end - attr_writer :object - - sig do - params( - object: - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::OrHash - ).returns(T.attached_class) - end - def self.new(object:) - end - - sig do - override.returns( - { - object: - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object - } - ) - end - def to_hash - end - - class Object < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object, - ModerationAPI::Internal::AnyHash - ) - end - - # Moderation action ID - sig { returns(String) } - attr_accessor :id - - # ISO 8601 timestamp of when the action was performed - sig { returns(Time) } - attr_accessor :created_at - - # Customer-defined key identifying this action - sig { returns(T.nilable(String)) } - attr_accessor :key - - # Display name of the action - sig { returns(T.nilable(String)) } - attr_accessor :name - - # The value passed to the action when it ran - sig { returns(T.nilable(String)) } - attr_accessor :value - - # The author the action was performed on, if any - sig do - returns( - T.nilable( - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Author - ) - ) - end - attr_reader :author - - sig do - params( - author: - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Author::OrHash - ).void - end - attr_writer :author - - # The content item the action was performed on, if any - sig do - returns( - T.nilable( - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item - ) - ) - end - attr_reader :item - - sig do - params( - item: - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::OrHash - ).void - end - attr_writer :item - - # The queue the item belongs to, if any - sig do - returns( - T.nilable( - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Queue - ) - ) - end - attr_reader :queue - - sig do - params( - queue: - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Queue::OrHash - ).void - end - attr_writer :queue - - sig do - params( - id: String, - created_at: Time, - key: T.nilable(String), - name: T.nilable(String), - value: T.nilable(String), - author: - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Author::OrHash, - item: - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::OrHash, - queue: - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Queue::OrHash - ).returns(T.attached_class) - end - def self.new( - # Moderation action ID - id:, - # ISO 8601 timestamp of when the action was performed - created_at:, - # Customer-defined key identifying this action - key:, - # Display name of the action - name:, - # The value passed to the action when it ran - value:, - # The author the action was performed on, if any - author: nil, - # The content item the action was performed on, if any - item: nil, - # The queue the item belongs to, if any - queue: nil - ) - end - - sig do - override.returns( - { - id: String, - created_at: Time, - key: T.nilable(String), - name: T.nilable(String), - value: T.nilable(String), - author: - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Author, - item: - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item, - queue: - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Queue - } - ) - end - def to_hash - end - - class Author < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Author, - ModerationAPI::Internal::AnyHash - ) - end - - # Author ID in Moderation API - sig { returns(String) } - attr_accessor :id - - # Block or suspension details, if applicable. Null if the author is enabled. - sig do - returns( - T.nilable( - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Author::Block - ) - ) - end - attr_reader :block - - sig do - params( - block: - T.nilable( - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Author::Block::OrHash - ) - ).void - end - attr_writer :block - - # Timestamp when author first appeared - sig { returns(Float) } - attr_accessor :first_seen - - # Timestamp of last activity - sig { returns(Float) } - attr_accessor :last_seen - - # Additional metadata provided by your system. We recommend including any relevant - # information that may assist in the moderation process. - sig do - returns( - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Author::Metadata - ) - end - attr_reader :metadata - - sig do - params( - metadata: - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Author::Metadata::OrHash - ).void - end - attr_writer :metadata - - sig do - returns( - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Author::Metrics - ) - end - attr_reader :metrics - - sig do - params( - metrics: - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Author::Metrics::OrHash - ).void - end - attr_writer :metrics - - # Risk assessment details, if available. - sig do - returns( - T.nilable( - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Author::RiskEvaluation - ) - ) - end - attr_reader :risk_evaluation - - sig do - params( - risk_evaluation: - T.nilable( - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Author::RiskEvaluation::OrHash - ) - ).void - end - attr_writer :risk_evaluation - - # Current author status - sig do - returns( - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Author::Status::OrSymbol - ) - end - attr_accessor :status - - sig do - returns( - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Author::TrustLevel - ) - end - attr_reader :trust_level - - sig do - params( - trust_level: - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Author::TrustLevel::OrHash - ).void - end - attr_writer :trust_level - - # The author's company or organization - sig { returns(T.nilable(String)) } - attr_accessor :company - - # Author email address - sig { returns(T.nilable(String)) } - attr_accessor :email - - # The author's ID from your system - sig { returns(T.nilable(String)) } - attr_accessor :external_id - - # URL of the author's external profile - sig { returns(T.nilable(String)) } - attr_accessor :external_link - - # Timestamp of last incident - sig { returns(T.nilable(Float)) } - attr_accessor :last_incident - - # Author name or identifier - sig { returns(T.nilable(String)) } - attr_accessor :name - - # URL of the author's profile picture - sig { returns(T.nilable(String)) } - attr_accessor :profile_picture - - # The author the action was performed on, if any - sig do - params( - id: String, - block: - T.nilable( - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Author::Block::OrHash - ), - first_seen: Float, - last_seen: Float, - metadata: - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Author::Metadata::OrHash, - metrics: - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Author::Metrics::OrHash, - risk_evaluation: - T.nilable( - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Author::RiskEvaluation::OrHash - ), - status: - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Author::Status::OrSymbol, - trust_level: - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Author::TrustLevel::OrHash, - company: T.nilable(String), - email: T.nilable(String), - external_id: T.nilable(String), - external_link: T.nilable(String), - last_incident: T.nilable(Float), - name: T.nilable(String), - profile_picture: T.nilable(String) - ).returns(T.attached_class) - end - def self.new( - # Author ID in Moderation API - id:, - # Block or suspension details, if applicable. Null if the author is enabled. - block:, - # Timestamp when author first appeared - first_seen:, - # Timestamp of last activity - last_seen:, - # Additional metadata provided by your system. We recommend including any relevant - # information that may assist in the moderation process. - metadata:, - metrics:, - # Risk assessment details, if available. - risk_evaluation:, - # Current author status - status:, - trust_level:, - # The author's company or organization - company: nil, - # Author email address - email: nil, - # The author's ID from your system - external_id: nil, - # URL of the author's external profile - external_link: nil, - # Timestamp of last incident - last_incident: nil, - # Author name or identifier - name: nil, - # URL of the author's profile picture - profile_picture: nil - ) - end - - sig do - override.returns( - { - id: String, - block: - T.nilable( - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Author::Block - ), - first_seen: Float, - last_seen: Float, - metadata: - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Author::Metadata, - metrics: - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Author::Metrics, - risk_evaluation: - T.nilable( - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Author::RiskEvaluation - ), - status: - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Author::Status::OrSymbol, - trust_level: - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Author::TrustLevel, - company: T.nilable(String), - email: T.nilable(String), - external_id: T.nilable(String), - external_link: T.nilable(String), - last_incident: T.nilable(Float), - name: T.nilable(String), - profile_picture: T.nilable(String) - } - ) - end - def to_hash - end - - class Block < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Author::Block, - ModerationAPI::Internal::AnyHash - ) - end - - # The moderators reason why the author was blocked or suspended. - sig { returns(T.nilable(String)) } - attr_accessor :reason - - # The timestamp until which they are blocked if the author is suspended. - sig { returns(T.nilable(Float)) } - attr_accessor :until_ - - # Block or suspension details, if applicable. Null if the author is enabled. - sig do - params( - reason: T.nilable(String), - until_: T.nilable(Float) - ).returns(T.attached_class) - end - def self.new( - # The moderators reason why the author was blocked or suspended. - reason: nil, - # The timestamp until which they are blocked if the author is suspended. - until_: nil - ) - end - - sig do - override.returns( - { reason: T.nilable(String), until_: T.nilable(Float) } - ) - end - def to_hash - end - end - - class Metadata < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Author::Metadata, - ModerationAPI::Internal::AnyHash - ) - end - - # Whether the author's email is verified - sig { returns(T.nilable(T::Boolean)) } - attr_accessor :email_verified - - # Whether the author's identity is verified - sig { returns(T.nilable(T::Boolean)) } - attr_accessor :identity_verified - - # Whether the author is a paying customer - sig { returns(T.nilable(T::Boolean)) } - attr_accessor :is_paying_customer - - # Whether the author's phone number is verified - sig { returns(T.nilable(T::Boolean)) } - attr_accessor :phone_verified - - # Additional metadata provided by your system. We recommend including any relevant - # information that may assist in the moderation process. - sig do - params( - email_verified: T.nilable(T::Boolean), - identity_verified: T.nilable(T::Boolean), - is_paying_customer: T.nilable(T::Boolean), - phone_verified: T.nilable(T::Boolean) - ).returns(T.attached_class) - end - def self.new( - # Whether the author's email is verified - email_verified: nil, - # Whether the author's identity is verified - identity_verified: nil, - # Whether the author is a paying customer - is_paying_customer: nil, - # Whether the author's phone number is verified - phone_verified: nil - ) - end - - sig do - override.returns( - { - email_verified: T.nilable(T::Boolean), - identity_verified: T.nilable(T::Boolean), - is_paying_customer: T.nilable(T::Boolean), - phone_verified: T.nilable(T::Boolean) - } - ) - end - def to_hash - end - end - - class Metrics < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Author::Metrics, - ModerationAPI::Internal::AnyHash - ) - end - - # Number of flagged content pieces - sig { returns(Float) } - attr_accessor :flagged_content - - # Total pieces of content - sig { returns(Float) } - attr_accessor :total_content - - # Average sentiment score of content (-1 to 1). Requires a sentiment model in your - # project. - sig { returns(T.nilable(Float)) } - attr_accessor :average_sentiment - - sig do - params( - flagged_content: Float, - total_content: Float, - average_sentiment: T.nilable(Float) - ).returns(T.attached_class) - end - def self.new( - # Number of flagged content pieces - flagged_content:, - # Total pieces of content - total_content:, - # Average sentiment score of content (-1 to 1). Requires a sentiment model in your - # project. - average_sentiment: nil - ) - end - - sig do - override.returns( - { - flagged_content: Float, - total_content: Float, - average_sentiment: T.nilable(Float) - } - ) - end - def to_hash - end - end - - class RiskEvaluation < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Author::RiskEvaluation, - ModerationAPI::Internal::AnyHash - ) - end - - # Calculated risk level based on more than 10 behavioral signals. - sig { returns(T.nilable(Float)) } - attr_accessor :risk_level - - # Risk assessment details, if available. - sig do - params(risk_level: T.nilable(Float)).returns(T.attached_class) - end - def self.new( - # Calculated risk level based on more than 10 behavioral signals. - risk_level: nil - ) - end - - sig { override.returns({ risk_level: T.nilable(Float) }) } - def to_hash - end - end - - # Current author status - module Status - extend ModerationAPI::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all( - Symbol, - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Author::Status - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - ENABLED = - T.let( - :enabled, - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Author::Status::TaggedSymbol - ) - SUSPENDED = - T.let( - :suspended, - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Author::Status::TaggedSymbol - ) - BLOCKED = - T.let( - :blocked, - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Author::Status::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Author::Status::TaggedSymbol - ] - ) - end - def self.values - end - end - - class TrustLevel < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Author::TrustLevel, - ModerationAPI::Internal::AnyHash - ) - end - - # Author trust level (-1, 0, 1, 2, 3, or 4) - sig { returns(Float) } - attr_accessor :level - - # True if the trust level was set manually by a moderator - sig { returns(T::Boolean) } - attr_accessor :manual - - sig do - params(level: Float, manual: T::Boolean).returns( - T.attached_class - ) - end - def self.new( - # Author trust level (-1, 0, 1, 2, 3, or 4) - level:, - # True if the trust level was set manually by a moderator - manual: - ) - end - - sig { override.returns({ level: Float, manual: T::Boolean }) } - def to_hash - end - end - end - - class Item < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item, - ModerationAPI::Internal::AnyHash - ) - end - - # Content ID from your system - sig { returns(String) } - attr_accessor :id - - # External author ID (the customer's identifier, not Moderation API's internal id) - sig { returns(T.nilable(String)) } - attr_accessor :author_id - - # The channel the content was submitted to, identified by your customer-defined - # channel key. - sig { returns(T.nilable(String)) } - attr_accessor :channel_key - - # A recommendation from your own client-side flagging. - sig do - returns( - T.nilable( - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::ClientAction - ) - ) - end - attr_reader :client_action - - sig do - params( - client_action: - T.nilable( - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::ClientAction::OrHash - ) - ).void - end - attr_writer :client_action - - # The original content payload - sig do - returns( - T.any( - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::Content::Text, - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::Content::Image, - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::Content::Video, - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::Content::Audio, - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::Content::Object - ) - ) - end - attr_accessor :content - - # Conversation grouping ID, if any - sig { returns(T.nilable(String)) } - attr_accessor :conversation_id - - # Whether the content was flagged by moderation - sig { returns(T.nilable(T::Boolean)) } - attr_accessor :flagged - - # For object content, the field keys (e.g. "bio") that triggered a flag. Empty - # when no fields were flagged or the content is not an object. - sig { returns(T::Array[String]) } - attr_accessor :flagged_fields - - # Moderation labels applied to the content - sig do - returns( - T.nilable( - T::Array[ - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::Label - ] - ) - ) - end - attr_accessor :labels - - # Detected ISO language code, if available - sig { returns(T.nilable(String)) } - attr_accessor :language - - # High-level content type (e.g. message, post, comment). Defaults to the channel's - # configured content type but can be overridden per request via the moderation API - # `type` field. - sig do - returns( - T.nilable( - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::MetaType::OrSymbol - ) - ) - end - attr_accessor :meta_type - - # Arbitrary key/value metadata. Top-level keys are strings. - sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } - attr_accessor :metadata - - # ISO 8601 timestamp of when the content was submitted - sig { returns(Time) } - attr_accessor :timestamp - - # The content item the action was performed on, if any - sig do - params( - id: String, - author_id: T.nilable(String), - channel_key: T.nilable(String), - client_action: - T.nilable( - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::ClientAction::OrHash - ), - content: - T.any( - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::Content::Text::OrHash, - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::Content::Image::OrHash, - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::Content::Video::OrHash, - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::Content::Audio::OrHash, - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::Content::Object::OrHash - ), - conversation_id: T.nilable(String), - flagged: T.nilable(T::Boolean), - flagged_fields: T::Array[String], - labels: - T.nilable( - T::Array[ - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::Label::OrHash - ] - ), - language: T.nilable(String), - meta_type: - T.nilable( - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::MetaType::OrSymbol - ), - metadata: T.nilable(T::Hash[Symbol, T.anything]), - timestamp: Time - ).returns(T.attached_class) - end - def self.new( - # Content ID from your system - id:, - # External author ID (the customer's identifier, not Moderation API's internal id) - author_id:, - # The channel the content was submitted to, identified by your customer-defined - # channel key. - channel_key:, - # A recommendation from your own client-side flagging. - client_action:, - # The original content payload - content:, - # Conversation grouping ID, if any - conversation_id:, - # Whether the content was flagged by moderation - flagged:, - # For object content, the field keys (e.g. "bio") that triggered a flag. Empty - # when no fields were flagged or the content is not an object. - flagged_fields:, - # Moderation labels applied to the content - labels:, - # Detected ISO language code, if available - language:, - # High-level content type (e.g. message, post, comment). Defaults to the channel's - # configured content type but can be overridden per request via the moderation API - # `type` field. - meta_type:, - # Arbitrary key/value metadata. Top-level keys are strings. - metadata:, - # ISO 8601 timestamp of when the content was submitted - timestamp: - ) - end - - sig do - override.returns( - { - id: String, - author_id: T.nilable(String), - channel_key: T.nilable(String), - client_action: - T.nilable( - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::ClientAction - ), - content: - T.any( - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::Content::Text, - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::Content::Image, - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::Content::Video, - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::Content::Audio, - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::Content::Object - ), - conversation_id: T.nilable(String), - flagged: T.nilable(T::Boolean), - flagged_fields: T::Array[String], - labels: - T.nilable( - T::Array[ - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::Label - ] - ), - language: T.nilable(String), - meta_type: - T.nilable( - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::MetaType::OrSymbol - ), - metadata: T.nilable(T::Hash[Symbol, T.anything]), - timestamp: Time - } - ) - end - def to_hash - end - - class ClientAction < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::ClientAction, - ModerationAPI::Internal::AnyHash - ) - end - - # Your recommendation for the content: allow, review, or reject. - sig do - returns( - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::ClientAction::Action::OrSymbol - ) - end - attr_accessor :action - - # How your recommendation combines with ours. Defaults to 'escalate', which only - # applies it when stricter than ours; 'override' replaces ours outright. - sig do - returns( - T.nilable( - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::ClientAction::Behavior::OrSymbol - ) - ) - end - attr_reader :behavior - - sig do - params( - behavior: - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::ClientAction::Behavior::OrSymbol - ).void - end - attr_writer :behavior - - # A human-readable explanation for your recommendation. - sig { returns(T.nilable(String)) } - attr_reader :reason - - sig { params(reason: String).void } - attr_writer :reason - - # Where your recommendation came from, e.g. "banned-ip". - sig { returns(T.nilable(String)) } - attr_reader :source - - sig { params(source: String).void } - attr_writer :source - - # A recommendation from your own client-side flagging. - sig do - params( - action: - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::ClientAction::Action::OrSymbol, - behavior: - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::ClientAction::Behavior::OrSymbol, - reason: String, - source: String - ).returns(T.attached_class) - end - def self.new( - # Your recommendation for the content: allow, review, or reject. - action:, - # How your recommendation combines with ours. Defaults to 'escalate', which only - # applies it when stricter than ours; 'override' replaces ours outright. - behavior: nil, - # A human-readable explanation for your recommendation. - reason: nil, - # Where your recommendation came from, e.g. "banned-ip". - source: nil - ) - end - - sig do - override.returns( - { - action: - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::ClientAction::Action::OrSymbol, - behavior: - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::ClientAction::Behavior::OrSymbol, - reason: String, - source: String - } - ) - end - def to_hash - end - - # Your recommendation for the content: allow, review, or reject. - module Action - extend ModerationAPI::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all( - Symbol, - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::ClientAction::Action - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - REVIEW = - T.let( - :review, - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::ClientAction::Action::TaggedSymbol - ) - ALLOW = - T.let( - :allow, - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::ClientAction::Action::TaggedSymbol - ) - REJECT = - T.let( - :reject, - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::ClientAction::Action::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::ClientAction::Action::TaggedSymbol - ] - ) - end - def self.values - end - end - - # How your recommendation combines with ours. Defaults to 'escalate', which only - # applies it when stricter than ours; 'override' replaces ours outright. - module Behavior - extend ModerationAPI::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all( - Symbol, - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::ClientAction::Behavior - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - OVERRIDE = - T.let( - :override, - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::ClientAction::Behavior::TaggedSymbol - ) - ESCALATE = - T.let( - :escalate, - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::ClientAction::Behavior::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::ClientAction::Behavior::TaggedSymbol - ] - ) - end - def self.values - end - end - end - - # The original content payload - module Content - extend ModerationAPI::Internal::Type::Union - - Variants = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::Content::Text, - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::Content::Image, - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::Content::Video, - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::Content::Audio, - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::Content::Object - ) - end - - class Text < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::Content::Text, - ModerationAPI::Internal::AnyHash - ) - end - - # The content text - sig { returns(String) } - attr_accessor :text - - sig { returns(Symbol) } - attr_accessor :type - - # Text - sig do - params(text: String, type: Symbol).returns(T.attached_class) - end - def self.new( - # The content text - text:, - type: :text - ) - end - - sig { override.returns({ text: String, type: Symbol }) } - def to_hash - end - end - - class Image < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::Content::Image, - ModerationAPI::Internal::AnyHash - ) - end - - sig { returns(Symbol) } - attr_accessor :type - - # Base64-encoded image data. Either url or data must be provided. Note: base64 - # images are not stored and will not appear in the review queue. - sig { returns(T.nilable(String)) } - attr_reader :data - - sig { params(data: String).void } - attr_writer :data - - # A public URL of the image content. Either url or data must be provided. - sig { returns(T.nilable(String)) } - attr_reader :url - - sig { params(url: String).void } - attr_writer :url - - # Image - sig do - params(data: String, url: String, type: Symbol).returns( - T.attached_class - ) - end - def self.new( - # Base64-encoded image data. Either url or data must be provided. Note: base64 - # images are not stored and will not appear in the review queue. - data: nil, - # A public URL of the image content. Either url or data must be provided. - url: nil, - type: :image - ) - end - - sig do - override.returns( - { type: Symbol, data: String, url: String } - ) - end - def to_hash - end - end - - class Video < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::Content::Video, - ModerationAPI::Internal::AnyHash - ) - end - - sig { returns(Symbol) } - attr_accessor :type - - # A public URL of the video content - sig { returns(String) } - attr_accessor :url - - # Video - sig do - params(url: String, type: Symbol).returns(T.attached_class) - end - def self.new( - # A public URL of the video content - url:, - type: :video - ) - end - - sig { override.returns({ type: Symbol, url: String }) } - def to_hash - end - end - - class Audio < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::Content::Audio, - ModerationAPI::Internal::AnyHash - ) - end - - sig { returns(Symbol) } - attr_accessor :type - - # The URL of the audio content - sig { returns(String) } - attr_accessor :url - - # Audio - sig do - params(url: String, type: Symbol).returns(T.attached_class) - end - def self.new( - # The URL of the audio content - url:, - type: :audio - ) - end - - sig { override.returns({ type: Symbol, url: String }) } - def to_hash - end - end - - class Object < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::Content::Object, - ModerationAPI::Internal::AnyHash - ) - end - - # Values in the object. Can be mixed content types. - sig do - returns( - T::Hash[ - Symbol, - T.any( - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::Content::Object::Data::Text, - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::Content::Object::Data::Image, - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::Content::Object::Data::Video, - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::Content::Object::Data::Audio - ) - ] - ) - end - attr_accessor :data - - sig { returns(Symbol) } - attr_accessor :type - - # Object - sig do - params( - data: - T::Hash[ - Symbol, - T.any( - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::Content::Object::Data::Text::OrHash, - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::Content::Object::Data::Image::OrHash, - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::Content::Object::Data::Video::OrHash, - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::Content::Object::Data::Audio::OrHash - ) - ], - type: Symbol - ).returns(T.attached_class) - end - def self.new( - # Values in the object. Can be mixed content types. - data:, - type: :object - ) - end - - sig do - override.returns( - { - data: - T::Hash[ - Symbol, - T.any( - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::Content::Object::Data::Text, - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::Content::Object::Data::Image, - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::Content::Object::Data::Video, - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::Content::Object::Data::Audio - ) - ], - type: Symbol - } - ) - end - def to_hash - end - - # Text - module Data - extend ModerationAPI::Internal::Type::Union - - Variants = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::Content::Object::Data::Text, - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::Content::Object::Data::Image, - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::Content::Object::Data::Video, - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::Content::Object::Data::Audio - ) - end - - class Text < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::Content::Object::Data::Text, - ModerationAPI::Internal::AnyHash - ) - end - - # The content text - sig { returns(String) } - attr_accessor :text - - sig { returns(Symbol) } - attr_accessor :type - - # Text - sig do - params(text: String, type: Symbol).returns( - T.attached_class - ) - end - def self.new( - # The content text - text:, - type: :text - ) - end - - sig { override.returns({ text: String, type: Symbol }) } - def to_hash - end - end - - class Image < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::Content::Object::Data::Image, - ModerationAPI::Internal::AnyHash - ) - end - - sig { returns(Symbol) } - attr_accessor :type - - # Base64-encoded image data. Either url or data must be provided. Note: base64 - # images are not stored and will not appear in the review queue. - sig { returns(T.nilable(String)) } - attr_reader :data - - sig { params(data: String).void } - attr_writer :data - - # A public URL of the image content. Either url or data must be provided. - sig { returns(T.nilable(String)) } - attr_reader :url - - sig { params(url: String).void } - attr_writer :url - - # Image - sig do - params(data: String, url: String, type: Symbol).returns( - T.attached_class - ) - end - def self.new( - # Base64-encoded image data. Either url or data must be provided. Note: base64 - # images are not stored and will not appear in the review queue. - data: nil, - # A public URL of the image content. Either url or data must be provided. - url: nil, - type: :image - ) - end - - sig do - override.returns( - { type: Symbol, data: String, url: String } - ) - end - def to_hash - end - end - - class Video < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::Content::Object::Data::Video, - ModerationAPI::Internal::AnyHash - ) - end - - sig { returns(Symbol) } - attr_accessor :type - - # A public URL of the video content - sig { returns(String) } - attr_accessor :url - - # Video - sig do - params(url: String, type: Symbol).returns( - T.attached_class - ) - end - def self.new( - # A public URL of the video content - url:, - type: :video - ) - end - - sig { override.returns({ type: Symbol, url: String }) } - def to_hash - end - end - - class Audio < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::Content::Object::Data::Audio, - ModerationAPI::Internal::AnyHash - ) - end - - sig { returns(Symbol) } - attr_accessor :type - - # The URL of the audio content - sig { returns(String) } - attr_accessor :url - - # Audio - sig do - params(url: String, type: Symbol).returns( - T.attached_class - ) - end - def self.new( - # The URL of the audio content - url:, - type: :audio - ) - end - - sig { override.returns({ type: Symbol, url: String }) } - def to_hash - end - end - - sig do - override.returns( - T::Array[ - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::Content::Object::Data::Variants - ] - ) - end - def self.variants - end - end - end - - sig do - override.returns( - T::Array[ - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::Content::Variants - ] - ) - end - def self.variants - end - end - - class Label < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::Label, - ModerationAPI::Internal::AnyHash - ) - end - - # The label name - sig { returns(String) } - attr_accessor :label - - # Confidence score between 0 and 1 - sig { returns(Float) } - attr_accessor :score - - # Whether this label crossed its flagging threshold - sig { returns(T.nilable(T::Boolean)) } - attr_reader :flagged - - sig { params(flagged: T::Boolean).void } - attr_writer :flagged - - # True if the label was applied manually by a moderator - sig { returns(T.nilable(T::Boolean)) } - attr_reader :manual - - sig { params(manual: T::Boolean).void } - attr_writer :manual - - sig do - returns( - T.nilable( - T::Array[ - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::Label::Match - ] - ) - ) - end - attr_reader :matches - - sig do - params( - matches: - T::Array[ - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::Label::Match::OrHash - ] - ).void - end - attr_writer :matches - - # Whether this label crossed its threshold under a shadowed policy — reported for - # visibility, never counted toward a flagging decision - sig { returns(T.nilable(T::Boolean)) } - attr_reader :shadow_flagged - - sig { params(shadow_flagged: T::Boolean).void } - attr_writer :shadow_flagged - - sig do - params( - label: String, - score: Float, - flagged: T::Boolean, - manual: T::Boolean, - matches: - T::Array[ - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::Label::Match::OrHash - ], - shadow_flagged: T::Boolean - ).returns(T.attached_class) - end - def self.new( - # The label name - label:, - # Confidence score between 0 and 1 - score:, - # Whether this label crossed its flagging threshold - flagged: nil, - # True if the label was applied manually by a moderator - manual: nil, - matches: nil, - # Whether this label crossed its threshold under a shadowed policy — reported for - # visibility, never counted toward a flagging decision - shadow_flagged: nil - ) - end - - sig do - override.returns( - { - label: String, - score: Float, - flagged: T::Boolean, - manual: T::Boolean, - matches: - T::Array[ - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::Label::Match - ], - shadow_flagged: T::Boolean - } - ) - end - def to_hash - end - - class Match < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::Label::Match, - ModerationAPI::Internal::AnyHash - ) - end - - # The matched substring - sig { returns(String) } - attr_accessor :match - - # Match confidence between 0 and 1 - sig { returns(Float) } - attr_accessor :probability - - # [start, end] character offsets in the source text - sig { returns(T::Array[T.anything]) } - attr_accessor :span - - sig { returns(T.nilable(String)) } - attr_reader :entity_type - - sig { params(entity_type: String).void } - attr_writer :entity_type - - sig { returns(T.nilable(String)) } - attr_accessor :mask - - sig { returns(T.nilable(T::Array[String])) } - attr_reader :reasons - - sig { params(reasons: T::Array[String]).void } - attr_writer :reasons - - sig { returns(T.nilable(T::Array[String])) } - attr_reader :scripts - - sig { params(scripts: T::Array[String]).void } - attr_writer :scripts - - sig do - returns( - T.nilable( - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::Label::Match::Signals - ) - ) - end - attr_reader :signals - - sig do - params( - signals: - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::Label::Match::Signals::OrHash - ).void - end - attr_writer :signals - - sig { returns(T.nilable(String)) } - attr_reader :skeleton - - sig { params(skeleton: String).void } - attr_writer :skeleton - - sig do - params( - match: String, - probability: Float, - span: T::Array[T.anything], - entity_type: String, - mask: T.nilable(String), - reasons: T::Array[String], - scripts: T::Array[String], - signals: - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::Label::Match::Signals::OrHash, - skeleton: String - ).returns(T.attached_class) - end - def self.new( - # The matched substring - match:, - # Match confidence between 0 and 1 - probability:, - # [start, end] character offsets in the source text - span:, - entity_type: nil, - mask: nil, - reasons: nil, - scripts: nil, - signals: nil, - skeleton: nil - ) - end - - sig do - override.returns( - { - match: String, - probability: Float, - span: T::Array[T.anything], - entity_type: String, - mask: T.nilable(String), - reasons: T::Array[String], - scripts: T::Array[String], - signals: - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::Label::Match::Signals, - skeleton: String - } - ) - end - def to_hash - end - - class Signals < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::Label::Match::Signals, - ModerationAPI::Internal::AnyHash - ) - end - - sig { returns(T.nilable(T::Boolean)) } - attr_accessor :bot_protection - - sig do - returns( - T.nilable( - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::Label::Match::Signals::BrandImpersonation - ) - ) - end - attr_reader :brand_impersonation - - sig do - params( - brand_impersonation: - T.nilable( - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::Label::Match::Signals::BrandImpersonation::OrHash - ) - ).void - end - attr_writer :brand_impersonation - - sig { returns(T.nilable(Float)) } - attr_accessor :domain_age_days - - sig { returns(T.nilable(String)) } - attr_accessor :final_url - - sig { returns(T.nilable(T::Boolean)) } - attr_accessor :has_email_setup - - sig { returns(T::Boolean) } - attr_accessor :has_suspicious_characters - - sig { returns(T::Boolean) } - attr_accessor :is_link_shortener - - sig { returns(T::Boolean) } - attr_accessor :is_reported - - sig { returns(T.nilable(Float)) } - attr_accessor :redirect_count - - sig do - params( - bot_protection: T.nilable(T::Boolean), - brand_impersonation: - T.nilable( - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::Label::Match::Signals::BrandImpersonation::OrHash - ), - domain_age_days: T.nilable(Float), - final_url: T.nilable(String), - has_email_setup: T.nilable(T::Boolean), - has_suspicious_characters: T::Boolean, - is_link_shortener: T::Boolean, - is_reported: T::Boolean, - redirect_count: T.nilable(Float) - ).returns(T.attached_class) - end - def self.new( - bot_protection:, - brand_impersonation:, - domain_age_days:, - final_url:, - has_email_setup:, - has_suspicious_characters:, - is_link_shortener:, - is_reported:, - redirect_count: - ) - end - - sig do - override.returns( - { - bot_protection: T.nilable(T::Boolean), - brand_impersonation: - T.nilable( - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::Label::Match::Signals::BrandImpersonation - ), - domain_age_days: T.nilable(Float), - final_url: T.nilable(String), - has_email_setup: T.nilable(T::Boolean), - has_suspicious_characters: T::Boolean, - is_link_shortener: T::Boolean, - is_reported: T::Boolean, - redirect_count: T.nilable(Float) - } - ) - end - def to_hash - end - - class BrandImpersonation < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::Label::Match::Signals::BrandImpersonation, - ModerationAPI::Internal::AnyHash - ) - end - - sig { returns(String) } - attr_accessor :brand - - sig { returns(String) } - attr_accessor :method_ - - sig do - params(brand: String, method_: String).returns( - T.attached_class - ) - end - def self.new(brand:, method_:) - end - - sig do - override.returns({ brand: String, method_: String }) - end - def to_hash - end - end - end - end - end - - # High-level content type (e.g. message, post, comment). Defaults to the channel's - # configured content type but can be overridden per request via the moderation API - # `type` field. - module MetaType - extend ModerationAPI::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all( - Symbol, - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::MetaType - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - PROFILE = - T.let( - :profile, - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::MetaType::TaggedSymbol - ) - MESSAGE = - T.let( - :message, - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::MetaType::TaggedSymbol - ) - POST = - T.let( - :post, - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::MetaType::TaggedSymbol - ) - COMMENT = - T.let( - :comment, - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::MetaType::TaggedSymbol - ) - EVENT = - T.let( - :event, - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::MetaType::TaggedSymbol - ) - PRODUCT = - T.let( - :product, - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::MetaType::TaggedSymbol - ) - REVIEW = - T.let( - :review, - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::MetaType::TaggedSymbol - ) - VOICE = - T.let( - :voice, - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::MetaType::TaggedSymbol - ) - OTHER = - T.let( - :other, - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::MetaType::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::MetaType::TaggedSymbol - ] - ) - end - def self.values - end - end - end - - class Queue < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Queue, - ModerationAPI::Internal::AnyHash - ) - end - - sig { returns(String) } - attr_accessor :id - - # The queue the item belongs to, if any - sig { params(id: String).returns(T.attached_class) } - def self.new(id:) - end - - sig { override.returns({ id: String }) } - def to_hash - end - end - end - end - end - - class QueueItemAllowed < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::QueueItemAllowed, - ModerationAPI::Internal::AnyHash - ) - end - - # Stable event ID. Use this to dedupe retries. - sig { returns(String) } - attr_accessor :id - - sig { returns(Symbol) } - attr_accessor :api_version - - # ISO 8601 timestamp of when the event was emitted. - sig { returns(Time) } - attr_accessor :created - - sig { returns(ModerationAPI::WebhookEvent::QueueItemAllowed::Data) } - attr_reader :data - - sig do - params( - data: ModerationAPI::WebhookEvent::QueueItemAllowed::Data::OrHash - ).void - end - attr_writer :data - - # The event type. - sig { returns(Symbol) } - attr_accessor :type - - sig do - params( - id: String, - created: Time, - data: ModerationAPI::WebhookEvent::QueueItemAllowed::Data::OrHash, - api_version: Symbol, - type: Symbol - ).returns(T.attached_class) - end - def self.new( - # Stable event ID. Use this to dedupe retries. - id:, - # ISO 8601 timestamp of when the event was emitted. - created:, - data:, - api_version: :v2, - # The event type. - type: :"queue_item.allowed" - ) - end - - sig do - override.returns( - { - id: String, - api_version: Symbol, - created: Time, - data: ModerationAPI::WebhookEvent::QueueItemAllowed::Data, - type: Symbol - } - ) - end - def to_hash - end - - class Data < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::QueueItemAllowed::Data, - ModerationAPI::Internal::AnyHash - ) - end - - sig do - returns(ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object) - end - attr_reader :object - - sig do - params( - object: - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::OrHash - ).void - end - attr_writer :object - - sig do - params( - object: - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::OrHash - ).returns(T.attached_class) - end - def self.new(object:) - end - - sig do - override.returns( - { - object: - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object - } - ) - end - def to_hash - end - - class Object < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object, - ModerationAPI::Internal::AnyHash - ) - end - - # Moderation action ID - sig { returns(String) } - attr_accessor :id - - # ISO 8601 timestamp of when the action was performed - sig { returns(Time) } - attr_accessor :created_at - - # Customer-defined key identifying this action - sig { returns(T.nilable(String)) } - attr_accessor :key - - # Display name of the action - sig { returns(T.nilable(String)) } - attr_accessor :name - - # The value passed to the action when it ran - sig { returns(T.nilable(String)) } - attr_accessor :value - - # The author the action was performed on, if any - sig do - returns( - T.nilable( - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Author - ) - ) - end - attr_reader :author - - sig do - params( - author: - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Author::OrHash - ).void - end - attr_writer :author - - # The content item the action was performed on, if any - sig do - returns( - T.nilable( - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item - ) - ) - end - attr_reader :item - - sig do - params( - item: - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::OrHash - ).void - end - attr_writer :item - - # The queue the item belongs to, if any - sig do - returns( - T.nilable( - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Queue - ) - ) - end - attr_reader :queue - - sig do - params( - queue: - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Queue::OrHash - ).void - end - attr_writer :queue - - sig do - params( - id: String, - created_at: Time, - key: T.nilable(String), - name: T.nilable(String), - value: T.nilable(String), - author: - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Author::OrHash, - item: - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::OrHash, - queue: - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Queue::OrHash - ).returns(T.attached_class) - end - def self.new( - # Moderation action ID - id:, - # ISO 8601 timestamp of when the action was performed - created_at:, - # Customer-defined key identifying this action - key:, - # Display name of the action - name:, - # The value passed to the action when it ran - value:, - # The author the action was performed on, if any - author: nil, - # The content item the action was performed on, if any - item: nil, - # The queue the item belongs to, if any - queue: nil - ) - end - - sig do - override.returns( - { - id: String, - created_at: Time, - key: T.nilable(String), - name: T.nilable(String), - value: T.nilable(String), - author: - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Author, - item: - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item, - queue: - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Queue - } - ) - end - def to_hash - end - - class Author < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Author, - ModerationAPI::Internal::AnyHash - ) - end - - # Author ID in Moderation API - sig { returns(String) } - attr_accessor :id - - # Block or suspension details, if applicable. Null if the author is enabled. - sig do - returns( - T.nilable( - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Author::Block - ) - ) - end - attr_reader :block - - sig do - params( - block: - T.nilable( - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Author::Block::OrHash - ) - ).void - end - attr_writer :block - - # Timestamp when author first appeared - sig { returns(Float) } - attr_accessor :first_seen - - # Timestamp of last activity - sig { returns(Float) } - attr_accessor :last_seen - - # Additional metadata provided by your system. We recommend including any relevant - # information that may assist in the moderation process. - sig do - returns( - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Author::Metadata - ) - end - attr_reader :metadata - - sig do - params( - metadata: - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Author::Metadata::OrHash - ).void - end - attr_writer :metadata - - sig do - returns( - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Author::Metrics - ) - end - attr_reader :metrics - - sig do - params( - metrics: - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Author::Metrics::OrHash - ).void - end - attr_writer :metrics - - # Risk assessment details, if available. - sig do - returns( - T.nilable( - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Author::RiskEvaluation - ) - ) - end - attr_reader :risk_evaluation - - sig do - params( - risk_evaluation: - T.nilable( - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Author::RiskEvaluation::OrHash - ) - ).void - end - attr_writer :risk_evaluation - - # Current author status - sig do - returns( - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Author::Status::OrSymbol - ) - end - attr_accessor :status - - sig do - returns( - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Author::TrustLevel - ) - end - attr_reader :trust_level - - sig do - params( - trust_level: - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Author::TrustLevel::OrHash - ).void - end - attr_writer :trust_level - - # The author's company or organization - sig { returns(T.nilable(String)) } - attr_accessor :company - - # Author email address - sig { returns(T.nilable(String)) } - attr_accessor :email - - # The author's ID from your system - sig { returns(T.nilable(String)) } - attr_accessor :external_id - - # URL of the author's external profile - sig { returns(T.nilable(String)) } - attr_accessor :external_link - - # Timestamp of last incident - sig { returns(T.nilable(Float)) } - attr_accessor :last_incident - - # Author name or identifier - sig { returns(T.nilable(String)) } - attr_accessor :name - - # URL of the author's profile picture - sig { returns(T.nilable(String)) } - attr_accessor :profile_picture - - # The author the action was performed on, if any - sig do - params( - id: String, - block: - T.nilable( - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Author::Block::OrHash - ), - first_seen: Float, - last_seen: Float, - metadata: - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Author::Metadata::OrHash, - metrics: - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Author::Metrics::OrHash, - risk_evaluation: - T.nilable( - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Author::RiskEvaluation::OrHash - ), - status: - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Author::Status::OrSymbol, - trust_level: - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Author::TrustLevel::OrHash, - company: T.nilable(String), - email: T.nilable(String), - external_id: T.nilable(String), - external_link: T.nilable(String), - last_incident: T.nilable(Float), - name: T.nilable(String), - profile_picture: T.nilable(String) - ).returns(T.attached_class) - end - def self.new( - # Author ID in Moderation API - id:, - # Block or suspension details, if applicable. Null if the author is enabled. - block:, - # Timestamp when author first appeared - first_seen:, - # Timestamp of last activity - last_seen:, - # Additional metadata provided by your system. We recommend including any relevant - # information that may assist in the moderation process. - metadata:, - metrics:, - # Risk assessment details, if available. - risk_evaluation:, - # Current author status - status:, - trust_level:, - # The author's company or organization - company: nil, - # Author email address - email: nil, - # The author's ID from your system - external_id: nil, - # URL of the author's external profile - external_link: nil, - # Timestamp of last incident - last_incident: nil, - # Author name or identifier - name: nil, - # URL of the author's profile picture - profile_picture: nil - ) - end - - sig do - override.returns( - { - id: String, - block: - T.nilable( - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Author::Block - ), - first_seen: Float, - last_seen: Float, - metadata: - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Author::Metadata, - metrics: - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Author::Metrics, - risk_evaluation: - T.nilable( - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Author::RiskEvaluation - ), - status: - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Author::Status::OrSymbol, - trust_level: - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Author::TrustLevel, - company: T.nilable(String), - email: T.nilable(String), - external_id: T.nilable(String), - external_link: T.nilable(String), - last_incident: T.nilable(Float), - name: T.nilable(String), - profile_picture: T.nilable(String) - } - ) - end - def to_hash - end - - class Block < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Author::Block, - ModerationAPI::Internal::AnyHash - ) - end - - # The moderators reason why the author was blocked or suspended. - sig { returns(T.nilable(String)) } - attr_accessor :reason - - # The timestamp until which they are blocked if the author is suspended. - sig { returns(T.nilable(Float)) } - attr_accessor :until_ - - # Block or suspension details, if applicable. Null if the author is enabled. - sig do - params( - reason: T.nilable(String), - until_: T.nilable(Float) - ).returns(T.attached_class) - end - def self.new( - # The moderators reason why the author was blocked or suspended. - reason: nil, - # The timestamp until which they are blocked if the author is suspended. - until_: nil - ) - end - - sig do - override.returns( - { reason: T.nilable(String), until_: T.nilable(Float) } - ) - end - def to_hash - end - end - - class Metadata < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Author::Metadata, - ModerationAPI::Internal::AnyHash - ) - end - - # Whether the author's email is verified - sig { returns(T.nilable(T::Boolean)) } - attr_accessor :email_verified - - # Whether the author's identity is verified - sig { returns(T.nilable(T::Boolean)) } - attr_accessor :identity_verified - - # Whether the author is a paying customer - sig { returns(T.nilable(T::Boolean)) } - attr_accessor :is_paying_customer - - # Whether the author's phone number is verified - sig { returns(T.nilable(T::Boolean)) } - attr_accessor :phone_verified - - # Additional metadata provided by your system. We recommend including any relevant - # information that may assist in the moderation process. - sig do - params( - email_verified: T.nilable(T::Boolean), - identity_verified: T.nilable(T::Boolean), - is_paying_customer: T.nilable(T::Boolean), - phone_verified: T.nilable(T::Boolean) - ).returns(T.attached_class) - end - def self.new( - # Whether the author's email is verified - email_verified: nil, - # Whether the author's identity is verified - identity_verified: nil, - # Whether the author is a paying customer - is_paying_customer: nil, - # Whether the author's phone number is verified - phone_verified: nil - ) - end - - sig do - override.returns( - { - email_verified: T.nilable(T::Boolean), - identity_verified: T.nilable(T::Boolean), - is_paying_customer: T.nilable(T::Boolean), - phone_verified: T.nilable(T::Boolean) - } - ) - end - def to_hash - end - end - - class Metrics < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Author::Metrics, - ModerationAPI::Internal::AnyHash - ) - end - - # Number of flagged content pieces - sig { returns(Float) } - attr_accessor :flagged_content - - # Total pieces of content - sig { returns(Float) } - attr_accessor :total_content - - # Average sentiment score of content (-1 to 1). Requires a sentiment model in your - # project. - sig { returns(T.nilable(Float)) } - attr_accessor :average_sentiment - - sig do - params( - flagged_content: Float, - total_content: Float, - average_sentiment: T.nilable(Float) - ).returns(T.attached_class) - end - def self.new( - # Number of flagged content pieces - flagged_content:, - # Total pieces of content - total_content:, - # Average sentiment score of content (-1 to 1). Requires a sentiment model in your - # project. - average_sentiment: nil - ) - end - - sig do - override.returns( - { - flagged_content: Float, - total_content: Float, - average_sentiment: T.nilable(Float) - } - ) - end - def to_hash - end - end - - class RiskEvaluation < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Author::RiskEvaluation, - ModerationAPI::Internal::AnyHash - ) - end - - # Calculated risk level based on more than 10 behavioral signals. - sig { returns(T.nilable(Float)) } - attr_accessor :risk_level - - # Risk assessment details, if available. - sig do - params(risk_level: T.nilable(Float)).returns(T.attached_class) - end - def self.new( - # Calculated risk level based on more than 10 behavioral signals. - risk_level: nil - ) - end - - sig { override.returns({ risk_level: T.nilable(Float) }) } - def to_hash - end - end - - # Current author status - module Status - extend ModerationAPI::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all( - Symbol, - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Author::Status - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - ENABLED = - T.let( - :enabled, - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Author::Status::TaggedSymbol - ) - SUSPENDED = - T.let( - :suspended, - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Author::Status::TaggedSymbol - ) - BLOCKED = - T.let( - :blocked, - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Author::Status::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Author::Status::TaggedSymbol - ] - ) - end - def self.values - end - end - - class TrustLevel < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Author::TrustLevel, - ModerationAPI::Internal::AnyHash - ) - end - - # Author trust level (-1, 0, 1, 2, 3, or 4) - sig { returns(Float) } - attr_accessor :level - - # True if the trust level was set manually by a moderator - sig { returns(T::Boolean) } - attr_accessor :manual - - sig do - params(level: Float, manual: T::Boolean).returns( - T.attached_class - ) - end - def self.new( - # Author trust level (-1, 0, 1, 2, 3, or 4) - level:, - # True if the trust level was set manually by a moderator - manual: - ) - end - - sig { override.returns({ level: Float, manual: T::Boolean }) } - def to_hash - end - end - end - - class Item < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item, - ModerationAPI::Internal::AnyHash - ) - end - - # Content ID from your system - sig { returns(String) } - attr_accessor :id - - # External author ID (the customer's identifier, not Moderation API's internal id) - sig { returns(T.nilable(String)) } - attr_accessor :author_id - - # The channel the content was submitted to, identified by your customer-defined - # channel key. - sig { returns(T.nilable(String)) } - attr_accessor :channel_key - - # A recommendation from your own client-side flagging. - sig do - returns( - T.nilable( - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::ClientAction - ) - ) - end - attr_reader :client_action - - sig do - params( - client_action: - T.nilable( - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::ClientAction::OrHash - ) - ).void - end - attr_writer :client_action - - # The original content payload - sig do - returns( - T.any( - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::Content::Text, - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::Content::Image, - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::Content::Video, - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::Content::Audio, - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::Content::Object - ) - ) - end - attr_accessor :content - - # Conversation grouping ID, if any - sig { returns(T.nilable(String)) } - attr_accessor :conversation_id - - # Whether the content was flagged by moderation - sig { returns(T.nilable(T::Boolean)) } - attr_accessor :flagged - - # For object content, the field keys (e.g. "bio") that triggered a flag. Empty - # when no fields were flagged or the content is not an object. - sig { returns(T::Array[String]) } - attr_accessor :flagged_fields - - # Moderation labels applied to the content - sig do - returns( - T.nilable( - T::Array[ - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::Label - ] - ) - ) - end - attr_accessor :labels - - # Detected ISO language code, if available - sig { returns(T.nilable(String)) } - attr_accessor :language - - # High-level content type (e.g. message, post, comment). Defaults to the channel's - # configured content type but can be overridden per request via the moderation API - # `type` field. - sig do - returns( - T.nilable( - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::MetaType::OrSymbol - ) - ) - end - attr_accessor :meta_type - - # Arbitrary key/value metadata. Top-level keys are strings. - sig { returns(T.nilable(T::Hash[Symbol, T.anything])) } - attr_accessor :metadata - - # ISO 8601 timestamp of when the content was submitted - sig { returns(Time) } - attr_accessor :timestamp - - # The content item the action was performed on, if any - sig do - params( - id: String, - author_id: T.nilable(String), - channel_key: T.nilable(String), - client_action: - T.nilable( - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::ClientAction::OrHash - ), - content: - T.any( - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::Content::Text::OrHash, - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::Content::Image::OrHash, - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::Content::Video::OrHash, - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::Content::Audio::OrHash, - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::Content::Object::OrHash - ), - conversation_id: T.nilable(String), - flagged: T.nilable(T::Boolean), - flagged_fields: T::Array[String], - labels: - T.nilable( - T::Array[ - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::Label::OrHash - ] - ), - language: T.nilable(String), - meta_type: - T.nilable( - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::MetaType::OrSymbol - ), - metadata: T.nilable(T::Hash[Symbol, T.anything]), - timestamp: Time - ).returns(T.attached_class) - end - def self.new( - # Content ID from your system - id:, - # External author ID (the customer's identifier, not Moderation API's internal id) - author_id:, - # The channel the content was submitted to, identified by your customer-defined - # channel key. - channel_key:, - # A recommendation from your own client-side flagging. - client_action:, - # The original content payload - content:, - # Conversation grouping ID, if any - conversation_id:, - # Whether the content was flagged by moderation - flagged:, - # For object content, the field keys (e.g. "bio") that triggered a flag. Empty - # when no fields were flagged or the content is not an object. - flagged_fields:, - # Moderation labels applied to the content - labels:, - # Detected ISO language code, if available - language:, - # High-level content type (e.g. message, post, comment). Defaults to the channel's - # configured content type but can be overridden per request via the moderation API - # `type` field. - meta_type:, - # Arbitrary key/value metadata. Top-level keys are strings. - metadata:, - # ISO 8601 timestamp of when the content was submitted - timestamp: - ) - end - - sig do - override.returns( - { - id: String, - author_id: T.nilable(String), - channel_key: T.nilable(String), - client_action: - T.nilable( - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::ClientAction - ), - content: - T.any( - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::Content::Text, - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::Content::Image, - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::Content::Video, - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::Content::Audio, - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::Content::Object - ), - conversation_id: T.nilable(String), - flagged: T.nilable(T::Boolean), - flagged_fields: T::Array[String], - labels: - T.nilable( - T::Array[ - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::Label - ] - ), - language: T.nilable(String), - meta_type: - T.nilable( - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::MetaType::OrSymbol - ), - metadata: T.nilable(T::Hash[Symbol, T.anything]), - timestamp: Time - } - ) - end - def to_hash - end - - class ClientAction < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::ClientAction, - ModerationAPI::Internal::AnyHash - ) - end - - # Your recommendation for the content: allow, review, or reject. - sig do - returns( - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::ClientAction::Action::OrSymbol - ) - end - attr_accessor :action - - # How your recommendation combines with ours. Defaults to 'escalate', which only - # applies it when stricter than ours; 'override' replaces ours outright. - sig do - returns( - T.nilable( - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::ClientAction::Behavior::OrSymbol - ) - ) - end - attr_reader :behavior - - sig do - params( - behavior: - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::ClientAction::Behavior::OrSymbol - ).void - end - attr_writer :behavior - - # A human-readable explanation for your recommendation. - sig { returns(T.nilable(String)) } - attr_reader :reason - - sig { params(reason: String).void } - attr_writer :reason - - # Where your recommendation came from, e.g. "banned-ip". - sig { returns(T.nilable(String)) } - attr_reader :source - - sig { params(source: String).void } - attr_writer :source - - # A recommendation from your own client-side flagging. - sig do - params( - action: - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::ClientAction::Action::OrSymbol, - behavior: - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::ClientAction::Behavior::OrSymbol, - reason: String, - source: String - ).returns(T.attached_class) - end - def self.new( - # Your recommendation for the content: allow, review, or reject. - action:, - # How your recommendation combines with ours. Defaults to 'escalate', which only - # applies it when stricter than ours; 'override' replaces ours outright. - behavior: nil, - # A human-readable explanation for your recommendation. - reason: nil, - # Where your recommendation came from, e.g. "banned-ip". - source: nil - ) - end - - sig do - override.returns( - { - action: - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::ClientAction::Action::OrSymbol, - behavior: - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::ClientAction::Behavior::OrSymbol, - reason: String, - source: String - } - ) - end - def to_hash - end - - # Your recommendation for the content: allow, review, or reject. - module Action - extend ModerationAPI::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all( - Symbol, - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::ClientAction::Action - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - REVIEW = - T.let( - :review, - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::ClientAction::Action::TaggedSymbol - ) - ALLOW = - T.let( - :allow, - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::ClientAction::Action::TaggedSymbol - ) - REJECT = - T.let( - :reject, - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::ClientAction::Action::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::ClientAction::Action::TaggedSymbol - ] - ) - end - def self.values - end - end - - # How your recommendation combines with ours. Defaults to 'escalate', which only - # applies it when stricter than ours; 'override' replaces ours outright. - module Behavior - extend ModerationAPI::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all( - Symbol, - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::ClientAction::Behavior - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - OVERRIDE = - T.let( - :override, - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::ClientAction::Behavior::TaggedSymbol - ) - ESCALATE = - T.let( - :escalate, - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::ClientAction::Behavior::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::ClientAction::Behavior::TaggedSymbol - ] - ) - end - def self.values - end - end - end - - # The original content payload - module Content - extend ModerationAPI::Internal::Type::Union - - Variants = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::Content::Text, - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::Content::Image, - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::Content::Video, - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::Content::Audio, - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::Content::Object - ) - end - - class Text < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::Content::Text, - ModerationAPI::Internal::AnyHash - ) - end - - # The content text - sig { returns(String) } - attr_accessor :text - - sig { returns(Symbol) } - attr_accessor :type - - # Text - sig do - params(text: String, type: Symbol).returns(T.attached_class) - end - def self.new( - # The content text - text:, - type: :text - ) - end - - sig { override.returns({ text: String, type: Symbol }) } - def to_hash - end - end - - class Image < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::Content::Image, - ModerationAPI::Internal::AnyHash - ) - end - - sig { returns(Symbol) } - attr_accessor :type - - # Base64-encoded image data. Either url or data must be provided. Note: base64 - # images are not stored and will not appear in the review queue. - sig { returns(T.nilable(String)) } - attr_reader :data - - sig { params(data: String).void } - attr_writer :data - - # A public URL of the image content. Either url or data must be provided. - sig { returns(T.nilable(String)) } - attr_reader :url - - sig { params(url: String).void } - attr_writer :url - - # Image - sig do - params(data: String, url: String, type: Symbol).returns( - T.attached_class - ) - end - def self.new( - # Base64-encoded image data. Either url or data must be provided. Note: base64 - # images are not stored and will not appear in the review queue. - data: nil, - # A public URL of the image content. Either url or data must be provided. - url: nil, - type: :image - ) - end - - sig do - override.returns( - { type: Symbol, data: String, url: String } - ) - end - def to_hash - end - end - - class Video < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::Content::Video, - ModerationAPI::Internal::AnyHash - ) - end - - sig { returns(Symbol) } - attr_accessor :type - - # A public URL of the video content - sig { returns(String) } - attr_accessor :url - - # Video - sig do - params(url: String, type: Symbol).returns(T.attached_class) - end - def self.new( - # A public URL of the video content - url:, - type: :video - ) - end - - sig { override.returns({ type: Symbol, url: String }) } - def to_hash - end - end - - class Audio < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::Content::Audio, - ModerationAPI::Internal::AnyHash - ) - end - - sig { returns(Symbol) } - attr_accessor :type - - # The URL of the audio content - sig { returns(String) } - attr_accessor :url - - # Audio - sig do - params(url: String, type: Symbol).returns(T.attached_class) - end - def self.new( - # The URL of the audio content - url:, - type: :audio - ) - end - - sig { override.returns({ type: Symbol, url: String }) } - def to_hash - end - end - - class Object < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::Content::Object, - ModerationAPI::Internal::AnyHash - ) - end - - # Values in the object. Can be mixed content types. - sig do - returns( - T::Hash[ - Symbol, - T.any( - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::Content::Object::Data::Text, - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::Content::Object::Data::Image, - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::Content::Object::Data::Video, - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::Content::Object::Data::Audio - ) - ] - ) - end - attr_accessor :data - - sig { returns(Symbol) } - attr_accessor :type - - # Object - sig do - params( - data: - T::Hash[ - Symbol, - T.any( - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::Content::Object::Data::Text::OrHash, - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::Content::Object::Data::Image::OrHash, - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::Content::Object::Data::Video::OrHash, - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::Content::Object::Data::Audio::OrHash - ) - ], - type: Symbol - ).returns(T.attached_class) - end - def self.new( - # Values in the object. Can be mixed content types. - data:, - type: :object - ) - end - - sig do - override.returns( - { - data: - T::Hash[ - Symbol, - T.any( - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::Content::Object::Data::Text, - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::Content::Object::Data::Image, - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::Content::Object::Data::Video, - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::Content::Object::Data::Audio - ) - ], - type: Symbol - } - ) - end - def to_hash - end - - # Text - module Data - extend ModerationAPI::Internal::Type::Union - - Variants = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::Content::Object::Data::Text, - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::Content::Object::Data::Image, - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::Content::Object::Data::Video, - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::Content::Object::Data::Audio - ) - end - - class Text < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::Content::Object::Data::Text, - ModerationAPI::Internal::AnyHash - ) - end - - # The content text - sig { returns(String) } - attr_accessor :text - - sig { returns(Symbol) } - attr_accessor :type - - # Text - sig do - params(text: String, type: Symbol).returns( - T.attached_class - ) - end - def self.new( - # The content text - text:, - type: :text - ) - end - - sig { override.returns({ text: String, type: Symbol }) } - def to_hash - end - end - - class Image < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::Content::Object::Data::Image, - ModerationAPI::Internal::AnyHash - ) - end - - sig { returns(Symbol) } - attr_accessor :type - - # Base64-encoded image data. Either url or data must be provided. Note: base64 - # images are not stored and will not appear in the review queue. - sig { returns(T.nilable(String)) } - attr_reader :data - - sig { params(data: String).void } - attr_writer :data - - # A public URL of the image content. Either url or data must be provided. - sig { returns(T.nilable(String)) } - attr_reader :url - - sig { params(url: String).void } - attr_writer :url - - # Image - sig do - params(data: String, url: String, type: Symbol).returns( - T.attached_class - ) - end - def self.new( - # Base64-encoded image data. Either url or data must be provided. Note: base64 - # images are not stored and will not appear in the review queue. - data: nil, - # A public URL of the image content. Either url or data must be provided. - url: nil, - type: :image - ) - end - - sig do - override.returns( - { type: Symbol, data: String, url: String } - ) - end - def to_hash - end - end - - class Video < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::Content::Object::Data::Video, - ModerationAPI::Internal::AnyHash - ) - end - - sig { returns(Symbol) } - attr_accessor :type - - # A public URL of the video content - sig { returns(String) } - attr_accessor :url - - # Video - sig do - params(url: String, type: Symbol).returns( - T.attached_class - ) - end - def self.new( - # A public URL of the video content - url:, - type: :video - ) - end - - sig { override.returns({ type: Symbol, url: String }) } - def to_hash - end - end - - class Audio < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::Content::Object::Data::Audio, - ModerationAPI::Internal::AnyHash - ) - end - - sig { returns(Symbol) } - attr_accessor :type - - # The URL of the audio content - sig { returns(String) } - attr_accessor :url - - # Audio - sig do - params(url: String, type: Symbol).returns( - T.attached_class - ) - end - def self.new( - # The URL of the audio content - url:, - type: :audio - ) - end - - sig { override.returns({ type: Symbol, url: String }) } - def to_hash - end - end - - sig do - override.returns( - T::Array[ - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::Content::Object::Data::Variants - ] - ) - end - def self.variants - end - end - end - - sig do - override.returns( - T::Array[ - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::Content::Variants - ] - ) - end - def self.variants - end - end - - class Label < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::Label, - ModerationAPI::Internal::AnyHash - ) - end - - # The label name - sig { returns(String) } - attr_accessor :label - - # Confidence score between 0 and 1 - sig { returns(Float) } - attr_accessor :score - - # Whether this label crossed its flagging threshold - sig { returns(T.nilable(T::Boolean)) } - attr_reader :flagged - - sig { params(flagged: T::Boolean).void } - attr_writer :flagged - - # True if the label was applied manually by a moderator - sig { returns(T.nilable(T::Boolean)) } - attr_reader :manual - - sig { params(manual: T::Boolean).void } - attr_writer :manual - - sig do - returns( - T.nilable( - T::Array[ - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::Label::Match - ] - ) - ) - end - attr_reader :matches - - sig do - params( - matches: - T::Array[ - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::Label::Match::OrHash - ] - ).void - end - attr_writer :matches - - # Whether this label crossed its threshold under a shadowed policy — reported for - # visibility, never counted toward a flagging decision - sig { returns(T.nilable(T::Boolean)) } - attr_reader :shadow_flagged - - sig { params(shadow_flagged: T::Boolean).void } - attr_writer :shadow_flagged - - sig do - params( - label: String, - score: Float, - flagged: T::Boolean, - manual: T::Boolean, - matches: - T::Array[ - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::Label::Match::OrHash - ], - shadow_flagged: T::Boolean - ).returns(T.attached_class) - end - def self.new( - # The label name - label:, - # Confidence score between 0 and 1 - score:, - # Whether this label crossed its flagging threshold - flagged: nil, - # True if the label was applied manually by a moderator - manual: nil, - matches: nil, - # Whether this label crossed its threshold under a shadowed policy — reported for - # visibility, never counted toward a flagging decision - shadow_flagged: nil - ) - end - - sig do - override.returns( - { - label: String, - score: Float, - flagged: T::Boolean, - manual: T::Boolean, - matches: - T::Array[ - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::Label::Match - ], - shadow_flagged: T::Boolean - } - ) - end - def to_hash - end - - class Match < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::Label::Match, - ModerationAPI::Internal::AnyHash - ) - end - - # The matched substring - sig { returns(String) } - attr_accessor :match - - # Match confidence between 0 and 1 - sig { returns(Float) } - attr_accessor :probability - - # [start, end] character offsets in the source text - sig { returns(T::Array[T.anything]) } - attr_accessor :span - - sig { returns(T.nilable(String)) } - attr_reader :entity_type - - sig { params(entity_type: String).void } - attr_writer :entity_type - - sig { returns(T.nilable(String)) } - attr_accessor :mask - - sig { returns(T.nilable(T::Array[String])) } - attr_reader :reasons - - sig { params(reasons: T::Array[String]).void } - attr_writer :reasons - - sig { returns(T.nilable(T::Array[String])) } - attr_reader :scripts - - sig { params(scripts: T::Array[String]).void } - attr_writer :scripts - - sig do - returns( - T.nilable( - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::Label::Match::Signals - ) - ) - end - attr_reader :signals - - sig do - params( - signals: - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::Label::Match::Signals::OrHash - ).void - end - attr_writer :signals - - sig { returns(T.nilable(String)) } - attr_reader :skeleton - - sig { params(skeleton: String).void } - attr_writer :skeleton - - sig do - params( - match: String, - probability: Float, - span: T::Array[T.anything], - entity_type: String, - mask: T.nilable(String), - reasons: T::Array[String], - scripts: T::Array[String], - signals: - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::Label::Match::Signals::OrHash, - skeleton: String - ).returns(T.attached_class) - end - def self.new( - # The matched substring - match:, - # Match confidence between 0 and 1 - probability:, - # [start, end] character offsets in the source text - span:, - entity_type: nil, - mask: nil, - reasons: nil, - scripts: nil, - signals: nil, - skeleton: nil - ) - end - - sig do - override.returns( - { - match: String, - probability: Float, - span: T::Array[T.anything], - entity_type: String, - mask: T.nilable(String), - reasons: T::Array[String], - scripts: T::Array[String], - signals: - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::Label::Match::Signals, - skeleton: String - } - ) - end - def to_hash - end - - class Signals < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::Label::Match::Signals, - ModerationAPI::Internal::AnyHash - ) - end - - sig { returns(T.nilable(T::Boolean)) } - attr_accessor :bot_protection - - sig do - returns( - T.nilable( - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::Label::Match::Signals::BrandImpersonation - ) - ) - end - attr_reader :brand_impersonation - - sig do - params( - brand_impersonation: - T.nilable( - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::Label::Match::Signals::BrandImpersonation::OrHash - ) - ).void - end - attr_writer :brand_impersonation - - sig { returns(T.nilable(Float)) } - attr_accessor :domain_age_days - - sig { returns(T.nilable(String)) } - attr_accessor :final_url - - sig { returns(T.nilable(T::Boolean)) } - attr_accessor :has_email_setup - - sig { returns(T::Boolean) } - attr_accessor :has_suspicious_characters - - sig { returns(T::Boolean) } - attr_accessor :is_link_shortener - - sig { returns(T::Boolean) } - attr_accessor :is_reported - - sig { returns(T.nilable(Float)) } - attr_accessor :redirect_count - - sig do - params( - bot_protection: T.nilable(T::Boolean), - brand_impersonation: - T.nilable( - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::Label::Match::Signals::BrandImpersonation::OrHash - ), - domain_age_days: T.nilable(Float), - final_url: T.nilable(String), - has_email_setup: T.nilable(T::Boolean), - has_suspicious_characters: T::Boolean, - is_link_shortener: T::Boolean, - is_reported: T::Boolean, - redirect_count: T.nilable(Float) - ).returns(T.attached_class) - end - def self.new( - bot_protection:, - brand_impersonation:, - domain_age_days:, - final_url:, - has_email_setup:, - has_suspicious_characters:, - is_link_shortener:, - is_reported:, - redirect_count: - ) - end - - sig do - override.returns( - { - bot_protection: T.nilable(T::Boolean), - brand_impersonation: - T.nilable( - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::Label::Match::Signals::BrandImpersonation - ), - domain_age_days: T.nilable(Float), - final_url: T.nilable(String), - has_email_setup: T.nilable(T::Boolean), - has_suspicious_characters: T::Boolean, - is_link_shortener: T::Boolean, - is_reported: T::Boolean, - redirect_count: T.nilable(Float) - } - ) - end - def to_hash - end - - class BrandImpersonation < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::Label::Match::Signals::BrandImpersonation, - ModerationAPI::Internal::AnyHash - ) - end - - sig { returns(String) } - attr_accessor :brand - - sig { returns(String) } - attr_accessor :method_ - - sig do - params(brand: String, method_: String).returns( - T.attached_class - ) - end - def self.new(brand:, method_:) - end - - sig do - override.returns({ brand: String, method_: String }) - end - def to_hash - end - end - end - end - end - - # High-level content type (e.g. message, post, comment). Defaults to the channel's - # configured content type but can be overridden per request via the moderation API - # `type` field. - module MetaType - extend ModerationAPI::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all( - Symbol, - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::MetaType - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - PROFILE = - T.let( - :profile, - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::MetaType::TaggedSymbol - ) - MESSAGE = - T.let( - :message, - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::MetaType::TaggedSymbol - ) - POST = - T.let( - :post, - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::MetaType::TaggedSymbol - ) - COMMENT = - T.let( - :comment, - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::MetaType::TaggedSymbol - ) - EVENT = - T.let( - :event, - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::MetaType::TaggedSymbol - ) - PRODUCT = - T.let( - :product, - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::MetaType::TaggedSymbol - ) - REVIEW = - T.let( - :review, - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::MetaType::TaggedSymbol - ) - VOICE = - T.let( - :voice, - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::MetaType::TaggedSymbol - ) - OTHER = - T.let( - :other, - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::MetaType::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::MetaType::TaggedSymbol - ] - ) - end - def self.values - end - end - end - - class Queue < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Queue, - ModerationAPI::Internal::AnyHash - ) - end - - sig { returns(String) } - attr_accessor :id - - # The queue the item belongs to, if any - sig { params(id: String).returns(T.attached_class) } - def self.new(id:) - end - - sig { override.returns({ id: String }) } - def to_hash - end - end - end - end - end - - sig { override.returns(T::Array[ModerationAPI::WebhookEvent::Variants]) } - def self.variants - end - end - end -end diff --git a/rbi/moderation_api/models/webhook_list_params.rbi b/rbi/moderation_api/models/webhook_list_params.rbi deleted file mode 100644 index 0baabda1..00000000 --- a/rbi/moderation_api/models/webhook_list_params.rbi +++ /dev/null @@ -1,32 +0,0 @@ -# typed: strong - -module ModerationAPI - module Models - class WebhookListParams < ModerationAPI::Internal::Type::BaseModel - extend ModerationAPI::Internal::Type::RequestParameters::Converter - include ModerationAPI::Internal::Type::RequestParameters - - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookListParams, - ModerationAPI::Internal::AnyHash - ) - end - - sig do - params(request_options: ModerationAPI::RequestOptions::OrHash).returns( - T.attached_class - ) - end - def self.new(request_options: {}) - end - - sig do - override.returns({ request_options: ModerationAPI::RequestOptions }) - end - def to_hash - end - end - end -end diff --git a/rbi/moderation_api/models/webhook_list_response.rbi b/rbi/moderation_api/models/webhook_list_response.rbi deleted file mode 100644 index 9ad97de0..00000000 --- a/rbi/moderation_api/models/webhook_list_response.rbi +++ /dev/null @@ -1,233 +0,0 @@ -# typed: strong - -module ModerationAPI - module Models - class WebhookListResponseItem < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::Models::WebhookListResponseItem, - ModerationAPI::Internal::AnyHash - ) - end - - # The ID of the webhook. - sig { returns(String) } - attr_accessor :id - - # The date the webhook was created. - sig { returns(String) } - attr_accessor :created_at - - # Event types this webhook subscribes to. Empty for legacy v1 webhooks, which - # subscribe via their single deprecated `type` instead. - sig do - returns( - T::Array[ - ModerationAPI::Models::WebhookListResponseItem::EventType::TaggedSymbol - ] - ) - end - attr_accessor :event_types - - # The webhook's name. - sig { returns(String) } - attr_accessor :name - - # Payload envelope version. V2 is the Stripe-style envelope; V1 is the legacy flat - # shape and is read-only via this API. - sig do - returns( - ModerationAPI::Models::WebhookListResponseItem::PayloadVersion::TaggedSymbol - ) - end - attr_accessor :payload_version - - # The URL we call when a subscribed event occurs. - sig { returns(String) } - attr_accessor :url - - # The webhook's description. - sig { returns(T.nilable(String)) } - attr_accessor :description - - sig do - params( - id: String, - created_at: String, - event_types: - T::Array[ - ModerationAPI::Models::WebhookListResponseItem::EventType::OrSymbol - ], - name: String, - payload_version: - ModerationAPI::Models::WebhookListResponseItem::PayloadVersion::OrSymbol, - url: String, - description: T.nilable(String) - ).returns(T.attached_class) - end - def self.new( - # The ID of the webhook. - id:, - # The date the webhook was created. - created_at:, - # Event types this webhook subscribes to. Empty for legacy v1 webhooks, which - # subscribe via their single deprecated `type` instead. - event_types:, - # The webhook's name. - name:, - # Payload envelope version. V2 is the Stripe-style envelope; V1 is the legacy flat - # shape and is read-only via this API. - payload_version:, - # The URL we call when a subscribed event occurs. - url:, - # The webhook's description. - description: nil - ) - end - - sig do - override.returns( - { - id: String, - created_at: String, - event_types: - T::Array[ - ModerationAPI::Models::WebhookListResponseItem::EventType::TaggedSymbol - ], - name: String, - payload_version: - ModerationAPI::Models::WebhookListResponseItem::PayloadVersion::TaggedSymbol, - url: String, - description: T.nilable(String) - } - ) - end - def to_hash - end - - module EventType - extend ModerationAPI::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all( - Symbol, - ModerationAPI::Models::WebhookListResponseItem::EventType - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - QUEUE_ITEM_NEW = - T.let( - :QUEUE_ITEM_NEW, - ModerationAPI::Models::WebhookListResponseItem::EventType::TaggedSymbol - ) - QUEUE_ITEM_COMPLETED = - T.let( - :QUEUE_ITEM_COMPLETED, - ModerationAPI::Models::WebhookListResponseItem::EventType::TaggedSymbol - ) - QUEUE_ITEM_ACTION = - T.let( - :QUEUE_ITEM_ACTION, - ModerationAPI::Models::WebhookListResponseItem::EventType::TaggedSymbol - ) - QUEUE_ITEM_REJECTED = - T.let( - :QUEUE_ITEM_REJECTED, - ModerationAPI::Models::WebhookListResponseItem::EventType::TaggedSymbol - ) - QUEUE_ITEM_ALLOWED = - T.let( - :QUEUE_ITEM_ALLOWED, - ModerationAPI::Models::WebhookListResponseItem::EventType::TaggedSymbol - ) - AUTHOR_BLOCKED = - T.let( - :AUTHOR_BLOCKED, - ModerationAPI::Models::WebhookListResponseItem::EventType::TaggedSymbol - ) - AUTHOR_UNBLOCKED = - T.let( - :AUTHOR_UNBLOCKED, - ModerationAPI::Models::WebhookListResponseItem::EventType::TaggedSymbol - ) - AUTHOR_SUSPENDED = - T.let( - :AUTHOR_SUSPENDED, - ModerationAPI::Models::WebhookListResponseItem::EventType::TaggedSymbol - ) - AUTHOR_UPDATED = - T.let( - :AUTHOR_UPDATED, - ModerationAPI::Models::WebhookListResponseItem::EventType::TaggedSymbol - ) - AUTHOR_TRUST_LEVEL_CHANGED = - T.let( - :AUTHOR_TRUST_LEVEL_CHANGED, - ModerationAPI::Models::WebhookListResponseItem::EventType::TaggedSymbol - ) - AUTHOR_ACTION = - T.let( - :AUTHOR_ACTION, - ModerationAPI::Models::WebhookListResponseItem::EventType::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - ModerationAPI::Models::WebhookListResponseItem::EventType::TaggedSymbol - ] - ) - end - def self.values - end - end - - # Payload envelope version. V2 is the Stripe-style envelope; V1 is the legacy flat - # shape and is read-only via this API. - module PayloadVersion - extend ModerationAPI::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all( - Symbol, - ModerationAPI::Models::WebhookListResponseItem::PayloadVersion - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - V1 = - T.let( - :V1, - ModerationAPI::Models::WebhookListResponseItem::PayloadVersion::TaggedSymbol - ) - V2 = - T.let( - :V2, - ModerationAPI::Models::WebhookListResponseItem::PayloadVersion::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - ModerationAPI::Models::WebhookListResponseItem::PayloadVersion::TaggedSymbol - ] - ) - end - def self.values - end - end - end - - WebhookListResponse = - T.let( - ModerationAPI::Internal::Type::ArrayOf[ - ModerationAPI::Models::WebhookListResponseItem - ], - ModerationAPI::Internal::Type::Converter - ) - end -end diff --git a/rbi/moderation_api/models/webhook_retrieve_params.rbi b/rbi/moderation_api/models/webhook_retrieve_params.rbi deleted file mode 100644 index eebf1a49..00000000 --- a/rbi/moderation_api/models/webhook_retrieve_params.rbi +++ /dev/null @@ -1,43 +0,0 @@ -# typed: strong - -module ModerationAPI - module Models - class WebhookRetrieveParams < ModerationAPI::Internal::Type::BaseModel - extend ModerationAPI::Internal::Type::RequestParameters::Converter - include ModerationAPI::Internal::Type::RequestParameters - - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookRetrieveParams, - ModerationAPI::Internal::AnyHash - ) - end - - # The ID of the webhook to get. - sig { returns(String) } - attr_accessor :id - - sig do - params( - id: String, - request_options: ModerationAPI::RequestOptions::OrHash - ).returns(T.attached_class) - end - def self.new( - # The ID of the webhook to get. - id:, - request_options: {} - ) - end - - sig do - override.returns( - { id: String, request_options: ModerationAPI::RequestOptions } - ) - end - def to_hash - end - end - end -end diff --git a/rbi/moderation_api/models/webhook_retrieve_response.rbi b/rbi/moderation_api/models/webhook_retrieve_response.rbi deleted file mode 100644 index 100339e1..00000000 --- a/rbi/moderation_api/models/webhook_retrieve_response.rbi +++ /dev/null @@ -1,225 +0,0 @@ -# typed: strong - -module ModerationAPI - module Models - class WebhookRetrieveResponse < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::Models::WebhookRetrieveResponse, - ModerationAPI::Internal::AnyHash - ) - end - - # The ID of the webhook. - sig { returns(String) } - attr_accessor :id - - # The date the webhook was created. - sig { returns(String) } - attr_accessor :created_at - - # Event types this webhook subscribes to. Empty for legacy v1 webhooks, which - # subscribe via their single deprecated `type` instead. - sig do - returns( - T::Array[ - ModerationAPI::Models::WebhookRetrieveResponse::EventType::TaggedSymbol - ] - ) - end - attr_accessor :event_types - - # The webhook's name. - sig { returns(String) } - attr_accessor :name - - # Payload envelope version. V2 is the Stripe-style envelope; V1 is the legacy flat - # shape and is read-only via this API. - sig do - returns( - ModerationAPI::Models::WebhookRetrieveResponse::PayloadVersion::TaggedSymbol - ) - end - attr_accessor :payload_version - - # The URL we call when a subscribed event occurs. - sig { returns(String) } - attr_accessor :url - - # The webhook's description. - sig { returns(T.nilable(String)) } - attr_accessor :description - - sig do - params( - id: String, - created_at: String, - event_types: - T::Array[ - ModerationAPI::Models::WebhookRetrieveResponse::EventType::OrSymbol - ], - name: String, - payload_version: - ModerationAPI::Models::WebhookRetrieveResponse::PayloadVersion::OrSymbol, - url: String, - description: T.nilable(String) - ).returns(T.attached_class) - end - def self.new( - # The ID of the webhook. - id:, - # The date the webhook was created. - created_at:, - # Event types this webhook subscribes to. Empty for legacy v1 webhooks, which - # subscribe via their single deprecated `type` instead. - event_types:, - # The webhook's name. - name:, - # Payload envelope version. V2 is the Stripe-style envelope; V1 is the legacy flat - # shape and is read-only via this API. - payload_version:, - # The URL we call when a subscribed event occurs. - url:, - # The webhook's description. - description: nil - ) - end - - sig do - override.returns( - { - id: String, - created_at: String, - event_types: - T::Array[ - ModerationAPI::Models::WebhookRetrieveResponse::EventType::TaggedSymbol - ], - name: String, - payload_version: - ModerationAPI::Models::WebhookRetrieveResponse::PayloadVersion::TaggedSymbol, - url: String, - description: T.nilable(String) - } - ) - end - def to_hash - end - - module EventType - extend ModerationAPI::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all( - Symbol, - ModerationAPI::Models::WebhookRetrieveResponse::EventType - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - QUEUE_ITEM_NEW = - T.let( - :QUEUE_ITEM_NEW, - ModerationAPI::Models::WebhookRetrieveResponse::EventType::TaggedSymbol - ) - QUEUE_ITEM_COMPLETED = - T.let( - :QUEUE_ITEM_COMPLETED, - ModerationAPI::Models::WebhookRetrieveResponse::EventType::TaggedSymbol - ) - QUEUE_ITEM_ACTION = - T.let( - :QUEUE_ITEM_ACTION, - ModerationAPI::Models::WebhookRetrieveResponse::EventType::TaggedSymbol - ) - QUEUE_ITEM_REJECTED = - T.let( - :QUEUE_ITEM_REJECTED, - ModerationAPI::Models::WebhookRetrieveResponse::EventType::TaggedSymbol - ) - QUEUE_ITEM_ALLOWED = - T.let( - :QUEUE_ITEM_ALLOWED, - ModerationAPI::Models::WebhookRetrieveResponse::EventType::TaggedSymbol - ) - AUTHOR_BLOCKED = - T.let( - :AUTHOR_BLOCKED, - ModerationAPI::Models::WebhookRetrieveResponse::EventType::TaggedSymbol - ) - AUTHOR_UNBLOCKED = - T.let( - :AUTHOR_UNBLOCKED, - ModerationAPI::Models::WebhookRetrieveResponse::EventType::TaggedSymbol - ) - AUTHOR_SUSPENDED = - T.let( - :AUTHOR_SUSPENDED, - ModerationAPI::Models::WebhookRetrieveResponse::EventType::TaggedSymbol - ) - AUTHOR_UPDATED = - T.let( - :AUTHOR_UPDATED, - ModerationAPI::Models::WebhookRetrieveResponse::EventType::TaggedSymbol - ) - AUTHOR_TRUST_LEVEL_CHANGED = - T.let( - :AUTHOR_TRUST_LEVEL_CHANGED, - ModerationAPI::Models::WebhookRetrieveResponse::EventType::TaggedSymbol - ) - AUTHOR_ACTION = - T.let( - :AUTHOR_ACTION, - ModerationAPI::Models::WebhookRetrieveResponse::EventType::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - ModerationAPI::Models::WebhookRetrieveResponse::EventType::TaggedSymbol - ] - ) - end - def self.values - end - end - - # Payload envelope version. V2 is the Stripe-style envelope; V1 is the legacy flat - # shape and is read-only via this API. - module PayloadVersion - extend ModerationAPI::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all( - Symbol, - ModerationAPI::Models::WebhookRetrieveResponse::PayloadVersion - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - V1 = - T.let( - :V1, - ModerationAPI::Models::WebhookRetrieveResponse::PayloadVersion::TaggedSymbol - ) - V2 = - T.let( - :V2, - ModerationAPI::Models::WebhookRetrieveResponse::PayloadVersion::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - ModerationAPI::Models::WebhookRetrieveResponse::PayloadVersion::TaggedSymbol - ] - ) - end - def self.values - end - end - end - end -end diff --git a/rbi/moderation_api/models/webhook_secret_retrieve_params.rbi b/rbi/moderation_api/models/webhook_secret_retrieve_params.rbi deleted file mode 100644 index f8f987a8..00000000 --- a/rbi/moderation_api/models/webhook_secret_retrieve_params.rbi +++ /dev/null @@ -1,32 +0,0 @@ -# typed: strong - -module ModerationAPI - module Models - class WebhookSecretRetrieveParams < ModerationAPI::Internal::Type::BaseModel - extend ModerationAPI::Internal::Type::RequestParameters::Converter - include ModerationAPI::Internal::Type::RequestParameters - - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookSecretRetrieveParams, - ModerationAPI::Internal::AnyHash - ) - end - - sig do - params(request_options: ModerationAPI::RequestOptions::OrHash).returns( - T.attached_class - ) - end - def self.new(request_options: {}) - end - - sig do - override.returns({ request_options: ModerationAPI::RequestOptions }) - end - def to_hash - end - end - end -end diff --git a/rbi/moderation_api/models/webhook_secret_retrieve_response.rbi b/rbi/moderation_api/models/webhook_secret_retrieve_response.rbi deleted file mode 100644 index 11888d9f..00000000 --- a/rbi/moderation_api/models/webhook_secret_retrieve_response.rbi +++ /dev/null @@ -1,34 +0,0 @@ -# typed: strong - -module ModerationAPI - module Models - class WebhookSecretRetrieveResponse < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::Models::WebhookSecretRetrieveResponse, - ModerationAPI::Internal::AnyHash - ) - end - - # The signing secret for this project. Every webhook delivery is signed with - # HMAC-SHA256 over the raw JSON body, hex-encoded in the `modapi-signature` - # header. - sig { returns(String) } - attr_accessor :secret - - sig { params(secret: String).returns(T.attached_class) } - def self.new( - # The signing secret for this project. Every webhook delivery is signed with - # HMAC-SHA256 over the raw JSON body, hex-encoded in the `modapi-signature` - # header. - secret: - ) - end - - sig { override.returns({ secret: String }) } - def to_hash - end - end - end -end diff --git a/rbi/moderation_api/models/webhook_update_params.rbi b/rbi/moderation_api/models/webhook_update_params.rbi deleted file mode 100644 index 72347eb9..00000000 --- a/rbi/moderation_api/models/webhook_update_params.rbi +++ /dev/null @@ -1,178 +0,0 @@ -# typed: strong - -module ModerationAPI - module Models - class WebhookUpdateParams < ModerationAPI::Internal::Type::BaseModel - extend ModerationAPI::Internal::Type::RequestParameters::Converter - include ModerationAPI::Internal::Type::RequestParameters - - OrHash = - T.type_alias do - T.any( - ModerationAPI::WebhookUpdateParams, - ModerationAPI::Internal::AnyHash - ) - end - - # The ID of the webhook to update. - sig { returns(String) } - attr_accessor :id - - # The webhook's description - sig { returns(T.nilable(String)) } - attr_accessor :description - - # Event types this webhook subscribes to. One webhook URL receives all events you - # list here. - sig do - returns( - T.nilable( - T::Array[ModerationAPI::WebhookUpdateParams::EventType::OrSymbol] - ) - ) - end - attr_reader :event_types - - sig do - params( - event_types: - T::Array[ModerationAPI::WebhookUpdateParams::EventType::OrSymbol] - ).void - end - attr_writer :event_types - - # The webhook's name, used to identify it in the dashboard - sig { returns(T.nilable(String)) } - attr_reader :name - - sig { params(name: String).void } - attr_writer :name - - # The webhook's URL. We'll call this URL when an event occurs. - sig { returns(T.nilable(String)) } - attr_reader :url - - sig { params(url: String).void } - attr_writer :url - - sig do - params( - id: String, - description: T.nilable(String), - event_types: - T::Array[ModerationAPI::WebhookUpdateParams::EventType::OrSymbol], - name: String, - url: String, - request_options: ModerationAPI::RequestOptions::OrHash - ).returns(T.attached_class) - end - def self.new( - # The ID of the webhook to update. - id:, - # The webhook's description - description: nil, - # Event types this webhook subscribes to. One webhook URL receives all events you - # list here. - event_types: nil, - # The webhook's name, used to identify it in the dashboard - name: nil, - # The webhook's URL. We'll call this URL when an event occurs. - url: nil, - request_options: {} - ) - end - - sig do - override.returns( - { - id: String, - description: T.nilable(String), - event_types: - T::Array[ModerationAPI::WebhookUpdateParams::EventType::OrSymbol], - name: String, - url: String, - request_options: ModerationAPI::RequestOptions - } - ) - end - def to_hash - end - - module EventType - extend ModerationAPI::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all(Symbol, ModerationAPI::WebhookUpdateParams::EventType) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - QUEUE_ITEM_NEW = - T.let( - :QUEUE_ITEM_NEW, - ModerationAPI::WebhookUpdateParams::EventType::TaggedSymbol - ) - QUEUE_ITEM_COMPLETED = - T.let( - :QUEUE_ITEM_COMPLETED, - ModerationAPI::WebhookUpdateParams::EventType::TaggedSymbol - ) - QUEUE_ITEM_ACTION = - T.let( - :QUEUE_ITEM_ACTION, - ModerationAPI::WebhookUpdateParams::EventType::TaggedSymbol - ) - QUEUE_ITEM_REJECTED = - T.let( - :QUEUE_ITEM_REJECTED, - ModerationAPI::WebhookUpdateParams::EventType::TaggedSymbol - ) - QUEUE_ITEM_ALLOWED = - T.let( - :QUEUE_ITEM_ALLOWED, - ModerationAPI::WebhookUpdateParams::EventType::TaggedSymbol - ) - AUTHOR_BLOCKED = - T.let( - :AUTHOR_BLOCKED, - ModerationAPI::WebhookUpdateParams::EventType::TaggedSymbol - ) - AUTHOR_UNBLOCKED = - T.let( - :AUTHOR_UNBLOCKED, - ModerationAPI::WebhookUpdateParams::EventType::TaggedSymbol - ) - AUTHOR_SUSPENDED = - T.let( - :AUTHOR_SUSPENDED, - ModerationAPI::WebhookUpdateParams::EventType::TaggedSymbol - ) - AUTHOR_UPDATED = - T.let( - :AUTHOR_UPDATED, - ModerationAPI::WebhookUpdateParams::EventType::TaggedSymbol - ) - AUTHOR_TRUST_LEVEL_CHANGED = - T.let( - :AUTHOR_TRUST_LEVEL_CHANGED, - ModerationAPI::WebhookUpdateParams::EventType::TaggedSymbol - ) - AUTHOR_ACTION = - T.let( - :AUTHOR_ACTION, - ModerationAPI::WebhookUpdateParams::EventType::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - ModerationAPI::WebhookUpdateParams::EventType::TaggedSymbol - ] - ) - end - def self.values - end - end - end - end -end diff --git a/rbi/moderation_api/models/webhook_update_response.rbi b/rbi/moderation_api/models/webhook_update_response.rbi deleted file mode 100644 index c0400420..00000000 --- a/rbi/moderation_api/models/webhook_update_response.rbi +++ /dev/null @@ -1,225 +0,0 @@ -# typed: strong - -module ModerationAPI - module Models - class WebhookUpdateResponse < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::Models::WebhookUpdateResponse, - ModerationAPI::Internal::AnyHash - ) - end - - # The ID of the webhook. - sig { returns(String) } - attr_accessor :id - - # The date the webhook was created. - sig { returns(String) } - attr_accessor :created_at - - # Event types this webhook subscribes to. Empty for legacy v1 webhooks, which - # subscribe via their single deprecated `type` instead. - sig do - returns( - T::Array[ - ModerationAPI::Models::WebhookUpdateResponse::EventType::TaggedSymbol - ] - ) - end - attr_accessor :event_types - - # The webhook's name. - sig { returns(String) } - attr_accessor :name - - # Payload envelope version. V2 is the Stripe-style envelope; V1 is the legacy flat - # shape and is read-only via this API. - sig do - returns( - ModerationAPI::Models::WebhookUpdateResponse::PayloadVersion::TaggedSymbol - ) - end - attr_accessor :payload_version - - # The URL we call when a subscribed event occurs. - sig { returns(String) } - attr_accessor :url - - # The webhook's description. - sig { returns(T.nilable(String)) } - attr_accessor :description - - sig do - params( - id: String, - created_at: String, - event_types: - T::Array[ - ModerationAPI::Models::WebhookUpdateResponse::EventType::OrSymbol - ], - name: String, - payload_version: - ModerationAPI::Models::WebhookUpdateResponse::PayloadVersion::OrSymbol, - url: String, - description: T.nilable(String) - ).returns(T.attached_class) - end - def self.new( - # The ID of the webhook. - id:, - # The date the webhook was created. - created_at:, - # Event types this webhook subscribes to. Empty for legacy v1 webhooks, which - # subscribe via their single deprecated `type` instead. - event_types:, - # The webhook's name. - name:, - # Payload envelope version. V2 is the Stripe-style envelope; V1 is the legacy flat - # shape and is read-only via this API. - payload_version:, - # The URL we call when a subscribed event occurs. - url:, - # The webhook's description. - description: nil - ) - end - - sig do - override.returns( - { - id: String, - created_at: String, - event_types: - T::Array[ - ModerationAPI::Models::WebhookUpdateResponse::EventType::TaggedSymbol - ], - name: String, - payload_version: - ModerationAPI::Models::WebhookUpdateResponse::PayloadVersion::TaggedSymbol, - url: String, - description: T.nilable(String) - } - ) - end - def to_hash - end - - module EventType - extend ModerationAPI::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all( - Symbol, - ModerationAPI::Models::WebhookUpdateResponse::EventType - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - QUEUE_ITEM_NEW = - T.let( - :QUEUE_ITEM_NEW, - ModerationAPI::Models::WebhookUpdateResponse::EventType::TaggedSymbol - ) - QUEUE_ITEM_COMPLETED = - T.let( - :QUEUE_ITEM_COMPLETED, - ModerationAPI::Models::WebhookUpdateResponse::EventType::TaggedSymbol - ) - QUEUE_ITEM_ACTION = - T.let( - :QUEUE_ITEM_ACTION, - ModerationAPI::Models::WebhookUpdateResponse::EventType::TaggedSymbol - ) - QUEUE_ITEM_REJECTED = - T.let( - :QUEUE_ITEM_REJECTED, - ModerationAPI::Models::WebhookUpdateResponse::EventType::TaggedSymbol - ) - QUEUE_ITEM_ALLOWED = - T.let( - :QUEUE_ITEM_ALLOWED, - ModerationAPI::Models::WebhookUpdateResponse::EventType::TaggedSymbol - ) - AUTHOR_BLOCKED = - T.let( - :AUTHOR_BLOCKED, - ModerationAPI::Models::WebhookUpdateResponse::EventType::TaggedSymbol - ) - AUTHOR_UNBLOCKED = - T.let( - :AUTHOR_UNBLOCKED, - ModerationAPI::Models::WebhookUpdateResponse::EventType::TaggedSymbol - ) - AUTHOR_SUSPENDED = - T.let( - :AUTHOR_SUSPENDED, - ModerationAPI::Models::WebhookUpdateResponse::EventType::TaggedSymbol - ) - AUTHOR_UPDATED = - T.let( - :AUTHOR_UPDATED, - ModerationAPI::Models::WebhookUpdateResponse::EventType::TaggedSymbol - ) - AUTHOR_TRUST_LEVEL_CHANGED = - T.let( - :AUTHOR_TRUST_LEVEL_CHANGED, - ModerationAPI::Models::WebhookUpdateResponse::EventType::TaggedSymbol - ) - AUTHOR_ACTION = - T.let( - :AUTHOR_ACTION, - ModerationAPI::Models::WebhookUpdateResponse::EventType::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - ModerationAPI::Models::WebhookUpdateResponse::EventType::TaggedSymbol - ] - ) - end - def self.values - end - end - - # Payload envelope version. V2 is the Stripe-style envelope; V1 is the legacy flat - # shape and is read-only via this API. - module PayloadVersion - extend ModerationAPI::Internal::Type::Enum - - TaggedSymbol = - T.type_alias do - T.all( - Symbol, - ModerationAPI::Models::WebhookUpdateResponse::PayloadVersion - ) - end - OrSymbol = T.type_alias { T.any(Symbol, String) } - - V1 = - T.let( - :V1, - ModerationAPI::Models::WebhookUpdateResponse::PayloadVersion::TaggedSymbol - ) - V2 = - T.let( - :V2, - ModerationAPI::Models::WebhookUpdateResponse::PayloadVersion::TaggedSymbol - ) - - sig do - override.returns( - T::Array[ - ModerationAPI::Models::WebhookUpdateResponse::PayloadVersion::TaggedSymbol - ] - ) - end - def self.values - end - end - end - end -end diff --git a/rbi/moderation_api/models/wordlist/word_add_params.rbi b/rbi/moderation_api/models/wordlist/word_add_params.rbi deleted file mode 100644 index 1589e841..00000000 --- a/rbi/moderation_api/models/wordlist/word_add_params.rbi +++ /dev/null @@ -1,56 +0,0 @@ -# typed: strong - -module ModerationAPI - module Models - module Wordlist - class WordAddParams < ModerationAPI::Internal::Type::BaseModel - extend ModerationAPI::Internal::Type::RequestParameters::Converter - include ModerationAPI::Internal::Type::RequestParameters - - OrHash = - T.type_alias do - T.any( - ModerationAPI::Wordlist::WordAddParams, - ModerationAPI::Internal::AnyHash - ) - end - - # ID of the wordlist to add words to - sig { returns(String) } - attr_accessor :id - - # Array of words to add to the wordlist. Duplicate words will be ignored. - sig { returns(T::Array[String]) } - attr_accessor :words - - sig do - params( - id: String, - words: T::Array[String], - request_options: ModerationAPI::RequestOptions::OrHash - ).returns(T.attached_class) - end - def self.new( - # ID of the wordlist to add words to - id:, - # Array of words to add to the wordlist. Duplicate words will be ignored. - words:, - request_options: {} - ) - end - - sig do - override.returns( - { - id: String, - words: T::Array[String], - request_options: ModerationAPI::RequestOptions - } - ) - end - def to_hash - end - end - end - end -end diff --git a/rbi/moderation_api/models/wordlist/word_add_response.rbi b/rbi/moderation_api/models/wordlist/word_add_response.rbi deleted file mode 100644 index d24c4ac2..00000000 --- a/rbi/moderation_api/models/wordlist/word_add_response.rbi +++ /dev/null @@ -1,58 +0,0 @@ -# typed: strong - -module ModerationAPI - module Models - module Wordlist - class WordAddResponse < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::Models::Wordlist::WordAddResponse, - ModerationAPI::Internal::AnyHash - ) - end - - # Number of words added - sig { returns(Float) } - attr_accessor :added_count - - # List of words that were added - sig { returns(T::Array[String]) } - attr_accessor :added_words - - # Total number of words in wordlist - sig { returns(Float) } - attr_accessor :total_count - - sig do - params( - added_count: Float, - added_words: T::Array[String], - total_count: Float - ).returns(T.attached_class) - end - def self.new( - # Number of words added - added_count:, - # List of words that were added - added_words:, - # Total number of words in wordlist - total_count: - ) - end - - sig do - override.returns( - { - added_count: Float, - added_words: T::Array[String], - total_count: Float - } - ) - end - def to_hash - end - end - end - end -end diff --git a/rbi/moderation_api/models/wordlist/word_remove_params.rbi b/rbi/moderation_api/models/wordlist/word_remove_params.rbi deleted file mode 100644 index 056b3819..00000000 --- a/rbi/moderation_api/models/wordlist/word_remove_params.rbi +++ /dev/null @@ -1,56 +0,0 @@ -# typed: strong - -module ModerationAPI - module Models - module Wordlist - class WordRemoveParams < ModerationAPI::Internal::Type::BaseModel - extend ModerationAPI::Internal::Type::RequestParameters::Converter - include ModerationAPI::Internal::Type::RequestParameters - - OrHash = - T.type_alias do - T.any( - ModerationAPI::Wordlist::WordRemoveParams, - ModerationAPI::Internal::AnyHash - ) - end - - # ID of the wordlist to remove words from - sig { returns(String) } - attr_accessor :id - - # Array of words to remove from the wordlist - sig { returns(T::Array[String]) } - attr_accessor :words - - sig do - params( - id: String, - words: T::Array[String], - request_options: ModerationAPI::RequestOptions::OrHash - ).returns(T.attached_class) - end - def self.new( - # ID of the wordlist to remove words from - id:, - # Array of words to remove from the wordlist - words:, - request_options: {} - ) - end - - sig do - override.returns( - { - id: String, - words: T::Array[String], - request_options: ModerationAPI::RequestOptions - } - ) - end - def to_hash - end - end - end - end -end diff --git a/rbi/moderation_api/models/wordlist/word_remove_response.rbi b/rbi/moderation_api/models/wordlist/word_remove_response.rbi deleted file mode 100644 index 7bbe92d1..00000000 --- a/rbi/moderation_api/models/wordlist/word_remove_response.rbi +++ /dev/null @@ -1,58 +0,0 @@ -# typed: strong - -module ModerationAPI - module Models - module Wordlist - class WordRemoveResponse < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::Models::Wordlist::WordRemoveResponse, - ModerationAPI::Internal::AnyHash - ) - end - - # Number of words removed - sig { returns(Float) } - attr_accessor :removed_count - - # List of words removed - sig { returns(T::Array[String]) } - attr_accessor :removed_words - - # Total number of words in wordlist - sig { returns(Float) } - attr_accessor :total_count - - sig do - params( - removed_count: Float, - removed_words: T::Array[String], - total_count: Float - ).returns(T.attached_class) - end - def self.new( - # Number of words removed - removed_count:, - # List of words removed - removed_words:, - # Total number of words in wordlist - total_count: - ) - end - - sig do - override.returns( - { - removed_count: Float, - removed_words: T::Array[String], - total_count: Float - } - ) - end - def to_hash - end - end - end - end -end diff --git a/rbi/moderation_api/models/wordlist_get_embedding_status_params.rbi b/rbi/moderation_api/models/wordlist_get_embedding_status_params.rbi deleted file mode 100644 index d9cb27b3..00000000 --- a/rbi/moderation_api/models/wordlist_get_embedding_status_params.rbi +++ /dev/null @@ -1,43 +0,0 @@ -# typed: strong - -module ModerationAPI - module Models - class WordlistGetEmbeddingStatusParams < ModerationAPI::Internal::Type::BaseModel - extend ModerationAPI::Internal::Type::RequestParameters::Converter - include ModerationAPI::Internal::Type::RequestParameters - - OrHash = - T.type_alias do - T.any( - ModerationAPI::WordlistGetEmbeddingStatusParams, - ModerationAPI::Internal::AnyHash - ) - end - - # ID of the wordlist to check embedding status for - sig { returns(String) } - attr_accessor :id - - sig do - params( - id: String, - request_options: ModerationAPI::RequestOptions::OrHash - ).returns(T.attached_class) - end - def self.new( - # ID of the wordlist to check embedding status for - id:, - request_options: {} - ) - end - - sig do - override.returns( - { id: String, request_options: ModerationAPI::RequestOptions } - ) - end - def to_hash - end - end - end -end diff --git a/rbi/moderation_api/models/wordlist_get_embedding_status_response.rbi b/rbi/moderation_api/models/wordlist_get_embedding_status_response.rbi deleted file mode 100644 index 1bcedaf1..00000000 --- a/rbi/moderation_api/models/wordlist_get_embedding_status_response.rbi +++ /dev/null @@ -1,53 +0,0 @@ -# typed: strong - -module ModerationAPI - module Models - class WordlistGetEmbeddingStatusResponse < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::Models::WordlistGetEmbeddingStatusResponse, - ModerationAPI::Internal::AnyHash - ) - end - - # Percentage of words that have been embedded (0-100) - sig { returns(Float) } - attr_accessor :progress - - # Number of words still waiting to be embedded - sig { returns(Float) } - attr_accessor :remaining_words - - # Total number of words in the wordlist - sig { returns(Float) } - attr_accessor :total_words - - # Embedding status details - sig do - params( - progress: Float, - remaining_words: Float, - total_words: Float - ).returns(T.attached_class) - end - def self.new( - # Percentage of words that have been embedded (0-100) - progress:, - # Number of words still waiting to be embedded - remaining_words:, - # Total number of words in the wordlist - total_words: - ) - end - - sig do - override.returns( - { progress: Float, remaining_words: Float, total_words: Float } - ) - end - def to_hash - end - end - end -end diff --git a/rbi/moderation_api/models/wordlist_list_params.rbi b/rbi/moderation_api/models/wordlist_list_params.rbi deleted file mode 100644 index e417ccd7..00000000 --- a/rbi/moderation_api/models/wordlist_list_params.rbi +++ /dev/null @@ -1,32 +0,0 @@ -# typed: strong - -module ModerationAPI - module Models - class WordlistListParams < ModerationAPI::Internal::Type::BaseModel - extend ModerationAPI::Internal::Type::RequestParameters::Converter - include ModerationAPI::Internal::Type::RequestParameters - - OrHash = - T.type_alias do - T.any( - ModerationAPI::WordlistListParams, - ModerationAPI::Internal::AnyHash - ) - end - - sig do - params(request_options: ModerationAPI::RequestOptions::OrHash).returns( - T.attached_class - ) - end - def self.new(request_options: {}) - end - - sig do - override.returns({ request_options: ModerationAPI::RequestOptions }) - end - def to_hash - end - end - end -end diff --git a/rbi/moderation_api/models/wordlist_list_response.rbi b/rbi/moderation_api/models/wordlist_list_response.rbi deleted file mode 100644 index d172d983..00000000 --- a/rbi/moderation_api/models/wordlist_list_response.rbi +++ /dev/null @@ -1,80 +0,0 @@ -# typed: strong - -module ModerationAPI - module Models - class WordlistListResponseItem < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::Models::WordlistListResponseItem, - ModerationAPI::Internal::AnyHash - ) - end - - # Unique identifier of the wordlist - sig { returns(String) } - attr_accessor :id - - # When the wordlist was created - sig { returns(T.nilable(String)) } - attr_accessor :created_at - - # Description of the wordlist - sig { returns(T.nilable(String)) } - attr_accessor :description - - # Name of the wordlist - sig { returns(T.nilable(String)) } - attr_accessor :name - - # User who created the wordlist - sig { returns(T.nilable(String)) } - attr_accessor :user_id - - sig do - params( - id: String, - created_at: T.nilable(String), - description: T.nilable(String), - name: T.nilable(String), - user_id: T.nilable(String) - ).returns(T.attached_class) - end - def self.new( - # Unique identifier of the wordlist - id:, - # When the wordlist was created - created_at:, - # Description of the wordlist - description:, - # Name of the wordlist - name:, - # User who created the wordlist - user_id: - ) - end - - sig do - override.returns( - { - id: String, - created_at: T.nilable(String), - description: T.nilable(String), - name: T.nilable(String), - user_id: T.nilable(String) - } - ) - end - def to_hash - end - end - - WordlistListResponse = - T.let( - ModerationAPI::Internal::Type::ArrayOf[ - ModerationAPI::Models::WordlistListResponseItem - ], - ModerationAPI::Internal::Type::Converter - ) - end -end diff --git a/rbi/moderation_api/models/wordlist_retrieve_params.rbi b/rbi/moderation_api/models/wordlist_retrieve_params.rbi deleted file mode 100644 index 415ef81f..00000000 --- a/rbi/moderation_api/models/wordlist_retrieve_params.rbi +++ /dev/null @@ -1,43 +0,0 @@ -# typed: strong - -module ModerationAPI - module Models - class WordlistRetrieveParams < ModerationAPI::Internal::Type::BaseModel - extend ModerationAPI::Internal::Type::RequestParameters::Converter - include ModerationAPI::Internal::Type::RequestParameters - - OrHash = - T.type_alias do - T.any( - ModerationAPI::WordlistRetrieveParams, - ModerationAPI::Internal::AnyHash - ) - end - - # ID of the wordlist to get - sig { returns(String) } - attr_accessor :id - - sig do - params( - id: String, - request_options: ModerationAPI::RequestOptions::OrHash - ).returns(T.attached_class) - end - def self.new( - # ID of the wordlist to get - id:, - request_options: {} - ) - end - - sig do - override.returns( - { id: String, request_options: ModerationAPI::RequestOptions } - ) - end - def to_hash - end - end - end -end diff --git a/rbi/moderation_api/models/wordlist_retrieve_response.rbi b/rbi/moderation_api/models/wordlist_retrieve_response.rbi deleted file mode 100644 index b229e39b..00000000 --- a/rbi/moderation_api/models/wordlist_retrieve_response.rbi +++ /dev/null @@ -1,88 +0,0 @@ -# typed: strong - -module ModerationAPI - module Models - class WordlistRetrieveResponse < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::Models::WordlistRetrieveResponse, - ModerationAPI::Internal::AnyHash - ) - end - - # ID of the wordlist - sig { returns(String) } - attr_accessor :id - - # Creation date of the wordlist - sig { returns(String) } - attr_accessor :created_at - - # Name of the wordlist - sig { returns(T.nilable(String)) } - attr_accessor :name - - # ID of the organization - sig { returns(String) } - attr_accessor :organization_id - - # Strict mode - sig { returns(T::Boolean) } - attr_accessor :strict - - # ID of the user - sig { returns(T.nilable(String)) } - attr_accessor :user_id - - # Words in the wordlist - sig { returns(T::Array[String]) } - attr_accessor :words - - sig do - params( - id: String, - created_at: String, - name: T.nilable(String), - organization_id: String, - strict: T::Boolean, - user_id: T.nilable(String), - words: T::Array[String] - ).returns(T.attached_class) - end - def self.new( - # ID of the wordlist - id:, - # Creation date of the wordlist - created_at:, - # Name of the wordlist - name:, - # ID of the organization - organization_id:, - # Strict mode - strict:, - # ID of the user - user_id:, - # Words in the wordlist - words: - ) - end - - sig do - override.returns( - { - id: String, - created_at: String, - name: T.nilable(String), - organization_id: String, - strict: T::Boolean, - user_id: T.nilable(String), - words: T::Array[String] - } - ) - end - def to_hash - end - end - end -end diff --git a/rbi/moderation_api/models/wordlist_update_params.rbi b/rbi/moderation_api/models/wordlist_update_params.rbi deleted file mode 100644 index 5dcb283d..00000000 --- a/rbi/moderation_api/models/wordlist_update_params.rbi +++ /dev/null @@ -1,103 +0,0 @@ -# typed: strong - -module ModerationAPI - module Models - class WordlistUpdateParams < ModerationAPI::Internal::Type::BaseModel - extend ModerationAPI::Internal::Type::RequestParameters::Converter - include ModerationAPI::Internal::Type::RequestParameters - - OrHash = - T.type_alias do - T.any( - ModerationAPI::WordlistUpdateParams, - ModerationAPI::Internal::AnyHash - ) - end - - # ID of the wordlist to update - sig { returns(String) } - attr_accessor :id - - # New description for the wordlist - sig { returns(T.nilable(String)) } - attr_reader :description - - sig { params(description: String).void } - attr_writer :description - - # New key for the wordlist - sig { returns(T.nilable(String)) } - attr_reader :key - - sig { params(key: String).void } - attr_writer :key - - # New name for the wordlist - sig { returns(T.nilable(String)) } - attr_reader :name - - sig { params(name: String).void } - attr_writer :name - - # Deprecated. Now using threshold in project settings. - sig { returns(T.nilable(T::Boolean)) } - attr_reader :strict - - sig { params(strict: T::Boolean).void } - attr_writer :strict - - # New words for the wordlist. Replace the existing words with these new ones. - # Duplicate words will be ignored. - sig { returns(T.nilable(T::Array[String])) } - attr_reader :words - - sig { params(words: T::Array[String]).void } - attr_writer :words - - sig do - params( - id: String, - description: String, - key: String, - name: String, - strict: T::Boolean, - words: T::Array[String], - request_options: ModerationAPI::RequestOptions::OrHash - ).returns(T.attached_class) - end - def self.new( - # ID of the wordlist to update - id:, - # New description for the wordlist - description: nil, - # New key for the wordlist - key: nil, - # New name for the wordlist - name: nil, - # Deprecated. Now using threshold in project settings. - strict: nil, - # New words for the wordlist. Replace the existing words with these new ones. - # Duplicate words will be ignored. - words: nil, - request_options: {} - ) - end - - sig do - override.returns( - { - id: String, - description: String, - key: String, - name: String, - strict: T::Boolean, - words: T::Array[String], - request_options: ModerationAPI::RequestOptions - } - ) - end - def to_hash - end - end - end -end diff --git a/rbi/moderation_api/models/wordlist_update_response.rbi b/rbi/moderation_api/models/wordlist_update_response.rbi deleted file mode 100644 index 0bffc971..00000000 --- a/rbi/moderation_api/models/wordlist_update_response.rbi +++ /dev/null @@ -1,88 +0,0 @@ -# typed: strong - -module ModerationAPI - module Models - class WordlistUpdateResponse < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any( - ModerationAPI::Models::WordlistUpdateResponse, - ModerationAPI::Internal::AnyHash - ) - end - - # ID of the wordlist - sig { returns(String) } - attr_accessor :id - - # Creation date of the wordlist - sig { returns(String) } - attr_accessor :created_at - - # Name of the wordlist - sig { returns(T.nilable(String)) } - attr_accessor :name - - # ID of the organization - sig { returns(String) } - attr_accessor :organization_id - - # Strict mode - sig { returns(T::Boolean) } - attr_accessor :strict - - # ID of the user - sig { returns(T.nilable(String)) } - attr_accessor :user_id - - # Words in the wordlist - sig { returns(T::Array[String]) } - attr_accessor :words - - sig do - params( - id: String, - created_at: String, - name: T.nilable(String), - organization_id: String, - strict: T::Boolean, - user_id: T.nilable(String), - words: T::Array[String] - ).returns(T.attached_class) - end - def self.new( - # ID of the wordlist - id:, - # Creation date of the wordlist - created_at:, - # Name of the wordlist - name:, - # ID of the organization - organization_id:, - # Strict mode - strict:, - # ID of the user - user_id:, - # Words in the wordlist - words: - ) - end - - sig do - override.returns( - { - id: String, - created_at: String, - name: T.nilable(String), - organization_id: String, - strict: T::Boolean, - user_id: T.nilable(String), - words: T::Array[String] - } - ) - end - def to_hash - end - end - end -end diff --git a/rbi/moderation_api/request_options.rbi b/rbi/moderation_api/request_options.rbi deleted file mode 100644 index 0c1a3beb..00000000 --- a/rbi/moderation_api/request_options.rbi +++ /dev/null @@ -1,59 +0,0 @@ -# typed: strong - -module ModerationAPI - # Specify HTTP behaviour to use for a specific request. These options supplement - # or override those provided at the client level. - # - # When making a request, you can pass an actual {RequestOptions} instance, or - # simply pass a Hash with symbol keys matching the attributes on this class. - class RequestOptions < ModerationAPI::Internal::Type::BaseModel - OrHash = - T.type_alias do - T.any(ModerationAPI::RequestOptions, ModerationAPI::Internal::AnyHash) - end - - # @api private - sig { params(opts: ModerationAPI::RequestOptions::OrHash).void } - def self.validate!(opts) - end - - # Idempotency key to send with request and all associated retries. Will only be - # sent for write requests. - sig { returns(T.nilable(String)) } - attr_accessor :idempotency_key - - # Extra query params to send with the request. These are `.merge`’d into any - # `query` given at the client level. - sig do - returns( - T.nilable(T::Hash[String, T.nilable(T.any(T::Array[String], String))]) - ) - end - attr_accessor :extra_query - - # Extra headers to send with the request. These are `.merged`’d into any - # `extra_headers` given at the client level. - sig { returns(T.nilable(T::Hash[String, T.nilable(String)])) } - attr_accessor :extra_headers - - # Extra data to send with the request. These are deep merged into any data - # generated as part of the normal request. - sig { returns(T.nilable(T.anything)) } - attr_accessor :extra_body - - # Maximum number of retries to attempt after a failed initial request. - sig { returns(T.nilable(Integer)) } - attr_accessor :max_retries - - # Request timeout in seconds. - sig { returns(T.nilable(Float)) } - attr_accessor :timeout - - # Returns a new instance of RequestOptions. - sig do - params(values: ModerationAPI::Internal::AnyHash).returns(T.attached_class) - end - def self.new(values = {}) - end - end -end diff --git a/rbi/moderation_api/resources/account.rbi b/rbi/moderation_api/resources/account.rbi deleted file mode 100644 index 64778d8a..00000000 --- a/rbi/moderation_api/resources/account.rbi +++ /dev/null @@ -1,21 +0,0 @@ -# typed: strong - -module ModerationAPI - module Resources - class Account - # Get account details - sig do - params(request_options: ModerationAPI::RequestOptions::OrHash).returns( - ModerationAPI::Models::AccountListResponse - ) - end - def list(request_options: {}) - end - - # @api private - sig { params(client: ModerationAPI::Client).returns(T.attached_class) } - def self.new(client:) - end - end - end -end diff --git a/rbi/moderation_api/resources/actions.rbi b/rbi/moderation_api/resources/actions.rbi deleted file mode 100644 index 4cd110e2..00000000 --- a/rbi/moderation_api/resources/actions.rbi +++ /dev/null @@ -1,156 +0,0 @@ -# typed: strong - -module ModerationAPI - module Resources - class Actions - sig { returns(ModerationAPI::Resources::Actions::Execute) } - attr_reader :execute - - # Create an action. - sig do - params( - name: String, - built_in: T.nilable(T::Boolean), - description: T.nilable(String), - filter_in_queue_ids: T::Array[String], - free_text: T::Boolean, - key: T.nilable(String), - position: ModerationAPI::ActionCreateParams::Position::OrSymbol, - possible_values: - T::Array[ModerationAPI::ActionCreateParams::PossibleValue::OrHash], - queue_behaviour: - ModerationAPI::ActionCreateParams::QueueBehaviour::OrSymbol, - type: T.nilable(ModerationAPI::ActionCreateParams::Type::OrSymbol), - value_required: T::Boolean, - request_options: ModerationAPI::RequestOptions::OrHash - ).returns(ModerationAPI::Models::ActionCreateResponse) - end - def create( - # The name of the action. - name:, - # Whether the action is a built-in action or a custom one. - built_in: nil, - # The description of the action. - description: nil, - # The IDs of the queues the action is available in. - filter_in_queue_ids: nil, - # Whether the action allows any text to be entered as a value or if it must be one - # of the possible values. - free_text: nil, - # User defined key of the action. - key: nil, - # Show the action in all queues, selected queues or no queues (to use via API - # only). - position: nil, - # The possible values of the action. The user will be prompted to select one of - # these values when executing the action. - possible_values: nil, - # Whether the action resolves and removes the item, unresolves and re-add it to - # the queue, or does not change the resolve status. - queue_behaviour: nil, - # The type of the action. - type: nil, - # Whether the action requires a value to be executed. - value_required: nil, - request_options: {} - ) - end - - # Get an action by ID. - sig do - params( - id: String, - request_options: ModerationAPI::RequestOptions::OrHash - ).returns(ModerationAPI::Models::ActionRetrieveResponse) - end - def retrieve( - # The ID of the action to get. - id, - request_options: {} - ) - end - - # Update an action. - sig do - params( - id: String, - built_in: T.nilable(T::Boolean), - description: T.nilable(String), - filter_in_queue_ids: T::Array[String], - free_text: T::Boolean, - key: T.nilable(String), - name: String, - position: ModerationAPI::ActionUpdateParams::Position::OrSymbol, - possible_values: - T::Array[ModerationAPI::ActionUpdateParams::PossibleValue::OrHash], - queue_behaviour: - ModerationAPI::ActionUpdateParams::QueueBehaviour::OrSymbol, - type: T.nilable(ModerationAPI::ActionUpdateParams::Type::OrSymbol), - value_required: T::Boolean, - request_options: ModerationAPI::RequestOptions::OrHash - ).returns(ModerationAPI::Models::ActionUpdateResponse) - end - def update( - # The ID of the action to update. - id, - # Whether the action is a built-in action or a custom one. - built_in: nil, - # The description of the action. - description: nil, - # The IDs of the queues the action is available in. - filter_in_queue_ids: nil, - # Whether the action allows any text to be entered as a value or if it must be one - # of the possible values. - free_text: nil, - # User defined key of the action. - key: nil, - # The name of the action. - name: nil, - # Show the action in all queues, selected queues or no queues (to use via API - # only). - position: nil, - # The possible values of the action. The user will be prompted to select one of - # these values when executing the action. - possible_values: nil, - # Whether the action resolves and removes the item, unresolves and re-add it to - # the queue, or does not change the resolve status. - queue_behaviour: nil, - # The type of the action. - type: nil, - # Whether the action requires a value to be executed. - value_required: nil, - request_options: {} - ) - end - - # List all available moderation actions for the authenticated organization. - sig do - params( - queue_id: String, - request_options: ModerationAPI::RequestOptions::OrHash - ).returns(T::Array[ModerationAPI::Models::ActionListResponseItem]) - end - def list(queue_id: nil, request_options: {}) - end - - # Delete an action and all of its webhooks. - sig do - params( - id: String, - request_options: ModerationAPI::RequestOptions::OrHash - ).returns(ModerationAPI::Models::ActionDeleteResponse) - end - def delete( - # The ID of the action to delete. - id, - request_options: {} - ) - end - - # @api private - sig { params(client: ModerationAPI::Client).returns(T.attached_class) } - def self.new(client:) - end - end - end -end diff --git a/rbi/moderation_api/resources/actions/execute.rbi b/rbi/moderation_api/resources/actions/execute.rbi deleted file mode 100644 index 669c3915..00000000 --- a/rbi/moderation_api/resources/actions/execute.rbi +++ /dev/null @@ -1,69 +0,0 @@ -# typed: strong - -module ModerationAPI - module Resources - class Actions - class Execute - # Execute a moderation action on one or more content items. - sig do - params( - action_key: String, - author_ids: T::Array[String], - content_ids: T::Array[String], - duration: Float, - queue_id: String, - value: String, - request_options: ModerationAPI::RequestOptions::OrHash - ).returns(ModerationAPI::Models::Actions::ExecuteExecuteResponse) - end - def execute( - # ID or key of the action to execute - action_key:, - # IDs of the authors to apply the action to. Provide this or contentIds. - author_ids: nil, - # IDs of the content items to apply the action to. Provide this or authorIds. - content_ids: nil, - # Optional duration in milliseconds for actions with timeouts - duration: nil, - # Optional queue ID if the action is queue-specific - queue_id: nil, - # Optional value to provide with the action - value: nil, - request_options: {} - ) - end - - # Execute an action on a set of content items in a queue. - sig do - params( - action_id: String, - author_ids: T::Array[String], - content_ids: T::Array[String], - queue_id: String, - value: String, - request_options: ModerationAPI::RequestOptions::OrHash - ).returns(ModerationAPI::Models::Actions::ExecuteExecuteByIDResponse) - end - def execute_by_id( - # The ID or key of the action to execute. - action_id, - # IDs of the authors to apply the action to - author_ids: nil, - # The IDs of the content items to perform the action on. - content_ids: nil, - # The ID of the queue the action was performed from if any. - queue_id: nil, - # The value of the action. Useful to set a reason for the action etc. - value: nil, - request_options: {} - ) - end - - # @api private - sig { params(client: ModerationAPI::Client).returns(T.attached_class) } - def self.new(client:) - end - end - end - end -end diff --git a/rbi/moderation_api/resources/auth.rbi b/rbi/moderation_api/resources/auth.rbi deleted file mode 100644 index 954c68c0..00000000 --- a/rbi/moderation_api/resources/auth.rbi +++ /dev/null @@ -1,28 +0,0 @@ -# typed: strong - -module ModerationAPI - module Resources - class Auth - sig do - params(request_options: ModerationAPI::RequestOptions::OrHash).returns( - ModerationAPI::Models::AuthCreateResponse - ) - end - def create(request_options: {}) - end - - sig do - params(request_options: ModerationAPI::RequestOptions::OrHash).returns( - ModerationAPI::Models::AuthRetrieveResponse - ) - end - def retrieve(request_options: {}) - end - - # @api private - sig { params(client: ModerationAPI::Client).returns(T.attached_class) } - def self.new(client:) - end - end - end -end diff --git a/rbi/moderation_api/resources/authors.rbi b/rbi/moderation_api/resources/authors.rbi deleted file mode 100644 index e8eca332..00000000 --- a/rbi/moderation_api/resources/authors.rbi +++ /dev/null @@ -1,155 +0,0 @@ -# typed: strong - -module ModerationAPI - module Resources - class Authors - # Create a new author. Typically not needed as authors are created automatically - # when content is moderated. - sig do - params( - external_id: String, - company: T.nilable(String), - email: T.nilable(String), - external_link: T.nilable(String), - first_seen: Float, - last_seen: Float, - manual_trust_level: T.nilable(Float), - metadata: ModerationAPI::AuthorCreateParams::Metadata::OrHash, - name: T.nilable(String), - profile_picture: T.nilable(String), - request_options: ModerationAPI::RequestOptions::OrHash - ).returns(ModerationAPI::Models::AuthorCreateResponse) - end - def create( - # External ID of the user, typically the ID of the author in your database. - external_id:, - # The author's company or organization - company: nil, - # Author email address - email: nil, - # URL of the author's external profile - external_link: nil, - # Timestamp when author first appeared - first_seen: nil, - # Timestamp of last activity - last_seen: nil, - manual_trust_level: nil, - # Additional metadata provided by your system. We recommend including any relevant - # information that may assist in the moderation process. - metadata: nil, - # Author name or identifier - name: nil, - # URL of the author's profile picture - profile_picture: nil, - request_options: {} - ) - end - - # Get detailed information about a specific author including historical data and - # analysis - sig do - params( - id: String, - request_options: ModerationAPI::RequestOptions::OrHash - ).returns(ModerationAPI::Models::AuthorRetrieveResponse) - end - def retrieve( - # Either external ID or the ID assigned by moderation API. - id, - request_options: {} - ) - end - - # Update the details of a specific author - sig do - params( - id: String, - company: T.nilable(String), - email: T.nilable(String), - external_link: T.nilable(String), - first_seen: Float, - last_seen: Float, - manual_trust_level: T.nilable(Float), - metadata: ModerationAPI::AuthorUpdateParams::Metadata::OrHash, - name: T.nilable(String), - profile_picture: T.nilable(String), - request_options: ModerationAPI::RequestOptions::OrHash - ).returns(ModerationAPI::Models::AuthorUpdateResponse) - end - def update( - # Either external ID or the ID assigned by moderation API. - id, - # The author's company or organization - company: nil, - # Author email address - email: nil, - # URL of the author's external profile - external_link: nil, - # Timestamp when author first appeared - first_seen: nil, - # Timestamp of last activity - last_seen: nil, - manual_trust_level: nil, - # Additional metadata provided by your system. We recommend including any relevant - # information that may assist in the moderation process. - metadata: nil, - # Author name or identifier - name: nil, - # URL of the author's profile picture - profile_picture: nil, - request_options: {} - ) - end - - # Get a paginated list of authors with their activity metrics and reputation - sig do - params( - content_types: String, - last_active_date: String, - member_since_date: String, - page_number: Float, - page_size: Float, - sort_by: ModerationAPI::AuthorListParams::SortBy::OrSymbol, - sort_direction: - ModerationAPI::AuthorListParams::SortDirection::OrSymbol, - request_options: ModerationAPI::RequestOptions::OrHash - ).returns(ModerationAPI::Models::AuthorListResponse) - end - def list( - content_types: nil, - last_active_date: nil, - member_since_date: nil, - # Page number to fetch - page_number: nil, - # Number of authors per page - page_size: nil, - sort_by: nil, - # Sort direction - sort_direction: nil, - request_options: {} - ) - end - - # Delete a specific author. This resets the author: status, blocks, trust level, - # metrics and action history are removed. The author is created again with a clean - # record the next time content is moderated for the same ID. - sig do - params( - id: String, - request_options: ModerationAPI::RequestOptions::OrHash - ).returns(ModerationAPI::Models::AuthorDeleteResponse) - end - def delete( - # Either external ID or the ID assigned by moderation API. - id, - request_options: {} - ) - end - - # @api private - sig { params(client: ModerationAPI::Client).returns(T.attached_class) } - def self.new(client:) - end - end - end -end diff --git a/rbi/moderation_api/resources/content.rbi b/rbi/moderation_api/resources/content.rbi deleted file mode 100644 index 7fa348db..00000000 --- a/rbi/moderation_api/resources/content.rbi +++ /dev/null @@ -1,136 +0,0 @@ -# typed: strong - -module ModerationAPI - module Resources - class Content - # Open a WebSocket to moderate live voice/call audio in real time. Speech is - # transcribed and each finalized utterance is moderated by your enabled text - # policies; you receive a verdict per utterance as it's spoken. - # - # **This is a WebSocket upgrade, not a regular HTTP call.** The request body below - # documents the frames you _send_ over the socket; the `101` response documents - # the events you _receive_. - # - # - **Auth:** `Authorization: Bearer ` on the upgrade. A missing/invalid - # key closes `4401`; voice not enabled on the plan/channel closes `4403`. - # - **Subprotocol:** request `moderationapi.v1`. - # - **Flow:** send one `start` frame, then `media` frames as audio arrives, then - # `stop` (or disconnect). You receive `session.started`, `utterance.final` per - # utterance, optional `utterance.partial`/`warning`, and `session.ended`. - # - **Close codes:** `1000` normal · `1011` server error · `4400` bad request · - # `4401` auth failed · `4403` voice not enabled · `4429` concurrency limit. - # - # See the - # [Real-time voice guide](https://docs.moderationapi.com/content-moderation/real-time-voice) - # for the full walkthrough and code examples. - sig do - params( - sec_web_socket_protocol: - ModerationAPI::ContentStreamParams::SecWebSocketProtocol::OrSymbol, - request_options: ModerationAPI::RequestOptions::OrHash - ).void - end - def stream( - # Requested subprotocol. - sec_web_socket_protocol:, - request_options: {} - ) - end - - sig do - params( - content: - T.any( - ModerationAPI::ContentSubmitParams::Content::Text::OrHash, - ModerationAPI::ContentSubmitParams::Content::Image::OrHash, - ModerationAPI::ContentSubmitParams::Content::Video::OrHash, - ModerationAPI::ContentSubmitParams::Content::Audio::OrHash, - ModerationAPI::ContentSubmitParams::Content::Object::OrHash - ), - author_id: String, - channel: String, - client_action: - ModerationAPI::ContentSubmitParams::ClientAction::OrHash, - content_id: String, - conversation_id: String, - do_not_store: T::Boolean, - metadata: T::Hash[Symbol, T.anything], - meta_type: ModerationAPI::ContentSubmitParams::MetaType::OrSymbol, - policies: - T::Array[ - T.any( - ModerationAPI::ContentSubmitParams::Policy::Toxicity::OrHash, - ModerationAPI::ContentSubmitParams::Policy::PersonalInformation::OrHash, - ModerationAPI::ContentSubmitParams::Policy::ToxicitySevere::OrHash, - ModerationAPI::ContentSubmitParams::Policy::Hate::OrHash, - ModerationAPI::ContentSubmitParams::Policy::Illicit::OrHash, - ModerationAPI::ContentSubmitParams::Policy::IllicitDrugs::OrHash, - ModerationAPI::ContentSubmitParams::Policy::IllicitAlcohol::OrHash, - ModerationAPI::ContentSubmitParams::Policy::IllicitFirearms::OrHash, - ModerationAPI::ContentSubmitParams::Policy::IllicitTobacco::OrHash, - ModerationAPI::ContentSubmitParams::Policy::IllicitGambling::OrHash, - ModerationAPI::ContentSubmitParams::Policy::Cannabis::OrHash, - ModerationAPI::ContentSubmitParams::Policy::Adult::OrHash, - ModerationAPI::ContentSubmitParams::Policy::Crypto::OrHash, - ModerationAPI::ContentSubmitParams::Policy::Sexual::OrHash, - ModerationAPI::ContentSubmitParams::Policy::SexualMinors::OrHash, - ModerationAPI::ContentSubmitParams::Policy::Flirtation::OrHash, - ModerationAPI::ContentSubmitParams::Policy::Profanity::OrHash, - ModerationAPI::ContentSubmitParams::Policy::Violence::OrHash, - ModerationAPI::ContentSubmitParams::Policy::SelfHarm::OrHash, - ModerationAPI::ContentSubmitParams::Policy::Spam::OrHash, - ModerationAPI::ContentSubmitParams::Policy::LowQualityContent::OrHash, - ModerationAPI::ContentSubmitParams::Policy::FaceDetection::OrHash, - ModerationAPI::ContentSubmitParams::Policy::SelfPromotion::OrHash, - ModerationAPI::ContentSubmitParams::Policy::Political::OrHash, - ModerationAPI::ContentSubmitParams::Policy::Religion::OrHash, - ModerationAPI::ContentSubmitParams::Policy::CodeAbuse::OrHash, - ModerationAPI::ContentSubmitParams::Policy::UnicodeSpoofing::OrHash, - ModerationAPI::ContentSubmitParams::Policy::PiiMasking::OrHash, - ModerationAPI::ContentSubmitParams::Policy::URLMasking::OrHash, - ModerationAPI::ContentSubmitParams::Policy::URLRisk::OrHash, - ModerationAPI::ContentSubmitParams::Policy::Guideline::OrHash - ) - ], - timestamp: Float, - request_options: ModerationAPI::RequestOptions::OrHash - ).returns(ModerationAPI::Models::ContentSubmitResponse) - end - def submit( - # The content sent for moderation - content:, - # The author of the content. - author_id: nil, - # Provide a channel ID or key. Will use the project's default channel if not - # provided. - channel: nil, - # A recommendation from your own client-side flagging (e.g. a banned-IP list or a - # third-party tool). Feeds the rules engine and can escalate or override the - # recommended action. Does not change whether our analysis flagged the content. - client_action: nil, - # The unique ID of the content in your database. - content_id: nil, - # For example the ID of a chat room or a post - conversation_id: nil, - # Do not store the content. The content won't enter the review queue - do_not_store: nil, - # Any metadata you want to store with the content - metadata: nil, - # The meta type of content being moderated - meta_type: nil, - # (Enterprise) override the channel policies for this moderation request only. - policies: nil, - # Unix timestamp (in milliseconds) of when the content was created. Use if content - # is not submitted in real-time. - timestamp: nil, - request_options: {} - ) - end - - # @api private - sig { params(client: ModerationAPI::Client).returns(T.attached_class) } - def self.new(client:) - end - end - end -end diff --git a/rbi/moderation_api/resources/queue.rbi b/rbi/moderation_api/resources/queue.rbi deleted file mode 100644 index 134c5d92..00000000 --- a/rbi/moderation_api/resources/queue.rbi +++ /dev/null @@ -1,47 +0,0 @@ -# typed: strong - -module ModerationAPI - module Resources - class Queue - sig { returns(ModerationAPI::Resources::Queue::Items) } - attr_reader :items - - # Get a queue - sig do - params( - id: String, - request_options: ModerationAPI::RequestOptions::OrHash - ).returns(ModerationAPI::Models::QueueRetrieveResponse) - end - def retrieve( - # The queue ID - id, - request_options: {} - ) - end - - # Get detailed statistics about a moderation queue including review times, action - # counts, and trends - sig do - params( - id: String, - within_days: String, - request_options: ModerationAPI::RequestOptions::OrHash - ).returns(ModerationAPI::Models::QueueGetStatsResponse) - end - def get_stats( - # The queue ID - id, - # Number of days to analyze statistics for - within_days: nil, - request_options: {} - ) - end - - # @api private - sig { params(client: ModerationAPI::Client).returns(T.attached_class) } - def self.new(client:) - end - end - end -end diff --git a/rbi/moderation_api/resources/queue/items.rbi b/rbi/moderation_api/resources/queue/items.rbi deleted file mode 100644 index 74480585..00000000 --- a/rbi/moderation_api/resources/queue/items.rbi +++ /dev/null @@ -1,95 +0,0 @@ -# typed: strong - -module ModerationAPI - module Resources - class Queue - class Items - # Get paginated list of items in a moderation queue with filtering options - sig do - params( - id: String, - after_date: String, - author_id: String, - before_date: String, - conversation_ids: String, - filtered_action_ids: String, - include_resolved: String, - labels: String, - page_number: Float, - page_size: Float, - sort_direction: - ModerationAPI::Queue::ItemListParams::SortDirection::OrSymbol, - sort_field: - ModerationAPI::Queue::ItemListParams::SortField::OrSymbol, - request_options: ModerationAPI::RequestOptions::OrHash - ).returns(ModerationAPI::Models::Queue::ItemListResponse) - end - def list( - # The queue ID - id, - after_date: nil, - author_id: nil, - before_date: nil, - conversation_ids: nil, - filtered_action_ids: nil, - include_resolved: nil, - labels: nil, - # Page number to fetch - page_number: nil, - # Number of items per page - page_size: nil, - # Sort direction - sort_direction: nil, - sort_field: nil, - request_options: {} - ) - end - - # Mark a queue item as resolved with a specific moderation action - sig do - params( - item_id: String, - id: String, - comment: String, - request_options: ModerationAPI::RequestOptions::OrHash - ).returns(ModerationAPI::Models::Queue::ItemResolveResponse) - end - def resolve( - # Path param: The item ID to resolve - item_id, - # Path param: The queue ID - id:, - # Body param: Optional comment - comment: nil, - request_options: {} - ) - end - - # Mark a previously resolved queue item as unresolved/pending - sig do - params( - item_id: String, - id: String, - comment: String, - request_options: ModerationAPI::RequestOptions::OrHash - ).returns(ModerationAPI::Models::Queue::ItemUnresolveResponse) - end - def unresolve( - # Path param: The item ID to unresolve - item_id, - # Path param: The queue ID - id:, - # Body param: Optional reason for unresolving the item - comment: nil, - request_options: {} - ) - end - - # @api private - sig { params(client: ModerationAPI::Client).returns(T.attached_class) } - def self.new(client:) - end - end - end - end -end diff --git a/rbi/moderation_api/resources/webhook_secret.rbi b/rbi/moderation_api/resources/webhook_secret.rbi deleted file mode 100644 index 21f548c4..00000000 --- a/rbi/moderation_api/resources/webhook_secret.rbi +++ /dev/null @@ -1,23 +0,0 @@ -# typed: strong - -module ModerationAPI - module Resources - class WebhookSecret - # Get the signing secret used to sign webhook deliveries for this project, - # creating one if none exists yet. Verify deliveries by comparing the - # `modapi-signature` header to HMAC-SHA256(raw request body, secret) hex-encoded. - sig do - params(request_options: ModerationAPI::RequestOptions::OrHash).returns( - ModerationAPI::Models::WebhookSecretRetrieveResponse - ) - end - def retrieve(request_options: {}) - end - - # @api private - sig { params(client: ModerationAPI::Client).returns(T.attached_class) } - def self.new(client:) - end - end - end -end diff --git a/rbi/moderation_api/resources/webhooks.rbi b/rbi/moderation_api/resources/webhooks.rbi deleted file mode 100644 index ab75196f..00000000 --- a/rbi/moderation_api/resources/webhooks.rbi +++ /dev/null @@ -1,105 +0,0 @@ -# typed: strong - -module ModerationAPI - module Resources - class Webhooks - # Create a webhook subscribed to one or more event types. Deliveries use the v2 - # envelope and are signed with the project signing secret (see the signing secret - # endpoint). - sig do - params( - event_types: - T::Array[ModerationAPI::WebhookCreateParams::EventType::OrSymbol], - name: String, - url: String, - description: T.nilable(String), - request_options: ModerationAPI::RequestOptions::OrHash - ).returns(ModerationAPI::Models::WebhookCreateResponse) - end - def create( - # Event types this webhook subscribes to. One webhook URL receives all events you - # list here. - event_types:, - # The webhook's name, used to identify it in the dashboard - name:, - # The webhook's URL. We'll call this URL when an event occurs. - url:, - # The webhook's description - description: nil, - request_options: {} - ) - end - - # Get a webhook by ID. - sig do - params( - id: String, - request_options: ModerationAPI::RequestOptions::OrHash - ).returns(ModerationAPI::Models::WebhookRetrieveResponse) - end - def retrieve( - # The ID of the webhook to get. - id, - request_options: {} - ) - end - - # Update a webhook. Legacy v1 webhooks are read-only: delete them and create a new - # webhook instead. - sig do - params( - id: String, - description: T.nilable(String), - event_types: - T::Array[ModerationAPI::WebhookUpdateParams::EventType::OrSymbol], - name: String, - url: String, - request_options: ModerationAPI::RequestOptions::OrHash - ).returns(ModerationAPI::Models::WebhookUpdateResponse) - end - def update( - # The ID of the webhook to update. - id, - # The webhook's description - description: nil, - # Event types this webhook subscribes to. One webhook URL receives all events you - # list here. - event_types: nil, - # The webhook's name, used to identify it in the dashboard - name: nil, - # The webhook's URL. We'll call this URL when an event occurs. - url: nil, - request_options: {} - ) - end - - # List all webhooks for the authenticated project. - sig do - params(request_options: ModerationAPI::RequestOptions::OrHash).returns( - T::Array[ModerationAPI::Models::WebhookListResponseItem] - ) - end - def list(request_options: {}) - end - - # Delete a webhook. - sig do - params( - id: String, - request_options: ModerationAPI::RequestOptions::OrHash - ).returns(ModerationAPI::Models::WebhookDeleteResponse) - end - def delete( - # The ID of the webhook to delete. - id, - request_options: {} - ) - end - - # @api private - sig { params(client: ModerationAPI::Client).returns(T.attached_class) } - def self.new(client:) - end - end - end -end diff --git a/rbi/moderation_api/resources/wordlist.rbi b/rbi/moderation_api/resources/wordlist.rbi deleted file mode 100644 index f04c1c7a..00000000 --- a/rbi/moderation_api/resources/wordlist.rbi +++ /dev/null @@ -1,82 +0,0 @@ -# typed: strong - -module ModerationAPI - module Resources - class Wordlist - sig { returns(ModerationAPI::Resources::Wordlist::Words) } - attr_reader :words - - # Get a specific wordlist by ID - sig do - params( - id: String, - request_options: ModerationAPI::RequestOptions::OrHash - ).returns(ModerationAPI::Models::WordlistRetrieveResponse) - end - def retrieve( - # ID of the wordlist to get - id, - request_options: {} - ) - end - - # Update a wordlist - sig do - params( - id: String, - description: String, - key: String, - name: String, - strict: T::Boolean, - words: T::Array[String], - request_options: ModerationAPI::RequestOptions::OrHash - ).returns(ModerationAPI::Models::WordlistUpdateResponse) - end - def update( - # ID of the wordlist to update - id, - # New description for the wordlist - description: nil, - # New key for the wordlist - key: nil, - # New name for the wordlist - name: nil, - # Deprecated. Now using threshold in project settings. - strict: nil, - # New words for the wordlist. Replace the existing words with these new ones. - # Duplicate words will be ignored. - words: nil, - request_options: {} - ) - end - - # List all wordlists for the authenticated organization - sig do - params(request_options: ModerationAPI::RequestOptions::OrHash).returns( - T::Array[ModerationAPI::Models::WordlistListResponseItem] - ) - end - def list(request_options: {}) - end - - # Get the current embedding progress status for a wordlist - sig do - params( - id: String, - request_options: ModerationAPI::RequestOptions::OrHash - ).returns(ModerationAPI::Models::WordlistGetEmbeddingStatusResponse) - end - def get_embedding_status( - # ID of the wordlist to check embedding status for - id, - request_options: {} - ) - end - - # @api private - sig { params(client: ModerationAPI::Client).returns(T.attached_class) } - def self.new(client:) - end - end - end -end diff --git a/rbi/moderation_api/resources/wordlist/words.rbi b/rbi/moderation_api/resources/wordlist/words.rbi deleted file mode 100644 index 24e9a2d9..00000000 --- a/rbi/moderation_api/resources/wordlist/words.rbi +++ /dev/null @@ -1,48 +0,0 @@ -# typed: strong - -module ModerationAPI - module Resources - class Wordlist - class Words - # Add words to an existing wordlist - sig do - params( - id: String, - words: T::Array[String], - request_options: ModerationAPI::RequestOptions::OrHash - ).returns(ModerationAPI::Models::Wordlist::WordAddResponse) - end - def add( - # ID of the wordlist to add words to - id, - # Array of words to add to the wordlist. Duplicate words will be ignored. - words:, - request_options: {} - ) - end - - # Remove words from an existing wordlist - sig do - params( - id: String, - words: T::Array[String], - request_options: ModerationAPI::RequestOptions::OrHash - ).returns(ModerationAPI::Models::Wordlist::WordRemoveResponse) - end - def remove( - # ID of the wordlist to remove words from - id, - # Array of words to remove from the wordlist - words:, - request_options: {} - ) - end - - # @api private - sig { params(client: ModerationAPI::Client).returns(T.attached_class) } - def self.new(client:) - end - end - end - end -end diff --git a/rbi/moderation_api/version.rbi b/rbi/moderation_api/version.rbi deleted file mode 100644 index 9f8ce796..00000000 --- a/rbi/moderation_api/version.rbi +++ /dev/null @@ -1,5 +0,0 @@ -# typed: strong - -module ModerationAPI - VERSION = T.let(T.unsafe(nil), String) -end diff --git a/release-please-config.json b/release-please-config.json deleted file mode 100644 index 364e63fd..00000000 --- a/release-please-config.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "packages": { - ".": {} - }, - "$schema": "https://raw.githubusercontent.com/stainless-api/release-please/main/schemas/config.json", - "include-v-in-tag": true, - "include-component-in-tag": false, - "versioning": "prerelease", - "prerelease": true, - "bump-minor-pre-major": true, - "bump-patch-for-minor-pre-major": false, - "pull-request-header": "Automated Release PR", - "pull-request-title-pattern": "release: ${version}", - "changelog-sections": [ - { - "type": "feat", - "section": "Features" - }, - { - "type": "fix", - "section": "Bug Fixes" - }, - { - "type": "perf", - "section": "Performance Improvements" - }, - { - "type": "revert", - "section": "Reverts" - }, - { - "type": "chore", - "section": "Chores" - }, - { - "type": "docs", - "section": "Documentation" - }, - { - "type": "style", - "section": "Styles" - }, - { - "type": "refactor", - "section": "Refactors" - }, - { - "type": "test", - "section": "Tests", - "hidden": true - }, - { - "type": "build", - "section": "Build System" - }, - { - "type": "ci", - "section": "Continuous Integration", - "hidden": true - } - ], - "release-type": "ruby", - "version-file": "lib/moderation_api/version.rb", - "extra-files": [ - { - "type": "ruby-readme", - "path": "README.md" - } - ] -} \ No newline at end of file diff --git a/scripts/bootstrap b/scripts/bootstrap deleted file mode 100755 index a5e1b80a..00000000 --- a/scripts/bootstrap +++ /dev/null @@ -1,24 +0,0 @@ -#!/usr/bin/env bash - -set -e - -cd -- "$(dirname -- "$0")/.." - -if [ -f "Brewfile" ] && [ "$(uname -s)" = "Darwin" ] && [ "${SKIP_BREW:-}" != "1" ] && [ -t 0 ]; then - brew bundle check >/dev/null 2>&1 || { - echo -n "==> Install Homebrew dependencies? (y/N): " - read -r response - case "$response" in - [yY][eE][sS]|[yY]) - brew bundle - ;; - *) - ;; - esac - echo - } -fi - -echo "==> Installing Ruby dependencies…" - -exec -- bundle install "$@" diff --git a/scripts/fast-format b/scripts/fast-format deleted file mode 100755 index 6d5973fb..00000000 --- a/scripts/fast-format +++ /dev/null @@ -1,18 +0,0 @@ -#!/usr/bin/env bash - -set -euo pipefail - -echo "Script started with $# arguments" -echo "Arguments: $*" -echo "Script location: $(dirname "$0")" - -cd -- "$(dirname "$0")/.." -echo "Changed to directory: $PWD" - -if [ $# -eq 0 ]; then - echo "Usage: $0 [additional-formatter-args...]" - echo "The file should contain one file path per line" - exit 1 -fi - -exec -- bundle exec rake format FORMAT_FILE="$1" diff --git a/scripts/format b/scripts/format deleted file mode 100755 index 177d1e63..00000000 --- a/scripts/format +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/env bash - -set -e - -cd -- "$(dirname -- "$0")/.." - -echo "==> Running formatters" - -exec -- bundle exec rake format "$@" diff --git a/scripts/lint b/scripts/lint deleted file mode 100755 index 08b0dbeb..00000000 --- a/scripts/lint +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/env bash - -set -e - -cd -- "$(dirname -- "$0")/.." - -echo "==> Running linters" - -exec -- bundle exec rake lint "$@" diff --git a/scripts/test b/scripts/test deleted file mode 100755 index df8caf98..00000000 --- a/scripts/test +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env bash - -set -e - -cd -- "$(dirname -- "$0")/.." - - - -echo "==> Running tests" -bundle exec rake test "$@" diff --git a/scripts/utils/upload-artifact.sh b/scripts/utils/upload-artifact.sh deleted file mode 100755 index edb998c1..00000000 --- a/scripts/utils/upload-artifact.sh +++ /dev/null @@ -1,113 +0,0 @@ -#!/usr/bin/env bash - -set -euo pipefail - -# ANSI Color Codes -GREEN='\033[32m' -RED='\033[31m' -NC='\033[0m' # No Color - -DIST_DIR="dist" - -log_error() { - local msg="$1" - local headers="$2" - local body="$3" - echo -e "${RED}${msg}${NC}" - [[ -f "$headers" ]] && echo -e "${RED}Headers:$(cat "$headers")${NC}" - echo -e "${RED}Body: ${body}${NC}" - exit 1 -} - -upload_file() { - local file_name="$1" - local tmp_headers - tmp_headers=$(mktemp) - - if [ -f "$file_name" ]; then - echo -e "${GREEN}Processing file: $file_name${NC}" - pkg_file_name="${file_name#"${DIST_DIR}/"}" - - # Get signed URL for uploading artifact file - signed_url_response=$(curl -X POST -G "$URL" \ - -sS --retry 5 \ - -D "$tmp_headers" \ - --data-urlencode "filename=$pkg_file_name" \ - -H "Authorization: Bearer $AUTH" \ - -H "Content-Type: application/json") - - # Validate JSON and extract URL - if ! signed_url=$(echo "$signed_url_response" | jq -e -r '.url' 2>/dev/null) || [[ "$signed_url" == "null" ]]; then - log_error "Failed to get valid signed URL" "$tmp_headers" "$signed_url_response" - fi - - # Set content-type based on file extension - local extension="${file_name##*.}" - local content_type - case "$extension" in - gem) content_type="application/octet-stream" ;; - gz) content_type="application/gzip" ;; - rz) content_type="application/octet-stream" ;; - html) content_type="text/html" ;; - *) content_type="application/octet-stream" ;; - esac - - # Upload file - upload_response=$(curl -v -X PUT \ - --retry 5 \ - --retry-all-errors \ - -D "$tmp_headers" \ - -H "Content-Type: $content_type" \ - --data-binary "@${file_name}" "$signed_url" 2>&1) - - if ! echo "$upload_response" | grep -q "HTTP/[0-9.]* 200"; then - log_error "Failed to upload artifact file" "$tmp_headers" "$upload_response" - fi - - # Insert small throttle to reduce rate limiting risk - sleep 0.1 - fi -} - -walk_tree() { - local current_dir="$1" - - for entry in "$current_dir"/*; do - # Check that entry is valid - [ -e "$entry" ] || [ -h "$entry" ] || continue - - if [ -d "$entry" ]; then - walk_tree "$entry" - else - upload_file "$entry" - fi - done -} - -cd "$(dirname "$0")/../.." - -echo "::group::Building gem" -VERSION_FILE="lib/${PACKAGE_NAME}/version.rb" -if [[ ! -f "$VERSION_FILE" ]]; then - echo -e "${RED}Version file not found: ${VERSION_FILE}${NC}" - exit 1 -fi -SHORT_SHA="${SHA:0:7}" -sed -i.bak -E "s/(VERSION = \"[^\"]+)\"/\1.beta.${SHORT_SHA}\"/" "$VERSION_FILE" -rm -f "${VERSION_FILE}.bak" - -gem build -mkdir -p "${DIST_DIR}/gems" -mv ./*.gem "${DIST_DIR}/gems/" -echo "::endgroup::" - -echo "::group::Generating gem index" -gem generate_index --directory "$DIST_DIR" -echo "::endgroup::" - -echo "::group::Uploading to pkg.stainless.com" -walk_tree "$DIST_DIR" -echo "::endgroup::" - -echo -e "${GREEN}Gem artifacts uploaded to Stainless storage.${NC}" -echo -e "\033[32mInstallation: bundle remove moderation_api && bundle add moderation_api --source 'https://pkg.stainless.com/s/moderation-api-ruby/$SHA'\033[0m" diff --git a/sig/moderation_api/client.rbs b/sig/moderation_api/client.rbs deleted file mode 100644 index c1937b52..00000000 --- a/sig/moderation_api/client.rbs +++ /dev/null @@ -1,44 +0,0 @@ -module ModerationAPI - class Client < ModerationAPI::Internal::Transport::BaseClient - DEFAULT_MAX_RETRIES: 2 - - DEFAULT_TIMEOUT_IN_SECONDS: Float - - DEFAULT_INITIAL_RETRY_DELAY: Float - - DEFAULT_MAX_RETRY_DELAY: Float - - attr_reader secret_key: String - - attr_reader authors: ModerationAPI::Resources::Authors - - attr_reader queue: ModerationAPI::Resources::Queue - - attr_reader actions: ModerationAPI::Resources::Actions - - attr_reader content: ModerationAPI::Resources::Content - - attr_reader account: ModerationAPI::Resources::Account - - attr_reader auth: ModerationAPI::Resources::Auth - - attr_reader wordlist: ModerationAPI::Resources::Wordlist - - attr_reader webhooks: ModerationAPI::Resources::Webhooks - - attr_reader webhook_secret: ModerationAPI::Resources::WebhookSecret - - private def auth_headers: -> ::Hash[String, String] - - def base_url_overridden?: -> bool - - def initialize: ( - ?secret_key: String?, - ?base_url: String?, - ?max_retries: Integer, - ?timeout: Float, - ?initial_retry_delay: Float, - ?max_retry_delay: Float - ) -> void - end -end diff --git a/sig/moderation_api/errors.rbs b/sig/moderation_api/errors.rbs deleted file mode 100644 index bbd8b99b..00000000 --- a/sig/moderation_api/errors.rbs +++ /dev/null @@ -1,117 +0,0 @@ -module ModerationAPI - module Errors - class Error < StandardError - attr_accessor cause: StandardError? - end - - class ConversionError < ModerationAPI::Errors::Error - def cause: -> StandardError? - - def initialize: ( - on: Class, - method: Symbol, - target: top, - value: top, - ?cause: StandardError? - ) -> void - end - - class APIError < ModerationAPI::Errors::Error - attr_accessor url: URI::Generic - - attr_accessor status: Integer? - - attr_accessor headers: ::Hash[String, String]? - - attr_accessor body: top? - - def initialize: ( - url: URI::Generic, - ?status: Integer?, - ?headers: ::Hash[String, String]?, - ?body: Object?, - ?request: nil, - ?response: nil, - ?message: String? - ) -> void - end - - class APIConnectionError < ModerationAPI::Errors::APIError - def initialize: ( - url: URI::Generic, - ?status: nil, - ?headers: ::Hash[String, String]?, - ?body: nil, - ?request: nil, - ?response: nil, - ?message: String? - ) -> void - end - - class APITimeoutError < ModerationAPI::Errors::APIConnectionError - def initialize: ( - url: URI::Generic, - ?status: nil, - ?headers: ::Hash[String, String]?, - ?body: nil, - ?request: nil, - ?response: nil, - ?message: String? - ) -> void - end - - class APIStatusError < ModerationAPI::Errors::APIError - def self.for: ( - url: URI::Generic, - status: Integer, - headers: ::Hash[String, String]?, - body: Object?, - request: nil, - response: nil, - ?message: String? - ) -> instance - - def initialize: ( - url: URI::Generic, - status: Integer, - headers: ::Hash[String, String]?, - body: Object?, - request: nil, - response: nil, - ?message: String? - ) -> void - end - - class BadRequestError < ModerationAPI::Errors::APIStatusError - HTTP_STATUS: 400 - end - - class AuthenticationError < ModerationAPI::Errors::APIStatusError - HTTP_STATUS: 401 - end - - class PermissionDeniedError < ModerationAPI::Errors::APIStatusError - HTTP_STATUS: 403 - end - - class NotFoundError < ModerationAPI::Errors::APIStatusError - HTTP_STATUS: 404 - end - - class ConflictError < ModerationAPI::Errors::APIStatusError - HTTP_STATUS: 409 - end - - class UnprocessableEntityError < ModerationAPI::Errors::APIStatusError - HTTP_STATUS: 422 - end - - class RateLimitError < ModerationAPI::Errors::APIStatusError - HTTP_STATUS: 429 - end - - class InternalServerError < ModerationAPI::Errors::APIStatusError - HTTP_STATUS: Range[Integer] - end - end -end diff --git a/sig/moderation_api/file_part.rbs b/sig/moderation_api/file_part.rbs deleted file mode 100644 index df61d07b..00000000 --- a/sig/moderation_api/file_part.rbs +++ /dev/null @@ -1,21 +0,0 @@ -module ModerationAPI - class FilePart - attr_reader content: Pathname | StringIO | IO | String - - attr_reader content_type: String? - - attr_reader filename: String? - - private def read: -> String - - def to_json: (*top a) -> String - - def to_yaml: (*top a) -> String - - def initialize: ( - Pathname | StringIO | IO | String content, - ?filename: (Pathname | String)?, - ?content_type: String? - ) -> void - end -end diff --git a/sig/moderation_api/internal.rbs b/sig/moderation_api/internal.rbs deleted file mode 100644 index 5b287ca8..00000000 --- a/sig/moderation_api/internal.rbs +++ /dev/null @@ -1,10 +0,0 @@ -module ModerationAPI - module Internal - extend ModerationAPI::Internal::Util::SorbetRuntimeSupport - - type file_input = - Pathname | StringIO | IO | String | ModerationAPI::FilePart - - OMIT: Object - end -end diff --git a/sig/moderation_api/internal/transport/base_client.rbs b/sig/moderation_api/internal/transport/base_client.rbs deleted file mode 100644 index d697ee35..00000000 --- a/sig/moderation_api/internal/transport/base_client.rbs +++ /dev/null @@ -1,133 +0,0 @@ -module ModerationAPI - module Internal - module Transport - class BaseClient - extend ModerationAPI::Internal::Util::SorbetRuntimeSupport - - type request_components = - { - method: Symbol, - path: String | ::Array[String], - query: ::Hash[String, (::Array[String] | String)?]?, - headers: ::Hash[String, (String - | Integer - | ::Array[(String | Integer)?])?]?, - body: top?, - unwrap: (Symbol - | Integer - | ::Array[(Symbol | Integer)] - | (^(top arg0) -> top))?, - page: Class?, - stream: Class?, - model: ModerationAPI::Internal::Type::Converter::input?, - options: ModerationAPI::request_opts? - } - type request_input = - { - method: Symbol, - url: URI::Generic, - headers: ::Hash[String, String], - body: top, - max_retries: Integer, - timeout: Float - } - - MAX_REDIRECTS: 20 - - PLATFORM_HEADERS: ::Hash[String, String] - - def self.validate!: ( - ModerationAPI::Internal::Transport::BaseClient::request_components req - ) -> void - - def self.should_retry?: ( - Integer status, - headers: ::Hash[String, String] - ) -> bool - - def self.follow_redirect: ( - ModerationAPI::Internal::Transport::BaseClient::request_input request, - status: Integer, - response_headers: ::Hash[String, String] - ) -> ModerationAPI::Internal::Transport::BaseClient::request_input - - def self.reap_connection!: ( - Integer | ModerationAPI::Errors::APIConnectionError status, - stream: Enumerable[String]? - ) -> void - - attr_reader base_url: URI::Generic - - attr_reader timeout: Float - - attr_reader max_retries: Integer - - attr_reader initial_retry_delay: Float - - attr_reader max_retry_delay: Float - - attr_reader headers: ::Hash[String, String] - - attr_reader idempotency_header: String? - - # @api private - attr_reader requester: ModerationAPI::Internal::Transport::PooledNetRequester - - def initialize: ( - base_url: String, - ?timeout: Float, - ?max_retries: Integer, - ?initial_retry_delay: Float, - ?max_retry_delay: Float, - ?headers: ::Hash[String, (String - | Integer - | ::Array[(String | Integer)?])?], - ?idempotency_header: String? - ) -> void - - private def auth_headers: -> ::Hash[String, String] - - private def user_agent: -> String - - private def generate_idempotency_key: -> String - - private def build_request: ( - ModerationAPI::Internal::Transport::BaseClient::request_components req, - ModerationAPI::request_options opts - ) -> ModerationAPI::Internal::Transport::BaseClient::request_input - - private def retry_delay: ( - ::Hash[String, String] headers, - retry_count: Integer - ) -> Float - - def send_request: ( - ModerationAPI::Internal::Transport::BaseClient::request_input request, - redirect_count: Integer, - retry_count: Integer, - send_retry_header: bool - ) -> [Integer, top, Enumerable[String]] - - def request: ( - Symbol method, - String | ::Array[String] path, - ?query: ::Hash[String, (::Array[String] | String)?]?, - ?headers: ::Hash[String, (String - | Integer - | ::Array[(String | Integer)?])?]?, - ?body: top?, - ?unwrap: (Symbol - | Integer - | ::Array[(Symbol | Integer)] - | (^(top arg0) -> top))?, - ?page: Class?, - ?stream: Class?, - ?model: ModerationAPI::Internal::Type::Converter::input?, - ?options: ModerationAPI::request_opts? - ) -> top - - def inspect: -> String - end - end - end -end diff --git a/sig/moderation_api/internal/transport/pooled_net_requester.rbs b/sig/moderation_api/internal/transport/pooled_net_requester.rbs deleted file mode 100644 index 9736add1..00000000 --- a/sig/moderation_api/internal/transport/pooled_net_requester.rbs +++ /dev/null @@ -1,48 +0,0 @@ -module ModerationAPI - module Internal - module Transport - class PooledNetRequester - extend ModerationAPI::Internal::Util::SorbetRuntimeSupport - - type request = - { - method: Symbol, - url: URI::Generic, - headers: ::Hash[String, String], - body: top, - deadline: Float - } - - KEEP_ALIVE_TIMEOUT: 30 - - DEFAULT_MAX_CONNECTIONS: Integer - - def self.connect: ( - cert_store: OpenSSL::X509::Store, - url: URI::Generic - ) -> top - - def self.calibrate_socket_timeout: (top conn, Float deadline) -> void - - def self.build_request: ( - ModerationAPI::Internal::Transport::PooledNetRequester::request request - ) { - (String arg0) -> void - } -> [top, (^-> void)] - - private def with_pool: ( - URI::Generic url, - deadline: Float - ) { - (top arg0) -> void - } -> void - - def execute: ( - ModerationAPI::Internal::Transport::PooledNetRequester::request request - ) -> [Integer, top, Enumerable[String]] - - def initialize: (?size: Integer) -> void - end - end - end -end diff --git a/sig/moderation_api/internal/type/array_of.rbs b/sig/moderation_api/internal/type/array_of.rbs deleted file mode 100644 index 3d5292ba..00000000 --- a/sig/moderation_api/internal/type/array_of.rbs +++ /dev/null @@ -1,48 +0,0 @@ -module ModerationAPI - module Internal - module Type - class ArrayOf[Elem] - include ModerationAPI::Internal::Type::Converter - include ModerationAPI::Internal::Util::SorbetRuntimeSupport - - def self.[]: ( - ::Hash[Symbol, top] - | ^-> ModerationAPI::Internal::Type::Converter::input - | ModerationAPI::Internal::Type::Converter::input type_info, - ?::Hash[Symbol, top] spec - ) -> instance - - def ===: (top other) -> bool - - def ==: (top other) -> bool - - def hash: -> Integer - - def coerce: ( - ::Array[top] | top value, - state: ModerationAPI::Internal::Type::Converter::coerce_state - ) -> (::Array[top] | top) - - def dump: ( - ::Array[top] | top value, - state: ModerationAPI::Internal::Type::Converter::dump_state - ) -> (::Array[top] | top) - - def to_sorbet_type: -> top - - def item_type: -> Elem - - def nilable?: -> bool - - def initialize: ( - ::Hash[Symbol, top] - | ^-> ModerationAPI::Internal::Type::Converter::input - | ModerationAPI::Internal::Type::Converter::input type_info, - ?::Hash[Symbol, top] spec - ) -> void - - def inspect: (?depth: Integer) -> String - end - end - end -end diff --git a/sig/moderation_api/internal/type/base_model.rbs b/sig/moderation_api/internal/type/base_model.rbs deleted file mode 100644 index f98d12a3..00000000 --- a/sig/moderation_api/internal/type/base_model.rbs +++ /dev/null @@ -1,104 +0,0 @@ -module ModerationAPI - module Internal - module Type - class BaseModel - extend ModerationAPI::Internal::Type::Converter - extend ModerationAPI::Internal::Util::SorbetRuntimeSupport - - type known_field = - { mode: (:coerce | :dump)?, required: bool, nilable: bool } - - def self.inherited: (self child) -> void - - def self.known_fields: -> ::Hash[Symbol, (ModerationAPI::Internal::Type::BaseModel::known_field - & { type_fn: (^-> ModerationAPI::Internal::Type::Converter::input) })] - - def self.fields: -> ::Hash[Symbol, (ModerationAPI::Internal::Type::BaseModel::known_field - & { type: ModerationAPI::Internal::Type::Converter::input })] - - private def self.add_field: ( - Symbol name_sym, - required: bool, - type_info: { - const: (nil | bool | Integer | Float | Symbol)?, - enum: ^-> ModerationAPI::Internal::Type::Converter::input?, - union: ^-> ModerationAPI::Internal::Type::Converter::input?, - api_name: Symbol - } - | ^-> ModerationAPI::Internal::Type::Converter::input - | ModerationAPI::Internal::Type::Converter::input, - spec: ::Hash[Symbol, top] - ) -> void - - def self.required: ( - Symbol name_sym, - ::Hash[Symbol, top] - | ^-> ModerationAPI::Internal::Type::Converter::input - | ModerationAPI::Internal::Type::Converter::input type_info, - ?::Hash[Symbol, top] spec - ) -> void - - def self.optional: ( - Symbol name_sym, - ::Hash[Symbol, top] - | ^-> ModerationAPI::Internal::Type::Converter::input - | ModerationAPI::Internal::Type::Converter::input type_info, - ?::Hash[Symbol, top] spec - ) -> void - - private def self.request_only: { -> void } -> void - - private def self.response_only: { -> void } -> void - - def self.==: (top other) -> bool - - def self.hash: -> Integer - - def ==: (top other) -> bool - - def hash: -> Integer - - def self.coerce: ( - ModerationAPI::Internal::Type::BaseModel - | ::Hash[top, top] - | top value, - state: ModerationAPI::Internal::Type::Converter::coerce_state - ) -> (instance | top) - - def self.dump: ( - instance | top value, - state: ModerationAPI::Internal::Type::Converter::dump_state - ) -> (::Hash[top, top] | top) - - def self.to_sorbet_type: -> top - - def self.recursively_to_h: ( - ModerationAPI::Internal::Type::BaseModel model, - convert: bool - ) -> ::Hash[Symbol, top] - - def []: (Symbol key) -> top? - - def to_h: -> ::Hash[Symbol, top] - - alias to_hash to_h - - def deep_to_h: -> ::Hash[Symbol, top] - - def deconstruct_keys: (::Array[Symbol]? keys) -> ::Hash[Symbol, top] - - def to_json: (*top a) -> String - - def to_yaml: (*top a) -> String - - def initialize: (?::Hash[Symbol, top] | instance data) -> void - - def self.inspect: (?depth: Integer) -> String - - def to_s: -> String - - def inspect: -> String - end - end - end -end diff --git a/sig/moderation_api/internal/type/base_page.rbs b/sig/moderation_api/internal/type/base_page.rbs deleted file mode 100644 index bcff6788..00000000 --- a/sig/moderation_api/internal/type/base_page.rbs +++ /dev/null @@ -1,24 +0,0 @@ -module ModerationAPI - module Internal - module Type - module BasePage[Elem] - def next_page?: -> bool - - def next_page: -> instance - - def auto_paging_each: { (Elem arg0) -> void } -> void - - def to_enum: -> Enumerable[Elem] - - alias enum_for to_enum - - def initialize: ( - client: ModerationAPI::Internal::Transport::BaseClient, - req: ModerationAPI::Internal::Transport::BaseClient::request_components, - headers: ::Hash[String, String], - page_data: top - ) -> void - end - end - end -end diff --git a/sig/moderation_api/internal/type/boolean.rbs b/sig/moderation_api/internal/type/boolean.rbs deleted file mode 100644 index 5fa96638..00000000 --- a/sig/moderation_api/internal/type/boolean.rbs +++ /dev/null @@ -1,26 +0,0 @@ -module ModerationAPI - module Internal - module Type - class Boolean - extend ModerationAPI::Internal::Type::Converter - extend ModerationAPI::Internal::Util::SorbetRuntimeSupport - - def self.===: (top other) -> bool - - def self.==: (top other) -> bool - - def self.coerce: ( - bool | top value, - state: ModerationAPI::Internal::Type::Converter::coerce_state - ) -> (bool | top) - - def self.dump: ( - bool | top value, - state: ModerationAPI::Internal::Type::Converter::dump_state - ) -> (bool | top) - - def self.to_sorbet_type: -> top - end - end - end -end diff --git a/sig/moderation_api/internal/type/converter.rbs b/sig/moderation_api/internal/type/converter.rbs deleted file mode 100644 index 6e8c54a1..00000000 --- a/sig/moderation_api/internal/type/converter.rbs +++ /dev/null @@ -1,79 +0,0 @@ -module ModerationAPI - module Internal - module Type - module Converter - extend ModerationAPI::Internal::Util::SorbetRuntimeSupport - - type input = ModerationAPI::Internal::Type::Converter | Class - - type coerce_state = - { - translate_names: bool, - strictness: bool, - exactness: { yes: Integer, no: Integer, maybe: Integer }, - error: Class, - branched: Integer - } - - type dump_state = { can_retry: bool } - - def coerce: ( - top value, - state: ModerationAPI::Internal::Type::Converter::coerce_state - ) -> top - - def dump: ( - top value, - state: ModerationAPI::Internal::Type::Converter::dump_state - ) -> top - - def inspect: (?depth: Integer) -> String - - def self.type_info: ( - { - const: (nil | bool | Integer | Float | Symbol)?, - enum: ^-> ModerationAPI::Internal::Type::Converter::input?, - union: ^-> ModerationAPI::Internal::Type::Converter::input? - } - | ^-> ModerationAPI::Internal::Type::Converter::input - | ModerationAPI::Internal::Type::Converter::input spec - ) -> (^-> top) - - def self.meta_info: ( - { - const: (nil | bool | Integer | Float | Symbol)?, - enum: ^-> ModerationAPI::Internal::Type::Converter::input?, - union: ^-> ModerationAPI::Internal::Type::Converter::input? - } - | ^-> ModerationAPI::Internal::Type::Converter::input - | ModerationAPI::Internal::Type::Converter::input type_info, - { - const: (nil | bool | Integer | Float | Symbol)?, - enum: ^-> ModerationAPI::Internal::Type::Converter::input?, - union: ^-> ModerationAPI::Internal::Type::Converter::input? - } - | ^-> ModerationAPI::Internal::Type::Converter::input - | ModerationAPI::Internal::Type::Converter::input spec - ) -> ::Hash[Symbol, top] - - def self.new_coerce_state: ( - ?translate_names: bool - ) -> ModerationAPI::Internal::Type::Converter::coerce_state - - def self.coerce: ( - ModerationAPI::Internal::Type::Converter::input target, - top value, - ?state: ModerationAPI::Internal::Type::Converter::coerce_state - ) -> top - - def self.dump: ( - ModerationAPI::Internal::Type::Converter::input target, - top value, - ?state: ModerationAPI::Internal::Type::Converter::dump_state - ) -> top - - def self.inspect: (top target, depth: Integer) -> String - end - end - end -end diff --git a/sig/moderation_api/internal/type/enum.rbs b/sig/moderation_api/internal/type/enum.rbs deleted file mode 100644 index e39eaf1f..00000000 --- a/sig/moderation_api/internal/type/enum.rbs +++ /dev/null @@ -1,32 +0,0 @@ -module ModerationAPI - module Internal - module Type - module Enum - include ModerationAPI::Internal::Type::Converter - include ModerationAPI::Internal::Util::SorbetRuntimeSupport - - def self.values: -> ::Array[(nil | bool | Integer | Float | Symbol)] - - def ===: (top other) -> bool - - def ==: (top other) -> bool - - def hash: -> Integer - - def coerce: ( - String | Symbol | top value, - state: ModerationAPI::Internal::Type::Converter::coerce_state - ) -> (Symbol | top) - - def dump: ( - Symbol | top value, - state: ModerationAPI::Internal::Type::Converter::dump_state - ) -> (Symbol | top) - - def to_sorbet_type: -> top - - def inspect: (?depth: Integer) -> String - end - end - end -end diff --git a/sig/moderation_api/internal/type/file_input.rbs b/sig/moderation_api/internal/type/file_input.rbs deleted file mode 100644 index 954080a8..00000000 --- a/sig/moderation_api/internal/type/file_input.rbs +++ /dev/null @@ -1,25 +0,0 @@ -module ModerationAPI - module Internal - module Type - class FileInput - extend ModerationAPI::Internal::Type::Converter - - def self.===: (top other) -> bool - - def self.==: (top other) -> bool - - def self.coerce: ( - StringIO | String | top value, - state: ModerationAPI::Internal::Type::Converter::coerce_state - ) -> (StringIO | top) - - def self.dump: ( - Pathname | StringIO | IO | String | top value, - state: ModerationAPI::Internal::Type::Converter::dump_state - ) -> (Pathname | StringIO | IO | String | top) - - def self.to_sorbet_type: -> top - end - end - end -end diff --git a/sig/moderation_api/internal/type/hash_of.rbs b/sig/moderation_api/internal/type/hash_of.rbs deleted file mode 100644 index 75a6f612..00000000 --- a/sig/moderation_api/internal/type/hash_of.rbs +++ /dev/null @@ -1,48 +0,0 @@ -module ModerationAPI - module Internal - module Type - class HashOf[Elem] - include ModerationAPI::Internal::Type::Converter - include ModerationAPI::Internal::Util::SorbetRuntimeSupport - - def self.[]: ( - ::Hash[Symbol, top] - | ^-> ModerationAPI::Internal::Type::Converter::input - | ModerationAPI::Internal::Type::Converter::input type_info, - ?::Hash[Symbol, top] spec - ) -> instance - - def ===: (top other) -> bool - - def ==: (top other) -> bool - - def hash: -> Integer - - def coerce: ( - ::Hash[top, top] | top value, - state: ModerationAPI::Internal::Type::Converter::coerce_state - ) -> (::Hash[Symbol, top] | top) - - def dump: ( - ::Hash[top, top] | top value, - state: ModerationAPI::Internal::Type::Converter::dump_state - ) -> (::Hash[Symbol, top] | top) - - def to_sorbet_type: -> top - - def item_type: -> Elem - - def nilable?: -> bool - - def initialize: ( - ::Hash[Symbol, top] - | ^-> ModerationAPI::Internal::Type::Converter::input - | ModerationAPI::Internal::Type::Converter::input type_info, - ?::Hash[Symbol, top] spec - ) -> void - - def inspect: (?depth: Integer) -> String - end - end - end -end diff --git a/sig/moderation_api/internal/type/request_parameters.rbs b/sig/moderation_api/internal/type/request_parameters.rbs deleted file mode 100644 index d1d4cfdf..00000000 --- a/sig/moderation_api/internal/type/request_parameters.rbs +++ /dev/null @@ -1,19 +0,0 @@ -module ModerationAPI - module Internal - module Type - type request_parameters = { request_options: ModerationAPI::request_opts } - - module RequestParameters - attr_reader request_options: ModerationAPI::request_opts - - def request_options=: ( - ModerationAPI::request_opts - ) -> ModerationAPI::request_opts - - module Converter - def dump_request: (top params) -> [top, ::Hash[Symbol, top]] - end - end - end - end -end diff --git a/sig/moderation_api/internal/type/union.rbs b/sig/moderation_api/internal/type/union.rbs deleted file mode 100644 index f1040adf..00000000 --- a/sig/moderation_api/internal/type/union.rbs +++ /dev/null @@ -1,52 +0,0 @@ -module ModerationAPI - module Internal - module Type - module Union - include ModerationAPI::Internal::Type::Converter - include ModerationAPI::Internal::Util::SorbetRuntimeSupport - - private def self.known_variants: -> ::Array[[Symbol?, (^-> ModerationAPI::Internal::Type::Converter::input), ::Hash[Symbol, top]]] - - def self.derefed_variants: -> ::Array[[Symbol?, top, ::Hash[Symbol, top]]] - - def self.variants: -> ::Array[top] - - private def self.discriminator: (Symbol property) -> void - - private def self.variant: ( - Symbol - | ::Hash[Symbol, top] - | ^-> ModerationAPI::Internal::Type::Converter::input - | ModerationAPI::Internal::Type::Converter::input key, - ?::Hash[Symbol, top] - | ^-> ModerationAPI::Internal::Type::Converter::input - | ModerationAPI::Internal::Type::Converter::input spec - ) -> void - - private def self.resolve_variant: ( - top value - ) -> ModerationAPI::Internal::Type::Converter::input? - - def ===: (top other) -> bool - - def ==: (top other) -> bool - - def hash: -> Integer - - def coerce: ( - top value, - state: ModerationAPI::Internal::Type::Converter::coerce_state - ) -> top - - def dump: ( - top value, - state: ModerationAPI::Internal::Type::Converter::dump_state - ) -> top - - def to_sorbet_type: -> top - - def inspect: (?depth: Integer) -> String - end - end - end -end diff --git a/sig/moderation_api/internal/type/unknown.rbs b/sig/moderation_api/internal/type/unknown.rbs deleted file mode 100644 index 9bb61caa..00000000 --- a/sig/moderation_api/internal/type/unknown.rbs +++ /dev/null @@ -1,26 +0,0 @@ -module ModerationAPI - module Internal - module Type - class Unknown - extend ModerationAPI::Internal::Type::Converter - extend ModerationAPI::Internal::Util::SorbetRuntimeSupport - - def self.===: (top other) -> bool - - def self.==: (top other) -> bool - - def self.coerce: ( - top value, - state: ModerationAPI::Internal::Type::Converter::coerce_state - ) -> top - - def self.dump: ( - top value, - state: ModerationAPI::Internal::Type::Converter::dump_state - ) -> top - - def self.to_sorbet_type: -> top - end - end - end -end diff --git a/sig/moderation_api/internal/util.rbs b/sig/moderation_api/internal/util.rbs deleted file mode 100644 index 4c8bbf94..00000000 --- a/sig/moderation_api/internal/util.rbs +++ /dev/null @@ -1,199 +0,0 @@ -module ModerationAPI - module Internal - module Util - extend ModerationAPI::Internal::Util::SorbetRuntimeSupport - - def self?.monotonic_secs: -> Float - - def self?.walk_namespaces: ( - Module | Class ns - ) -> Enumerable[(Module | Class)] - - def self?.arch: -> String - - def self?.os: -> String - - def self?.primitive?: (top input) -> bool - - def self?.coerce_boolean: (String | bool input) -> (bool | top) - - def self?.coerce_boolean!: (String | bool input) -> bool? - - def self?.coerce_integer: (String | Integer input) -> (Integer | top) - - def self?.coerce_float: (String | Integer | Float input) -> (Float | top) - - def self?.coerce_hash: (top input) -> (::Hash[top, top] | top) - - def self?.coerce_hash!: (top input) -> ::Hash[top, top]? - - def self?.deep_merge_lr: (top lhs, top rhs, ?concat: bool) -> top - - def self?.deep_merge: ( - *::Array[top] values, - ?sentinel: top?, - ?concat: bool - ) -> top - - def self?.dig: ( - ::Hash[Symbol, top] | ::Array[top] | top data, - (Symbol - | Integer - | ::Array[(Symbol | Integer)] - | (^(top arg0) -> top))? pick - ) { - -> top? - } -> top? - - RFC_3986_NOT_PCHARS: Regexp - - def self?.uri_origin: (URI::Generic uri) -> String - - def self?.encode_path: (String | Integer path) -> String - - def self?.interpolate_path: (String | ::Array[String] path) -> String - - def self?.decode_query: (String? query) -> ::Hash[String, ::Array[String]] - - def self?.encode_query: ( - ::Hash[String, (::Array[String] | String)?]? query - ) -> String? - - type parsed_uri = - { - scheme: String?, - host: String?, - port: Integer?, - path: String?, - query: ::Hash[String, ::Array[String]] - } - - def self?.parse_uri: ( - URI::Generic | String url - ) -> ModerationAPI::Internal::Util::parsed_uri - - def self?.unparse_uri: ( - ModerationAPI::Internal::Util::parsed_uri parsed - ) -> URI::Generic - - def self?.join_parsed_uri: ( - ModerationAPI::Internal::Util::parsed_uri lhs, - ModerationAPI::Internal::Util::parsed_uri rhs - ) -> URI::Generic - - def self?.normalized_headers: ( - *::Hash[String, (String - | Integer - | ::Array[(String | Integer)?])?] headers - ) -> ::Hash[String, String] - - class ReadIOAdapter - def close?: -> bool? - - def close: -> void - - private def read_enum: (Integer? max_len) -> String - - def read: (?Integer? max_len, ?String? out_string) -> String? - - def initialize: ( - String | Pathname | StringIO | Enumerable[String] src - ) { - (String arg0) -> void - } -> void - end - - def self?.writable_enum: { - (Enumerator::Yielder y) -> void - } -> Enumerable[String] - - JSON_CONTENT: Regexp - JSONL_CONTENT: Regexp - - def encode_query_params: ( - ::Hash[Symbol, top] query - ) -> ::Hash[Symbol, top] - - private def write_query_param_element!: ( - ::Hash[Symbol, top] collection, - String key, - top element - ) -> nil - - def self?.write_multipart_content: ( - Enumerator::Yielder y, - val: top, - closing: ::Array[^-> void], - ?content_type: String? - ) -> void - - def self?.write_multipart_chunk: ( - Enumerator::Yielder y, - boundary: String, - key: Symbol | String, - val: top, - closing: ::Array[^-> void] - ) -> void - - def self?.encode_multipart_streaming: ( - top body - ) -> [String, Enumerable[String]] - - def self?.encode_content: ( - ::Hash[String, String] headers, - top body - ) -> top - - def self?.force_charset!: (String content_type, text: String) -> void - - def self?.decode_content: ( - ::Hash[String, String] headers, - stream: Enumerable[String], - ?suppress_error: bool - ) -> top - - def self?.fused_enum: ( - Enumerable[top] enum, - ?external: bool - ) { - -> void - } -> Enumerable[top] - - def self?.close_fused!: (Enumerable[top]? enum) -> void - - def self?.chain_fused: ( - Enumerable[top]? enum - ) { - (Enumerator::Yielder arg0) -> void - } -> Enumerable[top] - - type server_sent_event = - { event: String?, data: String?, id: String?, retry: Integer? } - - def self?.decode_lines: (Enumerable[String] enum) -> Enumerable[String] - - def self?.decode_sse: ( - Enumerable[String] lines - ) -> Enumerable[ModerationAPI::Internal::Util::server_sent_event] - - module SorbetRuntimeSupport - class MissingSorbetRuntimeError < ::RuntimeError - end - - private def sorbet_runtime_constants: -> ::Hash[Symbol, top] - - def const_missing: (Symbol name) -> void - - def sorbet_constant_defined?: (Symbol name) -> bool - - def define_sorbet_constant!: (Symbol name) { -> top } -> void - - def to_sorbet_type: -> top - - def self.to_sorbet_type: ( - ModerationAPI::Internal::Util::SorbetRuntimeSupport | top `type` - ) -> top - end - end - end -end diff --git a/sig/moderation_api/models.rbs b/sig/moderation_api/models.rbs deleted file mode 100644 index 9b7e2be8..00000000 --- a/sig/moderation_api/models.rbs +++ /dev/null @@ -1,63 +0,0 @@ -module ModerationAPI - class AccountListParams = ModerationAPI::Models::AccountListParams - - class ActionCreateParams = ModerationAPI::Models::ActionCreateParams - - class ActionDeleteParams = ModerationAPI::Models::ActionDeleteParams - - class ActionListParams = ModerationAPI::Models::ActionListParams - - class ActionRetrieveParams = ModerationAPI::Models::ActionRetrieveParams - - module Actions = ModerationAPI::Models::Actions - - class ActionUpdateParams = ModerationAPI::Models::ActionUpdateParams - - class AuthCreateParams = ModerationAPI::Models::AuthCreateParams - - class AuthorCreateParams = ModerationAPI::Models::AuthorCreateParams - - class AuthorDeleteParams = ModerationAPI::Models::AuthorDeleteParams - - class AuthorListParams = ModerationAPI::Models::AuthorListParams - - class AuthorRetrieveParams = ModerationAPI::Models::AuthorRetrieveParams - - class AuthorUpdateParams = ModerationAPI::Models::AuthorUpdateParams - - class AuthRetrieveParams = ModerationAPI::Models::AuthRetrieveParams - - class ContentStreamParams = ModerationAPI::Models::ContentStreamParams - - class ContentSubmitParams = ModerationAPI::Models::ContentSubmitParams - - module Queue = ModerationAPI::Models::Queue - - class QueueGetStatsParams = ModerationAPI::Models::QueueGetStatsParams - - class QueueRetrieveParams = ModerationAPI::Models::QueueRetrieveParams - - class WebhookCreateParams = ModerationAPI::Models::WebhookCreateParams - - class WebhookDeleteParams = ModerationAPI::Models::WebhookDeleteParams - - module WebhookEvent = ModerationAPI::Models::WebhookEvent - - class WebhookListParams = ModerationAPI::Models::WebhookListParams - - class WebhookRetrieveParams = ModerationAPI::Models::WebhookRetrieveParams - - class WebhookSecretRetrieveParams = ModerationAPI::Models::WebhookSecretRetrieveParams - - class WebhookUpdateParams = ModerationAPI::Models::WebhookUpdateParams - - module Wordlist = ModerationAPI::Models::Wordlist - - class WordlistGetEmbeddingStatusParams = ModerationAPI::Models::WordlistGetEmbeddingStatusParams - - class WordlistListParams = ModerationAPI::Models::WordlistListParams - - class WordlistRetrieveParams = ModerationAPI::Models::WordlistRetrieveParams - - class WordlistUpdateParams = ModerationAPI::Models::WordlistUpdateParams -end diff --git a/sig/moderation_api/models/account_list_params.rbs b/sig/moderation_api/models/account_list_params.rbs deleted file mode 100644 index 34d2e3ba..00000000 --- a/sig/moderation_api/models/account_list_params.rbs +++ /dev/null @@ -1,15 +0,0 @@ -module ModerationAPI - module Models - type account_list_params = - { } & ModerationAPI::Internal::Type::request_parameters - - class AccountListParams < ModerationAPI::Internal::Type::BaseModel - extend ModerationAPI::Internal::Type::RequestParameters::Converter - include ModerationAPI::Internal::Type::RequestParameters - - def initialize: (?request_options: ModerationAPI::request_opts) -> void - - def to_hash: -> { request_options: ModerationAPI::RequestOptions } - end - end -end diff --git a/sig/moderation_api/models/account_list_response.rbs b/sig/moderation_api/models/account_list_response.rbs deleted file mode 100644 index 71391b11..00000000 --- a/sig/moderation_api/models/account_list_response.rbs +++ /dev/null @@ -1,56 +0,0 @@ -module ModerationAPI - module Models - type account_list_response = - { - id: String, - paid_plan_name: String, - remaining_quota: Float, - text_api_quota: Float, - current_project: ModerationAPI::Models::AccountListResponse::CurrentProject - } - - class AccountListResponse < ModerationAPI::Internal::Type::BaseModel - attr_accessor id: String - - attr_accessor paid_plan_name: String - - attr_accessor remaining_quota: Float - - attr_accessor text_api_quota: Float - - attr_reader current_project: ModerationAPI::Models::AccountListResponse::CurrentProject? - - def current_project=: ( - ModerationAPI::Models::AccountListResponse::CurrentProject - ) -> ModerationAPI::Models::AccountListResponse::CurrentProject - - def initialize: ( - id: String, - paid_plan_name: String, - remaining_quota: Float, - text_api_quota: Float, - ?current_project: ModerationAPI::Models::AccountListResponse::CurrentProject - ) -> void - - def to_hash: -> { - id: String, - paid_plan_name: String, - remaining_quota: Float, - text_api_quota: Float, - current_project: ModerationAPI::Models::AccountListResponse::CurrentProject - } - - type current_project = { id: String, name: String } - - class CurrentProject < ModerationAPI::Internal::Type::BaseModel - attr_accessor id: String - - attr_accessor name: String - - def initialize: (id: String, name: String) -> void - - def to_hash: -> { id: String, name: String } - end - end - end -end diff --git a/sig/moderation_api/models/action_create_params.rbs b/sig/moderation_api/models/action_create_params.rbs deleted file mode 100644 index 780c1b47..00000000 --- a/sig/moderation_api/models/action_create_params.rbs +++ /dev/null @@ -1,157 +0,0 @@ -module ModerationAPI - module Models - type action_create_params = - { - name: String, - built_in: bool?, - description: String?, - filter_in_queue_ids: ::Array[String], - free_text: bool, - key: String?, - position: ModerationAPI::Models::ActionCreateParams::position, - possible_values: ::Array[ModerationAPI::ActionCreateParams::PossibleValue], - queue_behaviour: ModerationAPI::Models::ActionCreateParams::queue_behaviour, - type: ModerationAPI::Models::ActionCreateParams::type_?, - value_required: bool - } - & ModerationAPI::Internal::Type::request_parameters - - class ActionCreateParams < ModerationAPI::Internal::Type::BaseModel - extend ModerationAPI::Internal::Type::RequestParameters::Converter - include ModerationAPI::Internal::Type::RequestParameters - - attr_accessor name: String - - attr_accessor built_in: bool? - - attr_accessor description: String? - - attr_reader filter_in_queue_ids: ::Array[String]? - - def filter_in_queue_ids=: (::Array[String]) -> ::Array[String] - - attr_reader free_text: bool? - - def free_text=: (bool) -> bool - - attr_accessor key: String? - - attr_reader position: ModerationAPI::Models::ActionCreateParams::position? - - def position=: ( - ModerationAPI::Models::ActionCreateParams::position - ) -> ModerationAPI::Models::ActionCreateParams::position - - attr_reader possible_values: ::Array[ModerationAPI::ActionCreateParams::PossibleValue]? - - def possible_values=: ( - ::Array[ModerationAPI::ActionCreateParams::PossibleValue] - ) -> ::Array[ModerationAPI::ActionCreateParams::PossibleValue] - - attr_reader queue_behaviour: ModerationAPI::Models::ActionCreateParams::queue_behaviour? - - def queue_behaviour=: ( - ModerationAPI::Models::ActionCreateParams::queue_behaviour - ) -> ModerationAPI::Models::ActionCreateParams::queue_behaviour - - attr_accessor type: ModerationAPI::Models::ActionCreateParams::type_? - - attr_reader value_required: bool? - - def value_required=: (bool) -> bool - - def initialize: ( - name: String, - ?built_in: bool?, - ?description: String?, - ?filter_in_queue_ids: ::Array[String], - ?free_text: bool, - ?key: String?, - ?position: ModerationAPI::Models::ActionCreateParams::position, - ?possible_values: ::Array[ModerationAPI::ActionCreateParams::PossibleValue], - ?queue_behaviour: ModerationAPI::Models::ActionCreateParams::queue_behaviour, - ?type: ModerationAPI::Models::ActionCreateParams::type_?, - ?value_required: bool, - ?request_options: ModerationAPI::request_opts - ) -> void - - def to_hash: -> { - name: String, - built_in: bool?, - description: String?, - filter_in_queue_ids: ::Array[String], - free_text: bool, - key: String?, - position: ModerationAPI::Models::ActionCreateParams::position, - possible_values: ::Array[ModerationAPI::ActionCreateParams::PossibleValue], - queue_behaviour: ModerationAPI::Models::ActionCreateParams::queue_behaviour, - type: ModerationAPI::Models::ActionCreateParams::type_?, - value_required: bool, - request_options: ModerationAPI::RequestOptions - } - - type position = :ALL_QUEUES | :SOME_QUEUES | :HIDDEN - - module Position - extend ModerationAPI::Internal::Type::Enum - - ALL_QUEUES: :ALL_QUEUES - SOME_QUEUES: :SOME_QUEUES - HIDDEN: :HIDDEN - - def self?.values: -> ::Array[ModerationAPI::Models::ActionCreateParams::position] - end - - type possible_value = { value: String } - - class PossibleValue < ModerationAPI::Internal::Type::BaseModel - attr_accessor value: String - - def initialize: (value: String) -> void - - def to_hash: -> { value: String } - end - - type queue_behaviour = :REMOVE | :ADD | :NO_CHANGE - - module QueueBehaviour - extend ModerationAPI::Internal::Type::Enum - - REMOVE: :REMOVE - ADD: :ADD - NO_CHANGE: :NO_CHANGE - - def self?.values: -> ::Array[ModerationAPI::Models::ActionCreateParams::queue_behaviour] - end - - type type_ = - :AUTHOR_BLOCK - | :AUTHOR_BLOCK_TEMP - | :AUTHOR_UNBLOCK - | :AUTHOR_DELETE - | :AUTHOR_REPORT - | :AUTHOR_WARN - | :AUTHOR_CUSTOM - | :ITEM_REJECT - | :ITEM_ALLOW - | :ITEM_CUSTOM - - module Type - extend ModerationAPI::Internal::Type::Enum - - AUTHOR_BLOCK: :AUTHOR_BLOCK - AUTHOR_BLOCK_TEMP: :AUTHOR_BLOCK_TEMP - AUTHOR_UNBLOCK: :AUTHOR_UNBLOCK - AUTHOR_DELETE: :AUTHOR_DELETE - AUTHOR_REPORT: :AUTHOR_REPORT - AUTHOR_WARN: :AUTHOR_WARN - AUTHOR_CUSTOM: :AUTHOR_CUSTOM - ITEM_REJECT: :ITEM_REJECT - ITEM_ALLOW: :ITEM_ALLOW - ITEM_CUSTOM: :ITEM_CUSTOM - - def self?.values: -> ::Array[ModerationAPI::Models::ActionCreateParams::type_] - end - end - end -end diff --git a/sig/moderation_api/models/action_create_response.rbs b/sig/moderation_api/models/action_create_response.rbs deleted file mode 100644 index 63908718..00000000 --- a/sig/moderation_api/models/action_create_response.rbs +++ /dev/null @@ -1,143 +0,0 @@ -module ModerationAPI - module Models - type action_create_response = - { - id: String, - built_in: bool?, - created_at: String, - filter_in_queue_ids: ::Array[String], - free_text: bool, - name: String, - position: ModerationAPI::Models::ActionCreateResponse::position, - possible_values: ::Array[ModerationAPI::Models::ActionCreateResponse::PossibleValue], - queue_behaviour: ModerationAPI::Models::ActionCreateResponse::queue_behaviour, - value_required: bool, - description: String?, - key: String?, - type: ModerationAPI::Models::ActionCreateResponse::type_? - } - - class ActionCreateResponse < ModerationAPI::Internal::Type::BaseModel - attr_accessor id: String - - attr_accessor built_in: bool? - - attr_accessor created_at: String - - attr_accessor filter_in_queue_ids: ::Array[String] - - attr_accessor free_text: bool - - attr_accessor name: String - - attr_accessor position: ModerationAPI::Models::ActionCreateResponse::position - - attr_accessor possible_values: ::Array[ModerationAPI::Models::ActionCreateResponse::PossibleValue] - - attr_accessor queue_behaviour: ModerationAPI::Models::ActionCreateResponse::queue_behaviour - - attr_accessor value_required: bool - - attr_accessor description: String? - - attr_accessor key: String? - - attr_accessor type: ModerationAPI::Models::ActionCreateResponse::type_? - - def initialize: ( - id: String, - built_in: bool?, - created_at: String, - filter_in_queue_ids: ::Array[String], - free_text: bool, - name: String, - position: ModerationAPI::Models::ActionCreateResponse::position, - possible_values: ::Array[ModerationAPI::Models::ActionCreateResponse::PossibleValue], - queue_behaviour: ModerationAPI::Models::ActionCreateResponse::queue_behaviour, - value_required: bool, - ?description: String?, - ?key: String?, - ?type: ModerationAPI::Models::ActionCreateResponse::type_? - ) -> void - - def to_hash: -> { - id: String, - built_in: bool?, - created_at: String, - filter_in_queue_ids: ::Array[String], - free_text: bool, - name: String, - position: ModerationAPI::Models::ActionCreateResponse::position, - possible_values: ::Array[ModerationAPI::Models::ActionCreateResponse::PossibleValue], - queue_behaviour: ModerationAPI::Models::ActionCreateResponse::queue_behaviour, - value_required: bool, - description: String?, - key: String?, - type: ModerationAPI::Models::ActionCreateResponse::type_? - } - - type position = :ALL_QUEUES | :SOME_QUEUES | :HIDDEN - - module Position - extend ModerationAPI::Internal::Type::Enum - - ALL_QUEUES: :ALL_QUEUES - SOME_QUEUES: :SOME_QUEUES - HIDDEN: :HIDDEN - - def self?.values: -> ::Array[ModerationAPI::Models::ActionCreateResponse::position] - end - - type possible_value = { value: String } - - class PossibleValue < ModerationAPI::Internal::Type::BaseModel - attr_accessor value: String - - def initialize: (value: String) -> void - - def to_hash: -> { value: String } - end - - type queue_behaviour = :REMOVE | :ADD | :NO_CHANGE - - module QueueBehaviour - extend ModerationAPI::Internal::Type::Enum - - REMOVE: :REMOVE - ADD: :ADD - NO_CHANGE: :NO_CHANGE - - def self?.values: -> ::Array[ModerationAPI::Models::ActionCreateResponse::queue_behaviour] - end - - type type_ = - :AUTHOR_BLOCK - | :AUTHOR_BLOCK_TEMP - | :AUTHOR_UNBLOCK - | :AUTHOR_DELETE - | :AUTHOR_REPORT - | :AUTHOR_WARN - | :AUTHOR_CUSTOM - | :ITEM_REJECT - | :ITEM_ALLOW - | :ITEM_CUSTOM - - module Type - extend ModerationAPI::Internal::Type::Enum - - AUTHOR_BLOCK: :AUTHOR_BLOCK - AUTHOR_BLOCK_TEMP: :AUTHOR_BLOCK_TEMP - AUTHOR_UNBLOCK: :AUTHOR_UNBLOCK - AUTHOR_DELETE: :AUTHOR_DELETE - AUTHOR_REPORT: :AUTHOR_REPORT - AUTHOR_WARN: :AUTHOR_WARN - AUTHOR_CUSTOM: :AUTHOR_CUSTOM - ITEM_REJECT: :ITEM_REJECT - ITEM_ALLOW: :ITEM_ALLOW - ITEM_CUSTOM: :ITEM_CUSTOM - - def self?.values: -> ::Array[ModerationAPI::Models::ActionCreateResponse::type_] - end - end - end -end diff --git a/sig/moderation_api/models/action_delete_params.rbs b/sig/moderation_api/models/action_delete_params.rbs deleted file mode 100644 index 414de0a8..00000000 --- a/sig/moderation_api/models/action_delete_params.rbs +++ /dev/null @@ -1,23 +0,0 @@ -module ModerationAPI - module Models - type action_delete_params = - { id: String } & ModerationAPI::Internal::Type::request_parameters - - class ActionDeleteParams < ModerationAPI::Internal::Type::BaseModel - extend ModerationAPI::Internal::Type::RequestParameters::Converter - include ModerationAPI::Internal::Type::RequestParameters - - attr_accessor id: String - - def initialize: ( - id: String, - ?request_options: ModerationAPI::request_opts - ) -> void - - def to_hash: -> { - id: String, - request_options: ModerationAPI::RequestOptions - } - end - end -end diff --git a/sig/moderation_api/models/action_delete_response.rbs b/sig/moderation_api/models/action_delete_response.rbs deleted file mode 100644 index 7a8725a7..00000000 --- a/sig/moderation_api/models/action_delete_response.rbs +++ /dev/null @@ -1,15 +0,0 @@ -module ModerationAPI - module Models - type action_delete_response = { id: String, deleted: bool } - - class ActionDeleteResponse < ModerationAPI::Internal::Type::BaseModel - attr_accessor id: String - - attr_accessor deleted: bool - - def initialize: (id: String, deleted: bool) -> void - - def to_hash: -> { id: String, deleted: bool } - end - end -end diff --git a/sig/moderation_api/models/action_list_params.rbs b/sig/moderation_api/models/action_list_params.rbs deleted file mode 100644 index 77bbf2d9..00000000 --- a/sig/moderation_api/models/action_list_params.rbs +++ /dev/null @@ -1,25 +0,0 @@ -module ModerationAPI - module Models - type action_list_params = - { queue_id: String } & ModerationAPI::Internal::Type::request_parameters - - class ActionListParams < ModerationAPI::Internal::Type::BaseModel - extend ModerationAPI::Internal::Type::RequestParameters::Converter - include ModerationAPI::Internal::Type::RequestParameters - - attr_reader queue_id: String? - - def queue_id=: (String) -> String - - def initialize: ( - ?queue_id: String, - ?request_options: ModerationAPI::request_opts - ) -> void - - def to_hash: -> { - queue_id: String, - request_options: ModerationAPI::RequestOptions - } - end - end -end diff --git a/sig/moderation_api/models/action_list_response.rbs b/sig/moderation_api/models/action_list_response.rbs deleted file mode 100644 index 12aef8df..00000000 --- a/sig/moderation_api/models/action_list_response.rbs +++ /dev/null @@ -1,148 +0,0 @@ -module ModerationAPI - module Models - type action_list_response_item = - { - id: String, - built_in: bool?, - created_at: String, - filter_in_queue_ids: ::Array[String], - free_text: bool, - name: String, - position: ModerationAPI::Models::ActionListResponseItem::position, - possible_values: ::Array[ModerationAPI::Models::ActionListResponseItem::PossibleValue], - queue_behaviour: ModerationAPI::Models::ActionListResponseItem::queue_behaviour, - value_required: bool, - description: String?, - key: String?, - type: ModerationAPI::Models::ActionListResponseItem::type_? - } - - class ActionListResponseItem < ModerationAPI::Internal::Type::BaseModel - attr_accessor id: String - - attr_accessor built_in: bool? - - attr_accessor created_at: String - - attr_accessor filter_in_queue_ids: ::Array[String] - - attr_accessor free_text: bool - - attr_accessor name: String - - attr_accessor position: ModerationAPI::Models::ActionListResponseItem::position - - attr_accessor possible_values: ::Array[ModerationAPI::Models::ActionListResponseItem::PossibleValue] - - attr_accessor queue_behaviour: ModerationAPI::Models::ActionListResponseItem::queue_behaviour - - attr_accessor value_required: bool - - attr_accessor description: String? - - attr_accessor key: String? - - attr_accessor type: ModerationAPI::Models::ActionListResponseItem::type_? - - def initialize: ( - id: String, - built_in: bool?, - created_at: String, - filter_in_queue_ids: ::Array[String], - free_text: bool, - name: String, - position: ModerationAPI::Models::ActionListResponseItem::position, - possible_values: ::Array[ModerationAPI::Models::ActionListResponseItem::PossibleValue], - queue_behaviour: ModerationAPI::Models::ActionListResponseItem::queue_behaviour, - value_required: bool, - ?description: String?, - ?key: String?, - ?type: ModerationAPI::Models::ActionListResponseItem::type_? - ) -> void - - def to_hash: -> { - id: String, - built_in: bool?, - created_at: String, - filter_in_queue_ids: ::Array[String], - free_text: bool, - name: String, - position: ModerationAPI::Models::ActionListResponseItem::position, - possible_values: ::Array[ModerationAPI::Models::ActionListResponseItem::PossibleValue], - queue_behaviour: ModerationAPI::Models::ActionListResponseItem::queue_behaviour, - value_required: bool, - description: String?, - key: String?, - type: ModerationAPI::Models::ActionListResponseItem::type_? - } - - type position = :ALL_QUEUES | :SOME_QUEUES | :HIDDEN - - module Position - extend ModerationAPI::Internal::Type::Enum - - ALL_QUEUES: :ALL_QUEUES - SOME_QUEUES: :SOME_QUEUES - HIDDEN: :HIDDEN - - def self?.values: -> ::Array[ModerationAPI::Models::ActionListResponseItem::position] - end - - type possible_value = { value: String } - - class PossibleValue < ModerationAPI::Internal::Type::BaseModel - attr_accessor value: String - - def initialize: (value: String) -> void - - def to_hash: -> { value: String } - end - - type queue_behaviour = :REMOVE | :ADD | :NO_CHANGE - - module QueueBehaviour - extend ModerationAPI::Internal::Type::Enum - - REMOVE: :REMOVE - ADD: :ADD - NO_CHANGE: :NO_CHANGE - - def self?.values: -> ::Array[ModerationAPI::Models::ActionListResponseItem::queue_behaviour] - end - - type type_ = - :AUTHOR_BLOCK - | :AUTHOR_BLOCK_TEMP - | :AUTHOR_UNBLOCK - | :AUTHOR_DELETE - | :AUTHOR_REPORT - | :AUTHOR_WARN - | :AUTHOR_CUSTOM - | :ITEM_REJECT - | :ITEM_ALLOW - | :ITEM_CUSTOM - - module Type - extend ModerationAPI::Internal::Type::Enum - - AUTHOR_BLOCK: :AUTHOR_BLOCK - AUTHOR_BLOCK_TEMP: :AUTHOR_BLOCK_TEMP - AUTHOR_UNBLOCK: :AUTHOR_UNBLOCK - AUTHOR_DELETE: :AUTHOR_DELETE - AUTHOR_REPORT: :AUTHOR_REPORT - AUTHOR_WARN: :AUTHOR_WARN - AUTHOR_CUSTOM: :AUTHOR_CUSTOM - ITEM_REJECT: :ITEM_REJECT - ITEM_ALLOW: :ITEM_ALLOW - ITEM_CUSTOM: :ITEM_CUSTOM - - def self?.values: -> ::Array[ModerationAPI::Models::ActionListResponseItem::type_] - end - end - - type action_list_response = - ::Array[ModerationAPI::Models::ActionListResponseItem] - - ActionListResponse: ModerationAPI::Internal::Type::Converter - end -end diff --git a/sig/moderation_api/models/action_retrieve_params.rbs b/sig/moderation_api/models/action_retrieve_params.rbs deleted file mode 100644 index 23239649..00000000 --- a/sig/moderation_api/models/action_retrieve_params.rbs +++ /dev/null @@ -1,23 +0,0 @@ -module ModerationAPI - module Models - type action_retrieve_params = - { id: String } & ModerationAPI::Internal::Type::request_parameters - - class ActionRetrieveParams < ModerationAPI::Internal::Type::BaseModel - extend ModerationAPI::Internal::Type::RequestParameters::Converter - include ModerationAPI::Internal::Type::RequestParameters - - attr_accessor id: String - - def initialize: ( - id: String, - ?request_options: ModerationAPI::request_opts - ) -> void - - def to_hash: -> { - id: String, - request_options: ModerationAPI::RequestOptions - } - end - end -end diff --git a/sig/moderation_api/models/action_retrieve_response.rbs b/sig/moderation_api/models/action_retrieve_response.rbs deleted file mode 100644 index fd680971..00000000 --- a/sig/moderation_api/models/action_retrieve_response.rbs +++ /dev/null @@ -1,143 +0,0 @@ -module ModerationAPI - module Models - type action_retrieve_response = - { - id: String, - built_in: bool?, - created_at: String, - filter_in_queue_ids: ::Array[String], - free_text: bool, - name: String, - position: ModerationAPI::Models::ActionRetrieveResponse::position, - possible_values: ::Array[ModerationAPI::Models::ActionRetrieveResponse::PossibleValue], - queue_behaviour: ModerationAPI::Models::ActionRetrieveResponse::queue_behaviour, - value_required: bool, - description: String?, - key: String?, - type: ModerationAPI::Models::ActionRetrieveResponse::type_? - } - - class ActionRetrieveResponse < ModerationAPI::Internal::Type::BaseModel - attr_accessor id: String - - attr_accessor built_in: bool? - - attr_accessor created_at: String - - attr_accessor filter_in_queue_ids: ::Array[String] - - attr_accessor free_text: bool - - attr_accessor name: String - - attr_accessor position: ModerationAPI::Models::ActionRetrieveResponse::position - - attr_accessor possible_values: ::Array[ModerationAPI::Models::ActionRetrieveResponse::PossibleValue] - - attr_accessor queue_behaviour: ModerationAPI::Models::ActionRetrieveResponse::queue_behaviour - - attr_accessor value_required: bool - - attr_accessor description: String? - - attr_accessor key: String? - - attr_accessor type: ModerationAPI::Models::ActionRetrieveResponse::type_? - - def initialize: ( - id: String, - built_in: bool?, - created_at: String, - filter_in_queue_ids: ::Array[String], - free_text: bool, - name: String, - position: ModerationAPI::Models::ActionRetrieveResponse::position, - possible_values: ::Array[ModerationAPI::Models::ActionRetrieveResponse::PossibleValue], - queue_behaviour: ModerationAPI::Models::ActionRetrieveResponse::queue_behaviour, - value_required: bool, - ?description: String?, - ?key: String?, - ?type: ModerationAPI::Models::ActionRetrieveResponse::type_? - ) -> void - - def to_hash: -> { - id: String, - built_in: bool?, - created_at: String, - filter_in_queue_ids: ::Array[String], - free_text: bool, - name: String, - position: ModerationAPI::Models::ActionRetrieveResponse::position, - possible_values: ::Array[ModerationAPI::Models::ActionRetrieveResponse::PossibleValue], - queue_behaviour: ModerationAPI::Models::ActionRetrieveResponse::queue_behaviour, - value_required: bool, - description: String?, - key: String?, - type: ModerationAPI::Models::ActionRetrieveResponse::type_? - } - - type position = :ALL_QUEUES | :SOME_QUEUES | :HIDDEN - - module Position - extend ModerationAPI::Internal::Type::Enum - - ALL_QUEUES: :ALL_QUEUES - SOME_QUEUES: :SOME_QUEUES - HIDDEN: :HIDDEN - - def self?.values: -> ::Array[ModerationAPI::Models::ActionRetrieveResponse::position] - end - - type possible_value = { value: String } - - class PossibleValue < ModerationAPI::Internal::Type::BaseModel - attr_accessor value: String - - def initialize: (value: String) -> void - - def to_hash: -> { value: String } - end - - type queue_behaviour = :REMOVE | :ADD | :NO_CHANGE - - module QueueBehaviour - extend ModerationAPI::Internal::Type::Enum - - REMOVE: :REMOVE - ADD: :ADD - NO_CHANGE: :NO_CHANGE - - def self?.values: -> ::Array[ModerationAPI::Models::ActionRetrieveResponse::queue_behaviour] - end - - type type_ = - :AUTHOR_BLOCK - | :AUTHOR_BLOCK_TEMP - | :AUTHOR_UNBLOCK - | :AUTHOR_DELETE - | :AUTHOR_REPORT - | :AUTHOR_WARN - | :AUTHOR_CUSTOM - | :ITEM_REJECT - | :ITEM_ALLOW - | :ITEM_CUSTOM - - module Type - extend ModerationAPI::Internal::Type::Enum - - AUTHOR_BLOCK: :AUTHOR_BLOCK - AUTHOR_BLOCK_TEMP: :AUTHOR_BLOCK_TEMP - AUTHOR_UNBLOCK: :AUTHOR_UNBLOCK - AUTHOR_DELETE: :AUTHOR_DELETE - AUTHOR_REPORT: :AUTHOR_REPORT - AUTHOR_WARN: :AUTHOR_WARN - AUTHOR_CUSTOM: :AUTHOR_CUSTOM - ITEM_REJECT: :ITEM_REJECT - ITEM_ALLOW: :ITEM_ALLOW - ITEM_CUSTOM: :ITEM_CUSTOM - - def self?.values: -> ::Array[ModerationAPI::Models::ActionRetrieveResponse::type_] - end - end - end -end diff --git a/sig/moderation_api/models/action_update_params.rbs b/sig/moderation_api/models/action_update_params.rbs deleted file mode 100644 index 2503b037..00000000 --- a/sig/moderation_api/models/action_update_params.rbs +++ /dev/null @@ -1,164 +0,0 @@ -module ModerationAPI - module Models - type action_update_params = - { - id: String, - built_in: bool?, - description: String?, - filter_in_queue_ids: ::Array[String], - free_text: bool, - key: String?, - name: String, - position: ModerationAPI::Models::ActionUpdateParams::position, - possible_values: ::Array[ModerationAPI::ActionUpdateParams::PossibleValue], - queue_behaviour: ModerationAPI::Models::ActionUpdateParams::queue_behaviour, - type: ModerationAPI::Models::ActionUpdateParams::type_?, - value_required: bool - } - & ModerationAPI::Internal::Type::request_parameters - - class ActionUpdateParams < ModerationAPI::Internal::Type::BaseModel - extend ModerationAPI::Internal::Type::RequestParameters::Converter - include ModerationAPI::Internal::Type::RequestParameters - - attr_accessor id: String - - attr_accessor built_in: bool? - - attr_accessor description: String? - - attr_reader filter_in_queue_ids: ::Array[String]? - - def filter_in_queue_ids=: (::Array[String]) -> ::Array[String] - - attr_reader free_text: bool? - - def free_text=: (bool) -> bool - - attr_accessor key: String? - - attr_reader name: String? - - def name=: (String) -> String - - attr_reader position: ModerationAPI::Models::ActionUpdateParams::position? - - def position=: ( - ModerationAPI::Models::ActionUpdateParams::position - ) -> ModerationAPI::Models::ActionUpdateParams::position - - attr_reader possible_values: ::Array[ModerationAPI::ActionUpdateParams::PossibleValue]? - - def possible_values=: ( - ::Array[ModerationAPI::ActionUpdateParams::PossibleValue] - ) -> ::Array[ModerationAPI::ActionUpdateParams::PossibleValue] - - attr_reader queue_behaviour: ModerationAPI::Models::ActionUpdateParams::queue_behaviour? - - def queue_behaviour=: ( - ModerationAPI::Models::ActionUpdateParams::queue_behaviour - ) -> ModerationAPI::Models::ActionUpdateParams::queue_behaviour - - attr_accessor type: ModerationAPI::Models::ActionUpdateParams::type_? - - attr_reader value_required: bool? - - def value_required=: (bool) -> bool - - def initialize: ( - id: String, - ?built_in: bool?, - ?description: String?, - ?filter_in_queue_ids: ::Array[String], - ?free_text: bool, - ?key: String?, - ?name: String, - ?position: ModerationAPI::Models::ActionUpdateParams::position, - ?possible_values: ::Array[ModerationAPI::ActionUpdateParams::PossibleValue], - ?queue_behaviour: ModerationAPI::Models::ActionUpdateParams::queue_behaviour, - ?type: ModerationAPI::Models::ActionUpdateParams::type_?, - ?value_required: bool, - ?request_options: ModerationAPI::request_opts - ) -> void - - def to_hash: -> { - id: String, - built_in: bool?, - description: String?, - filter_in_queue_ids: ::Array[String], - free_text: bool, - key: String?, - name: String, - position: ModerationAPI::Models::ActionUpdateParams::position, - possible_values: ::Array[ModerationAPI::ActionUpdateParams::PossibleValue], - queue_behaviour: ModerationAPI::Models::ActionUpdateParams::queue_behaviour, - type: ModerationAPI::Models::ActionUpdateParams::type_?, - value_required: bool, - request_options: ModerationAPI::RequestOptions - } - - type position = :ALL_QUEUES | :SOME_QUEUES | :HIDDEN - - module Position - extend ModerationAPI::Internal::Type::Enum - - ALL_QUEUES: :ALL_QUEUES - SOME_QUEUES: :SOME_QUEUES - HIDDEN: :HIDDEN - - def self?.values: -> ::Array[ModerationAPI::Models::ActionUpdateParams::position] - end - - type possible_value = { value: String } - - class PossibleValue < ModerationAPI::Internal::Type::BaseModel - attr_accessor value: String - - def initialize: (value: String) -> void - - def to_hash: -> { value: String } - end - - type queue_behaviour = :REMOVE | :ADD | :NO_CHANGE - - module QueueBehaviour - extend ModerationAPI::Internal::Type::Enum - - REMOVE: :REMOVE - ADD: :ADD - NO_CHANGE: :NO_CHANGE - - def self?.values: -> ::Array[ModerationAPI::Models::ActionUpdateParams::queue_behaviour] - end - - type type_ = - :AUTHOR_BLOCK - | :AUTHOR_BLOCK_TEMP - | :AUTHOR_UNBLOCK - | :AUTHOR_DELETE - | :AUTHOR_REPORT - | :AUTHOR_WARN - | :AUTHOR_CUSTOM - | :ITEM_REJECT - | :ITEM_ALLOW - | :ITEM_CUSTOM - - module Type - extend ModerationAPI::Internal::Type::Enum - - AUTHOR_BLOCK: :AUTHOR_BLOCK - AUTHOR_BLOCK_TEMP: :AUTHOR_BLOCK_TEMP - AUTHOR_UNBLOCK: :AUTHOR_UNBLOCK - AUTHOR_DELETE: :AUTHOR_DELETE - AUTHOR_REPORT: :AUTHOR_REPORT - AUTHOR_WARN: :AUTHOR_WARN - AUTHOR_CUSTOM: :AUTHOR_CUSTOM - ITEM_REJECT: :ITEM_REJECT - ITEM_ALLOW: :ITEM_ALLOW - ITEM_CUSTOM: :ITEM_CUSTOM - - def self?.values: -> ::Array[ModerationAPI::Models::ActionUpdateParams::type_] - end - end - end -end diff --git a/sig/moderation_api/models/action_update_response.rbs b/sig/moderation_api/models/action_update_response.rbs deleted file mode 100644 index e451e50e..00000000 --- a/sig/moderation_api/models/action_update_response.rbs +++ /dev/null @@ -1,143 +0,0 @@ -module ModerationAPI - module Models - type action_update_response = - { - id: String, - built_in: bool?, - created_at: String, - filter_in_queue_ids: ::Array[String], - free_text: bool, - name: String, - position: ModerationAPI::Models::ActionUpdateResponse::position, - possible_values: ::Array[ModerationAPI::Models::ActionUpdateResponse::PossibleValue], - queue_behaviour: ModerationAPI::Models::ActionUpdateResponse::queue_behaviour, - value_required: bool, - description: String?, - key: String?, - type: ModerationAPI::Models::ActionUpdateResponse::type_? - } - - class ActionUpdateResponse < ModerationAPI::Internal::Type::BaseModel - attr_accessor id: String - - attr_accessor built_in: bool? - - attr_accessor created_at: String - - attr_accessor filter_in_queue_ids: ::Array[String] - - attr_accessor free_text: bool - - attr_accessor name: String - - attr_accessor position: ModerationAPI::Models::ActionUpdateResponse::position - - attr_accessor possible_values: ::Array[ModerationAPI::Models::ActionUpdateResponse::PossibleValue] - - attr_accessor queue_behaviour: ModerationAPI::Models::ActionUpdateResponse::queue_behaviour - - attr_accessor value_required: bool - - attr_accessor description: String? - - attr_accessor key: String? - - attr_accessor type: ModerationAPI::Models::ActionUpdateResponse::type_? - - def initialize: ( - id: String, - built_in: bool?, - created_at: String, - filter_in_queue_ids: ::Array[String], - free_text: bool, - name: String, - position: ModerationAPI::Models::ActionUpdateResponse::position, - possible_values: ::Array[ModerationAPI::Models::ActionUpdateResponse::PossibleValue], - queue_behaviour: ModerationAPI::Models::ActionUpdateResponse::queue_behaviour, - value_required: bool, - ?description: String?, - ?key: String?, - ?type: ModerationAPI::Models::ActionUpdateResponse::type_? - ) -> void - - def to_hash: -> { - id: String, - built_in: bool?, - created_at: String, - filter_in_queue_ids: ::Array[String], - free_text: bool, - name: String, - position: ModerationAPI::Models::ActionUpdateResponse::position, - possible_values: ::Array[ModerationAPI::Models::ActionUpdateResponse::PossibleValue], - queue_behaviour: ModerationAPI::Models::ActionUpdateResponse::queue_behaviour, - value_required: bool, - description: String?, - key: String?, - type: ModerationAPI::Models::ActionUpdateResponse::type_? - } - - type position = :ALL_QUEUES | :SOME_QUEUES | :HIDDEN - - module Position - extend ModerationAPI::Internal::Type::Enum - - ALL_QUEUES: :ALL_QUEUES - SOME_QUEUES: :SOME_QUEUES - HIDDEN: :HIDDEN - - def self?.values: -> ::Array[ModerationAPI::Models::ActionUpdateResponse::position] - end - - type possible_value = { value: String } - - class PossibleValue < ModerationAPI::Internal::Type::BaseModel - attr_accessor value: String - - def initialize: (value: String) -> void - - def to_hash: -> { value: String } - end - - type queue_behaviour = :REMOVE | :ADD | :NO_CHANGE - - module QueueBehaviour - extend ModerationAPI::Internal::Type::Enum - - REMOVE: :REMOVE - ADD: :ADD - NO_CHANGE: :NO_CHANGE - - def self?.values: -> ::Array[ModerationAPI::Models::ActionUpdateResponse::queue_behaviour] - end - - type type_ = - :AUTHOR_BLOCK - | :AUTHOR_BLOCK_TEMP - | :AUTHOR_UNBLOCK - | :AUTHOR_DELETE - | :AUTHOR_REPORT - | :AUTHOR_WARN - | :AUTHOR_CUSTOM - | :ITEM_REJECT - | :ITEM_ALLOW - | :ITEM_CUSTOM - - module Type - extend ModerationAPI::Internal::Type::Enum - - AUTHOR_BLOCK: :AUTHOR_BLOCK - AUTHOR_BLOCK_TEMP: :AUTHOR_BLOCK_TEMP - AUTHOR_UNBLOCK: :AUTHOR_UNBLOCK - AUTHOR_DELETE: :AUTHOR_DELETE - AUTHOR_REPORT: :AUTHOR_REPORT - AUTHOR_WARN: :AUTHOR_WARN - AUTHOR_CUSTOM: :AUTHOR_CUSTOM - ITEM_REJECT: :ITEM_REJECT - ITEM_ALLOW: :ITEM_ALLOW - ITEM_CUSTOM: :ITEM_CUSTOM - - def self?.values: -> ::Array[ModerationAPI::Models::ActionUpdateResponse::type_] - end - end - end -end diff --git a/sig/moderation_api/models/actions/execute_execute_by_id_params.rbs b/sig/moderation_api/models/actions/execute_execute_by_id_params.rbs deleted file mode 100644 index 24c6191a..00000000 --- a/sig/moderation_api/models/actions/execute_execute_by_id_params.rbs +++ /dev/null @@ -1,56 +0,0 @@ -module ModerationAPI - module Models - module Actions - type execute_execute_by_id_params = - { - action_id: String, - author_ids: ::Array[String], - content_ids: ::Array[String], - queue_id: String, - value: String - } - & ModerationAPI::Internal::Type::request_parameters - - class ExecuteExecuteByIDParams < ModerationAPI::Internal::Type::BaseModel - extend ModerationAPI::Internal::Type::RequestParameters::Converter - include ModerationAPI::Internal::Type::RequestParameters - - attr_accessor action_id: String - - attr_reader author_ids: ::Array[String]? - - def author_ids=: (::Array[String]) -> ::Array[String] - - attr_reader content_ids: ::Array[String]? - - def content_ids=: (::Array[String]) -> ::Array[String] - - attr_reader queue_id: String? - - def queue_id=: (String) -> String - - attr_reader value: String? - - def value=: (String) -> String - - def initialize: ( - action_id: String, - ?author_ids: ::Array[String], - ?content_ids: ::Array[String], - ?queue_id: String, - ?value: String, - ?request_options: ModerationAPI::request_opts - ) -> void - - def to_hash: -> { - action_id: String, - author_ids: ::Array[String], - content_ids: ::Array[String], - queue_id: String, - value: String, - request_options: ModerationAPI::RequestOptions - } - end - end - end -end diff --git a/sig/moderation_api/models/actions/execute_execute_by_id_response.rbs b/sig/moderation_api/models/actions/execute_execute_by_id_response.rbs deleted file mode 100644 index cd44a5ed..00000000 --- a/sig/moderation_api/models/actions/execute_execute_by_id_response.rbs +++ /dev/null @@ -1,28 +0,0 @@ -module ModerationAPI - module Models - module Actions - type execute_execute_by_id_response = - { action_id: String, ids: ::Array[String], success: bool } - - class ExecuteExecuteByIDResponse < ModerationAPI::Internal::Type::BaseModel - attr_accessor action_id: String - - attr_accessor ids: ::Array[String] - - attr_accessor success: bool - - def initialize: ( - action_id: String, - ids: ::Array[String], - success: bool - ) -> void - - def to_hash: -> { - action_id: String, - ids: ::Array[String], - success: bool - } - end - end - end -end diff --git a/sig/moderation_api/models/actions/execute_execute_params.rbs b/sig/moderation_api/models/actions/execute_execute_params.rbs deleted file mode 100644 index d8ef9696..00000000 --- a/sig/moderation_api/models/actions/execute_execute_params.rbs +++ /dev/null @@ -1,63 +0,0 @@ -module ModerationAPI - module Models - module Actions - type execute_execute_params = - { - action_key: String, - author_ids: ::Array[String], - content_ids: ::Array[String], - duration: Float, - queue_id: String, - value: String - } - & ModerationAPI::Internal::Type::request_parameters - - class ExecuteExecuteParams < ModerationAPI::Internal::Type::BaseModel - extend ModerationAPI::Internal::Type::RequestParameters::Converter - include ModerationAPI::Internal::Type::RequestParameters - - attr_accessor action_key: String - - attr_reader author_ids: ::Array[String]? - - def author_ids=: (::Array[String]) -> ::Array[String] - - attr_reader content_ids: ::Array[String]? - - def content_ids=: (::Array[String]) -> ::Array[String] - - attr_reader duration: Float? - - def duration=: (Float) -> Float - - attr_reader queue_id: String? - - def queue_id=: (String) -> String - - attr_reader value: String? - - def value=: (String) -> String - - def initialize: ( - action_key: String, - ?author_ids: ::Array[String], - ?content_ids: ::Array[String], - ?duration: Float, - ?queue_id: String, - ?value: String, - ?request_options: ModerationAPI::request_opts - ) -> void - - def to_hash: -> { - action_key: String, - author_ids: ::Array[String], - content_ids: ::Array[String], - duration: Float, - queue_id: String, - value: String, - request_options: ModerationAPI::RequestOptions - } - end - end - end -end diff --git a/sig/moderation_api/models/actions/execute_execute_response.rbs b/sig/moderation_api/models/actions/execute_execute_response.rbs deleted file mode 100644 index 1e7526f4..00000000 --- a/sig/moderation_api/models/actions/execute_execute_response.rbs +++ /dev/null @@ -1,15 +0,0 @@ -module ModerationAPI - module Models - module Actions - type execute_execute_response = { success: bool } - - class ExecuteExecuteResponse < ModerationAPI::Internal::Type::BaseModel - attr_accessor success: bool - - def initialize: (success: bool) -> void - - def to_hash: -> { success: bool } - end - end - end -end diff --git a/sig/moderation_api/models/auth_create_params.rbs b/sig/moderation_api/models/auth_create_params.rbs deleted file mode 100644 index 4dbe3d08..00000000 --- a/sig/moderation_api/models/auth_create_params.rbs +++ /dev/null @@ -1,15 +0,0 @@ -module ModerationAPI - module Models - type auth_create_params = - { } & ModerationAPI::Internal::Type::request_parameters - - class AuthCreateParams < ModerationAPI::Internal::Type::BaseModel - extend ModerationAPI::Internal::Type::RequestParameters::Converter - include ModerationAPI::Internal::Type::RequestParameters - - def initialize: (?request_options: ModerationAPI::request_opts) -> void - - def to_hash: -> { request_options: ModerationAPI::RequestOptions } - end - end -end diff --git a/sig/moderation_api/models/auth_create_response.rbs b/sig/moderation_api/models/auth_create_response.rbs deleted file mode 100644 index 997cb78f..00000000 --- a/sig/moderation_api/models/auth_create_response.rbs +++ /dev/null @@ -1,18 +0,0 @@ -module ModerationAPI - module Models - type auth_create_response = - { message: String, project: String, status: String } - - class AuthCreateResponse < ModerationAPI::Internal::Type::BaseModel - attr_accessor message: String - - attr_accessor project: String - - attr_accessor status: String - - def initialize: (message: String, project: String, status: String) -> void - - def to_hash: -> { message: String, project: String, status: String } - end - end -end diff --git a/sig/moderation_api/models/auth_retrieve_params.rbs b/sig/moderation_api/models/auth_retrieve_params.rbs deleted file mode 100644 index a7237b3b..00000000 --- a/sig/moderation_api/models/auth_retrieve_params.rbs +++ /dev/null @@ -1,15 +0,0 @@ -module ModerationAPI - module Models - type auth_retrieve_params = - { } & ModerationAPI::Internal::Type::request_parameters - - class AuthRetrieveParams < ModerationAPI::Internal::Type::BaseModel - extend ModerationAPI::Internal::Type::RequestParameters::Converter - include ModerationAPI::Internal::Type::RequestParameters - - def initialize: (?request_options: ModerationAPI::request_opts) -> void - - def to_hash: -> { request_options: ModerationAPI::RequestOptions } - end - end -end diff --git a/sig/moderation_api/models/auth_retrieve_response.rbs b/sig/moderation_api/models/auth_retrieve_response.rbs deleted file mode 100644 index 52d5e1a8..00000000 --- a/sig/moderation_api/models/auth_retrieve_response.rbs +++ /dev/null @@ -1,15 +0,0 @@ -module ModerationAPI - module Models - type auth_retrieve_response = { message: String, status: String } - - class AuthRetrieveResponse < ModerationAPI::Internal::Type::BaseModel - attr_accessor message: String - - attr_accessor status: String - - def initialize: (message: String, status: String) -> void - - def to_hash: -> { message: String, status: String } - end - end -end diff --git a/sig/moderation_api/models/author_create_params.rbs b/sig/moderation_api/models/author_create_params.rbs deleted file mode 100644 index b05caf16..00000000 --- a/sig/moderation_api/models/author_create_params.rbs +++ /dev/null @@ -1,111 +0,0 @@ -module ModerationAPI - module Models - type author_create_params = - { - external_id: String, - company: String?, - email: String?, - external_link: String?, - first_seen: Float, - last_seen: Float, - manual_trust_level: Float?, - metadata: ModerationAPI::AuthorCreateParams::Metadata, - name: String?, - profile_picture: String? - } - & ModerationAPI::Internal::Type::request_parameters - - class AuthorCreateParams < ModerationAPI::Internal::Type::BaseModel - extend ModerationAPI::Internal::Type::RequestParameters::Converter - include ModerationAPI::Internal::Type::RequestParameters - - attr_accessor external_id: String - - attr_accessor company: String? - - attr_accessor email: String? - - attr_accessor external_link: String? - - attr_reader first_seen: Float? - - def first_seen=: (Float) -> Float - - attr_reader last_seen: Float? - - def last_seen=: (Float) -> Float - - attr_accessor manual_trust_level: Float? - - attr_reader metadata: ModerationAPI::AuthorCreateParams::Metadata? - - def metadata=: ( - ModerationAPI::AuthorCreateParams::Metadata - ) -> ModerationAPI::AuthorCreateParams::Metadata - - attr_accessor name: String? - - attr_accessor profile_picture: String? - - def initialize: ( - external_id: String, - ?company: String?, - ?email: String?, - ?external_link: String?, - ?first_seen: Float, - ?last_seen: Float, - ?manual_trust_level: Float?, - ?metadata: ModerationAPI::AuthorCreateParams::Metadata, - ?name: String?, - ?profile_picture: String?, - ?request_options: ModerationAPI::request_opts - ) -> void - - def to_hash: -> { - external_id: String, - company: String?, - email: String?, - external_link: String?, - first_seen: Float, - last_seen: Float, - manual_trust_level: Float?, - metadata: ModerationAPI::AuthorCreateParams::Metadata, - name: String?, - profile_picture: String?, - request_options: ModerationAPI::RequestOptions - } - - type metadata = - { - email_verified: bool?, - identity_verified: bool?, - is_paying_customer: bool?, - phone_verified: bool? - } - - class Metadata < ModerationAPI::Internal::Type::BaseModel - attr_accessor email_verified: bool? - - attr_accessor identity_verified: bool? - - attr_accessor is_paying_customer: bool? - - attr_accessor phone_verified: bool? - - def initialize: ( - ?email_verified: bool?, - ?identity_verified: bool?, - ?is_paying_customer: bool?, - ?phone_verified: bool? - ) -> void - - def to_hash: -> { - email_verified: bool?, - identity_verified: bool?, - is_paying_customer: bool?, - phone_verified: bool? - } - end - end - end -end diff --git a/sig/moderation_api/models/author_create_response.rbs b/sig/moderation_api/models/author_create_response.rbs deleted file mode 100644 index 819291c5..00000000 --- a/sig/moderation_api/models/author_create_response.rbs +++ /dev/null @@ -1,200 +0,0 @@ -module ModerationAPI - module Models - type author_create_response = - { - id: String, - block: ModerationAPI::Models::AuthorCreateResponse::Block?, - first_seen: Float, - last_seen: Float, - metadata: ModerationAPI::Models::AuthorCreateResponse::Metadata, - metrics: ModerationAPI::Models::AuthorCreateResponse::Metrics, - risk_evaluation: ModerationAPI::Models::AuthorCreateResponse::RiskEvaluation?, - status: ModerationAPI::Models::AuthorCreateResponse::status, - trust_level: ModerationAPI::Models::AuthorCreateResponse::TrustLevel, - company: String?, - email: String?, - external_id: String?, - external_link: String?, - last_incident: Float?, - name: String?, - profile_picture: String? - } - - class AuthorCreateResponse < ModerationAPI::Internal::Type::BaseModel - attr_accessor id: String - - attr_accessor block: ModerationAPI::Models::AuthorCreateResponse::Block? - - attr_accessor first_seen: Float - - attr_accessor last_seen: Float - - attr_accessor metadata: ModerationAPI::Models::AuthorCreateResponse::Metadata - - attr_accessor metrics: ModerationAPI::Models::AuthorCreateResponse::Metrics - - attr_accessor risk_evaluation: ModerationAPI::Models::AuthorCreateResponse::RiskEvaluation? - - attr_accessor status: ModerationAPI::Models::AuthorCreateResponse::status - - attr_accessor trust_level: ModerationAPI::Models::AuthorCreateResponse::TrustLevel - - attr_accessor company: String? - - attr_accessor email: String? - - attr_accessor external_id: String? - - attr_accessor external_link: String? - - attr_accessor last_incident: Float? - - attr_accessor name: String? - - attr_accessor profile_picture: String? - - def initialize: ( - id: String, - block: ModerationAPI::Models::AuthorCreateResponse::Block?, - first_seen: Float, - last_seen: Float, - metadata: ModerationAPI::Models::AuthorCreateResponse::Metadata, - metrics: ModerationAPI::Models::AuthorCreateResponse::Metrics, - risk_evaluation: ModerationAPI::Models::AuthorCreateResponse::RiskEvaluation?, - status: ModerationAPI::Models::AuthorCreateResponse::status, - trust_level: ModerationAPI::Models::AuthorCreateResponse::TrustLevel, - ?company: String?, - ?email: String?, - ?external_id: String?, - ?external_link: String?, - ?last_incident: Float?, - ?name: String?, - ?profile_picture: String? - ) -> void - - def to_hash: -> { - id: String, - block: ModerationAPI::Models::AuthorCreateResponse::Block?, - first_seen: Float, - last_seen: Float, - metadata: ModerationAPI::Models::AuthorCreateResponse::Metadata, - metrics: ModerationAPI::Models::AuthorCreateResponse::Metrics, - risk_evaluation: ModerationAPI::Models::AuthorCreateResponse::RiskEvaluation?, - status: ModerationAPI::Models::AuthorCreateResponse::status, - trust_level: ModerationAPI::Models::AuthorCreateResponse::TrustLevel, - company: String?, - email: String?, - external_id: String?, - external_link: String?, - last_incident: Float?, - name: String?, - profile_picture: String? - } - - type block = { reason: String?, until_: Float? } - - class Block < ModerationAPI::Internal::Type::BaseModel - attr_accessor reason: String? - - attr_accessor until_: Float? - - def initialize: (?reason: String?, ?until_: Float?) -> void - - def to_hash: -> { reason: String?, until_: Float? } - end - - type metadata = - { - email_verified: bool?, - identity_verified: bool?, - is_paying_customer: bool?, - phone_verified: bool? - } - - class Metadata < ModerationAPI::Internal::Type::BaseModel - attr_accessor email_verified: bool? - - attr_accessor identity_verified: bool? - - attr_accessor is_paying_customer: bool? - - attr_accessor phone_verified: bool? - - def initialize: ( - ?email_verified: bool?, - ?identity_verified: bool?, - ?is_paying_customer: bool?, - ?phone_verified: bool? - ) -> void - - def to_hash: -> { - email_verified: bool?, - identity_verified: bool?, - is_paying_customer: bool?, - phone_verified: bool? - } - end - - type metrics = - { - flagged_content: Float, - total_content: Float, - average_sentiment: Float? - } - - class Metrics < ModerationAPI::Internal::Type::BaseModel - attr_accessor flagged_content: Float - - attr_accessor total_content: Float - - attr_accessor average_sentiment: Float? - - def initialize: ( - flagged_content: Float, - total_content: Float, - ?average_sentiment: Float? - ) -> void - - def to_hash: -> { - flagged_content: Float, - total_content: Float, - average_sentiment: Float? - } - end - - type risk_evaluation = { risk_level: Float? } - - class RiskEvaluation < ModerationAPI::Internal::Type::BaseModel - attr_accessor risk_level: Float? - - def initialize: (?risk_level: Float?) -> void - - def to_hash: -> { risk_level: Float? } - end - - type status = :enabled | :suspended | :blocked - - module Status - extend ModerationAPI::Internal::Type::Enum - - ENABLED: :enabled - SUSPENDED: :suspended - BLOCKED: :blocked - - def self?.values: -> ::Array[ModerationAPI::Models::AuthorCreateResponse::status] - end - - type trust_level = { level: Float, manual: bool } - - class TrustLevel < ModerationAPI::Internal::Type::BaseModel - attr_accessor level: Float - - attr_accessor manual: bool - - def initialize: (level: Float, manual: bool) -> void - - def to_hash: -> { level: Float, manual: bool } - end - end - end -end diff --git a/sig/moderation_api/models/author_delete_params.rbs b/sig/moderation_api/models/author_delete_params.rbs deleted file mode 100644 index 12eecc72..00000000 --- a/sig/moderation_api/models/author_delete_params.rbs +++ /dev/null @@ -1,23 +0,0 @@ -module ModerationAPI - module Models - type author_delete_params = - { id: String } & ModerationAPI::Internal::Type::request_parameters - - class AuthorDeleteParams < ModerationAPI::Internal::Type::BaseModel - extend ModerationAPI::Internal::Type::RequestParameters::Converter - include ModerationAPI::Internal::Type::RequestParameters - - attr_accessor id: String - - def initialize: ( - id: String, - ?request_options: ModerationAPI::request_opts - ) -> void - - def to_hash: -> { - id: String, - request_options: ModerationAPI::RequestOptions - } - end - end -end diff --git a/sig/moderation_api/models/author_delete_response.rbs b/sig/moderation_api/models/author_delete_response.rbs deleted file mode 100644 index 2a67c3db..00000000 --- a/sig/moderation_api/models/author_delete_response.rbs +++ /dev/null @@ -1,13 +0,0 @@ -module ModerationAPI - module Models - type author_delete_response = { success: bool } - - class AuthorDeleteResponse < ModerationAPI::Internal::Type::BaseModel - attr_accessor success: bool - - def initialize: (success: bool) -> void - - def to_hash: -> { success: bool } - end - end -end diff --git a/sig/moderation_api/models/author_list_params.rbs b/sig/moderation_api/models/author_list_params.rbs deleted file mode 100644 index 79ba7654..00000000 --- a/sig/moderation_api/models/author_list_params.rbs +++ /dev/null @@ -1,110 +0,0 @@ -module ModerationAPI - module Models - type author_list_params = - { - content_types: String, - last_active_date: String, - member_since_date: String, - page_number: Float, - page_size: Float, - sort_by: ModerationAPI::Models::AuthorListParams::sort_by, - sort_direction: ModerationAPI::Models::AuthorListParams::sort_direction - } - & ModerationAPI::Internal::Type::request_parameters - - class AuthorListParams < ModerationAPI::Internal::Type::BaseModel - extend ModerationAPI::Internal::Type::RequestParameters::Converter - include ModerationAPI::Internal::Type::RequestParameters - - attr_reader content_types: String? - - def content_types=: (String) -> String - - attr_reader last_active_date: String? - - def last_active_date=: (String) -> String - - attr_reader member_since_date: String? - - def member_since_date=: (String) -> String - - attr_reader page_number: Float? - - def page_number=: (Float) -> Float - - attr_reader page_size: Float? - - def page_size=: (Float) -> Float - - attr_reader sort_by: ModerationAPI::Models::AuthorListParams::sort_by? - - def sort_by=: ( - ModerationAPI::Models::AuthorListParams::sort_by - ) -> ModerationAPI::Models::AuthorListParams::sort_by - - attr_reader sort_direction: ModerationAPI::Models::AuthorListParams::sort_direction? - - def sort_direction=: ( - ModerationAPI::Models::AuthorListParams::sort_direction - ) -> ModerationAPI::Models::AuthorListParams::sort_direction - - def initialize: ( - ?content_types: String, - ?last_active_date: String, - ?member_since_date: String, - ?page_number: Float, - ?page_size: Float, - ?sort_by: ModerationAPI::Models::AuthorListParams::sort_by, - ?sort_direction: ModerationAPI::Models::AuthorListParams::sort_direction, - ?request_options: ModerationAPI::request_opts - ) -> void - - def to_hash: -> { - content_types: String, - last_active_date: String, - member_since_date: String, - page_number: Float, - page_size: Float, - sort_by: ModerationAPI::Models::AuthorListParams::sort_by, - sort_direction: ModerationAPI::Models::AuthorListParams::sort_direction, - request_options: ModerationAPI::RequestOptions - } - - type sort_by = - :trustLevel - | :violationCount - | :reportCount - | :memberSince - | :lastActive - | :contentCount - | :flaggedContentRatio - | :averageSentiment - - module SortBy - extend ModerationAPI::Internal::Type::Enum - - TRUST_LEVEL: :trustLevel - VIOLATION_COUNT: :violationCount - REPORT_COUNT: :reportCount - MEMBER_SINCE: :memberSince - LAST_ACTIVE: :lastActive - CONTENT_COUNT: :contentCount - FLAGGED_CONTENT_RATIO: :flaggedContentRatio - AVERAGE_SENTIMENT: :averageSentiment - - def self?.values: -> ::Array[ModerationAPI::Models::AuthorListParams::sort_by] - end - - type sort_direction = :asc | :desc - - module SortDirection - extend ModerationAPI::Internal::Type::Enum - - ASC: :asc - DESC: :desc - - def self?.values: -> ::Array[ModerationAPI::Models::AuthorListParams::sort_direction] - end - end - end -end diff --git a/sig/moderation_api/models/author_list_response.rbs b/sig/moderation_api/models/author_list_response.rbs deleted file mode 100644 index 0c3a18d8..00000000 --- a/sig/moderation_api/models/author_list_response.rbs +++ /dev/null @@ -1,259 +0,0 @@ -module ModerationAPI - module Models - type author_list_response = - { - authors: ::Array[ModerationAPI::Models::AuthorListResponse::Author], - pagination: ModerationAPI::Models::AuthorListResponse::Pagination - } - - class AuthorListResponse < ModerationAPI::Internal::Type::BaseModel - attr_accessor authors: ::Array[ModerationAPI::Models::AuthorListResponse::Author] - - attr_accessor pagination: ModerationAPI::Models::AuthorListResponse::Pagination - - def initialize: ( - authors: ::Array[ModerationAPI::Models::AuthorListResponse::Author], - pagination: ModerationAPI::Models::AuthorListResponse::Pagination - ) -> void - - def to_hash: -> { - authors: ::Array[ModerationAPI::Models::AuthorListResponse::Author], - pagination: ModerationAPI::Models::AuthorListResponse::Pagination - } - - type author = - { - id: String, - block: ModerationAPI::Models::AuthorListResponse::Author::Block?, - first_seen: Float, - last_seen: Float, - metadata: ModerationAPI::Models::AuthorListResponse::Author::Metadata, - metrics: ModerationAPI::Models::AuthorListResponse::Author::Metrics, - risk_evaluation: ModerationAPI::Models::AuthorListResponse::Author::RiskEvaluation?, - status: ModerationAPI::Models::AuthorListResponse::Author::status, - trust_level: ModerationAPI::Models::AuthorListResponse::Author::TrustLevel, - company: String?, - email: String?, - external_id: String?, - external_link: String?, - last_incident: Float?, - name: String?, - profile_picture: String? - } - - class Author < ModerationAPI::Internal::Type::BaseModel - attr_accessor id: String - - attr_accessor block: ModerationAPI::Models::AuthorListResponse::Author::Block? - - attr_accessor first_seen: Float - - attr_accessor last_seen: Float - - attr_accessor metadata: ModerationAPI::Models::AuthorListResponse::Author::Metadata - - attr_accessor metrics: ModerationAPI::Models::AuthorListResponse::Author::Metrics - - attr_accessor risk_evaluation: ModerationAPI::Models::AuthorListResponse::Author::RiskEvaluation? - - attr_accessor status: ModerationAPI::Models::AuthorListResponse::Author::status - - attr_accessor trust_level: ModerationAPI::Models::AuthorListResponse::Author::TrustLevel - - attr_accessor company: String? - - attr_accessor email: String? - - attr_accessor external_id: String? - - attr_accessor external_link: String? - - attr_accessor last_incident: Float? - - attr_accessor name: String? - - attr_accessor profile_picture: String? - - def initialize: ( - id: String, - block: ModerationAPI::Models::AuthorListResponse::Author::Block?, - first_seen: Float, - last_seen: Float, - metadata: ModerationAPI::Models::AuthorListResponse::Author::Metadata, - metrics: ModerationAPI::Models::AuthorListResponse::Author::Metrics, - risk_evaluation: ModerationAPI::Models::AuthorListResponse::Author::RiskEvaluation?, - status: ModerationAPI::Models::AuthorListResponse::Author::status, - trust_level: ModerationAPI::Models::AuthorListResponse::Author::TrustLevel, - ?company: String?, - ?email: String?, - ?external_id: String?, - ?external_link: String?, - ?last_incident: Float?, - ?name: String?, - ?profile_picture: String? - ) -> void - - def to_hash: -> { - id: String, - block: ModerationAPI::Models::AuthorListResponse::Author::Block?, - first_seen: Float, - last_seen: Float, - metadata: ModerationAPI::Models::AuthorListResponse::Author::Metadata, - metrics: ModerationAPI::Models::AuthorListResponse::Author::Metrics, - risk_evaluation: ModerationAPI::Models::AuthorListResponse::Author::RiskEvaluation?, - status: ModerationAPI::Models::AuthorListResponse::Author::status, - trust_level: ModerationAPI::Models::AuthorListResponse::Author::TrustLevel, - company: String?, - email: String?, - external_id: String?, - external_link: String?, - last_incident: Float?, - name: String?, - profile_picture: String? - } - - type block = { reason: String?, until_: Float? } - - class Block < ModerationAPI::Internal::Type::BaseModel - attr_accessor reason: String? - - attr_accessor until_: Float? - - def initialize: (?reason: String?, ?until_: Float?) -> void - - def to_hash: -> { reason: String?, until_: Float? } - end - - type metadata = - { - email_verified: bool?, - identity_verified: bool?, - is_paying_customer: bool?, - phone_verified: bool? - } - - class Metadata < ModerationAPI::Internal::Type::BaseModel - attr_accessor email_verified: bool? - - attr_accessor identity_verified: bool? - - attr_accessor is_paying_customer: bool? - - attr_accessor phone_verified: bool? - - def initialize: ( - ?email_verified: bool?, - ?identity_verified: bool?, - ?is_paying_customer: bool?, - ?phone_verified: bool? - ) -> void - - def to_hash: -> { - email_verified: bool?, - identity_verified: bool?, - is_paying_customer: bool?, - phone_verified: bool? - } - end - - type metrics = - { - flagged_content: Float, - total_content: Float, - average_sentiment: Float? - } - - class Metrics < ModerationAPI::Internal::Type::BaseModel - attr_accessor flagged_content: Float - - attr_accessor total_content: Float - - attr_accessor average_sentiment: Float? - - def initialize: ( - flagged_content: Float, - total_content: Float, - ?average_sentiment: Float? - ) -> void - - def to_hash: -> { - flagged_content: Float, - total_content: Float, - average_sentiment: Float? - } - end - - type risk_evaluation = { risk_level: Float? } - - class RiskEvaluation < ModerationAPI::Internal::Type::BaseModel - attr_accessor risk_level: Float? - - def initialize: (?risk_level: Float?) -> void - - def to_hash: -> { risk_level: Float? } - end - - type status = :enabled | :suspended | :blocked - - module Status - extend ModerationAPI::Internal::Type::Enum - - ENABLED: :enabled - SUSPENDED: :suspended - BLOCKED: :blocked - - def self?.values: -> ::Array[ModerationAPI::Models::AuthorListResponse::Author::status] - end - - type trust_level = { level: Float, manual: bool } - - class TrustLevel < ModerationAPI::Internal::Type::BaseModel - attr_accessor level: Float - - attr_accessor manual: bool - - def initialize: (level: Float, manual: bool) -> void - - def to_hash: -> { level: Float, manual: bool } - end - end - - type pagination = - { - has_next_page: bool, - has_previous_page: bool, - page_number: Float, - page_size: Float, - total: Float - } - - class Pagination < ModerationAPI::Internal::Type::BaseModel - attr_accessor has_next_page: bool - - attr_accessor has_previous_page: bool - - attr_accessor page_number: Float - - attr_accessor page_size: Float - - attr_accessor total: Float - - def initialize: ( - has_next_page: bool, - has_previous_page: bool, - page_number: Float, - page_size: Float, - total: Float - ) -> void - - def to_hash: -> { - has_next_page: bool, - has_previous_page: bool, - page_number: Float, - page_size: Float, - total: Float - } - end - end - end -end diff --git a/sig/moderation_api/models/author_retrieve_params.rbs b/sig/moderation_api/models/author_retrieve_params.rbs deleted file mode 100644 index 2e682c17..00000000 --- a/sig/moderation_api/models/author_retrieve_params.rbs +++ /dev/null @@ -1,23 +0,0 @@ -module ModerationAPI - module Models - type author_retrieve_params = - { id: String } & ModerationAPI::Internal::Type::request_parameters - - class AuthorRetrieveParams < ModerationAPI::Internal::Type::BaseModel - extend ModerationAPI::Internal::Type::RequestParameters::Converter - include ModerationAPI::Internal::Type::RequestParameters - - attr_accessor id: String - - def initialize: ( - id: String, - ?request_options: ModerationAPI::request_opts - ) -> void - - def to_hash: -> { - id: String, - request_options: ModerationAPI::RequestOptions - } - end - end -end diff --git a/sig/moderation_api/models/author_retrieve_response.rbs b/sig/moderation_api/models/author_retrieve_response.rbs deleted file mode 100644 index f8bff293..00000000 --- a/sig/moderation_api/models/author_retrieve_response.rbs +++ /dev/null @@ -1,200 +0,0 @@ -module ModerationAPI - module Models - type author_retrieve_response = - { - id: String, - block: ModerationAPI::Models::AuthorRetrieveResponse::Block?, - first_seen: Float, - last_seen: Float, - metadata: ModerationAPI::Models::AuthorRetrieveResponse::Metadata, - metrics: ModerationAPI::Models::AuthorRetrieveResponse::Metrics, - risk_evaluation: ModerationAPI::Models::AuthorRetrieveResponse::RiskEvaluation?, - status: ModerationAPI::Models::AuthorRetrieveResponse::status, - trust_level: ModerationAPI::Models::AuthorRetrieveResponse::TrustLevel, - company: String?, - email: String?, - external_id: String?, - external_link: String?, - last_incident: Float?, - name: String?, - profile_picture: String? - } - - class AuthorRetrieveResponse < ModerationAPI::Internal::Type::BaseModel - attr_accessor id: String - - attr_accessor block: ModerationAPI::Models::AuthorRetrieveResponse::Block? - - attr_accessor first_seen: Float - - attr_accessor last_seen: Float - - attr_accessor metadata: ModerationAPI::Models::AuthorRetrieveResponse::Metadata - - attr_accessor metrics: ModerationAPI::Models::AuthorRetrieveResponse::Metrics - - attr_accessor risk_evaluation: ModerationAPI::Models::AuthorRetrieveResponse::RiskEvaluation? - - attr_accessor status: ModerationAPI::Models::AuthorRetrieveResponse::status - - attr_accessor trust_level: ModerationAPI::Models::AuthorRetrieveResponse::TrustLevel - - attr_accessor company: String? - - attr_accessor email: String? - - attr_accessor external_id: String? - - attr_accessor external_link: String? - - attr_accessor last_incident: Float? - - attr_accessor name: String? - - attr_accessor profile_picture: String? - - def initialize: ( - id: String, - block: ModerationAPI::Models::AuthorRetrieveResponse::Block?, - first_seen: Float, - last_seen: Float, - metadata: ModerationAPI::Models::AuthorRetrieveResponse::Metadata, - metrics: ModerationAPI::Models::AuthorRetrieveResponse::Metrics, - risk_evaluation: ModerationAPI::Models::AuthorRetrieveResponse::RiskEvaluation?, - status: ModerationAPI::Models::AuthorRetrieveResponse::status, - trust_level: ModerationAPI::Models::AuthorRetrieveResponse::TrustLevel, - ?company: String?, - ?email: String?, - ?external_id: String?, - ?external_link: String?, - ?last_incident: Float?, - ?name: String?, - ?profile_picture: String? - ) -> void - - def to_hash: -> { - id: String, - block: ModerationAPI::Models::AuthorRetrieveResponse::Block?, - first_seen: Float, - last_seen: Float, - metadata: ModerationAPI::Models::AuthorRetrieveResponse::Metadata, - metrics: ModerationAPI::Models::AuthorRetrieveResponse::Metrics, - risk_evaluation: ModerationAPI::Models::AuthorRetrieveResponse::RiskEvaluation?, - status: ModerationAPI::Models::AuthorRetrieveResponse::status, - trust_level: ModerationAPI::Models::AuthorRetrieveResponse::TrustLevel, - company: String?, - email: String?, - external_id: String?, - external_link: String?, - last_incident: Float?, - name: String?, - profile_picture: String? - } - - type block = { reason: String?, until_: Float? } - - class Block < ModerationAPI::Internal::Type::BaseModel - attr_accessor reason: String? - - attr_accessor until_: Float? - - def initialize: (?reason: String?, ?until_: Float?) -> void - - def to_hash: -> { reason: String?, until_: Float? } - end - - type metadata = - { - email_verified: bool?, - identity_verified: bool?, - is_paying_customer: bool?, - phone_verified: bool? - } - - class Metadata < ModerationAPI::Internal::Type::BaseModel - attr_accessor email_verified: bool? - - attr_accessor identity_verified: bool? - - attr_accessor is_paying_customer: bool? - - attr_accessor phone_verified: bool? - - def initialize: ( - ?email_verified: bool?, - ?identity_verified: bool?, - ?is_paying_customer: bool?, - ?phone_verified: bool? - ) -> void - - def to_hash: -> { - email_verified: bool?, - identity_verified: bool?, - is_paying_customer: bool?, - phone_verified: bool? - } - end - - type metrics = - { - flagged_content: Float, - total_content: Float, - average_sentiment: Float? - } - - class Metrics < ModerationAPI::Internal::Type::BaseModel - attr_accessor flagged_content: Float - - attr_accessor total_content: Float - - attr_accessor average_sentiment: Float? - - def initialize: ( - flagged_content: Float, - total_content: Float, - ?average_sentiment: Float? - ) -> void - - def to_hash: -> { - flagged_content: Float, - total_content: Float, - average_sentiment: Float? - } - end - - type risk_evaluation = { risk_level: Float? } - - class RiskEvaluation < ModerationAPI::Internal::Type::BaseModel - attr_accessor risk_level: Float? - - def initialize: (?risk_level: Float?) -> void - - def to_hash: -> { risk_level: Float? } - end - - type status = :enabled | :suspended | :blocked - - module Status - extend ModerationAPI::Internal::Type::Enum - - ENABLED: :enabled - SUSPENDED: :suspended - BLOCKED: :blocked - - def self?.values: -> ::Array[ModerationAPI::Models::AuthorRetrieveResponse::status] - end - - type trust_level = { level: Float, manual: bool } - - class TrustLevel < ModerationAPI::Internal::Type::BaseModel - attr_accessor level: Float - - attr_accessor manual: bool - - def initialize: (level: Float, manual: bool) -> void - - def to_hash: -> { level: Float, manual: bool } - end - end - end -end diff --git a/sig/moderation_api/models/author_update_params.rbs b/sig/moderation_api/models/author_update_params.rbs deleted file mode 100644 index dd185d0e..00000000 --- a/sig/moderation_api/models/author_update_params.rbs +++ /dev/null @@ -1,111 +0,0 @@ -module ModerationAPI - module Models - type author_update_params = - { - id: String, - company: String?, - email: String?, - external_link: String?, - first_seen: Float, - last_seen: Float, - manual_trust_level: Float?, - metadata: ModerationAPI::AuthorUpdateParams::Metadata, - name: String?, - profile_picture: String? - } - & ModerationAPI::Internal::Type::request_parameters - - class AuthorUpdateParams < ModerationAPI::Internal::Type::BaseModel - extend ModerationAPI::Internal::Type::RequestParameters::Converter - include ModerationAPI::Internal::Type::RequestParameters - - attr_accessor id: String - - attr_accessor company: String? - - attr_accessor email: String? - - attr_accessor external_link: String? - - attr_reader first_seen: Float? - - def first_seen=: (Float) -> Float - - attr_reader last_seen: Float? - - def last_seen=: (Float) -> Float - - attr_accessor manual_trust_level: Float? - - attr_reader metadata: ModerationAPI::AuthorUpdateParams::Metadata? - - def metadata=: ( - ModerationAPI::AuthorUpdateParams::Metadata - ) -> ModerationAPI::AuthorUpdateParams::Metadata - - attr_accessor name: String? - - attr_accessor profile_picture: String? - - def initialize: ( - id: String, - ?company: String?, - ?email: String?, - ?external_link: String?, - ?first_seen: Float, - ?last_seen: Float, - ?manual_trust_level: Float?, - ?metadata: ModerationAPI::AuthorUpdateParams::Metadata, - ?name: String?, - ?profile_picture: String?, - ?request_options: ModerationAPI::request_opts - ) -> void - - def to_hash: -> { - id: String, - company: String?, - email: String?, - external_link: String?, - first_seen: Float, - last_seen: Float, - manual_trust_level: Float?, - metadata: ModerationAPI::AuthorUpdateParams::Metadata, - name: String?, - profile_picture: String?, - request_options: ModerationAPI::RequestOptions - } - - type metadata = - { - email_verified: bool?, - identity_verified: bool?, - is_paying_customer: bool?, - phone_verified: bool? - } - - class Metadata < ModerationAPI::Internal::Type::BaseModel - attr_accessor email_verified: bool? - - attr_accessor identity_verified: bool? - - attr_accessor is_paying_customer: bool? - - attr_accessor phone_verified: bool? - - def initialize: ( - ?email_verified: bool?, - ?identity_verified: bool?, - ?is_paying_customer: bool?, - ?phone_verified: bool? - ) -> void - - def to_hash: -> { - email_verified: bool?, - identity_verified: bool?, - is_paying_customer: bool?, - phone_verified: bool? - } - end - end - end -end diff --git a/sig/moderation_api/models/author_update_response.rbs b/sig/moderation_api/models/author_update_response.rbs deleted file mode 100644 index e76fa329..00000000 --- a/sig/moderation_api/models/author_update_response.rbs +++ /dev/null @@ -1,200 +0,0 @@ -module ModerationAPI - module Models - type author_update_response = - { - id: String, - block: ModerationAPI::Models::AuthorUpdateResponse::Block?, - first_seen: Float, - last_seen: Float, - metadata: ModerationAPI::Models::AuthorUpdateResponse::Metadata, - metrics: ModerationAPI::Models::AuthorUpdateResponse::Metrics, - risk_evaluation: ModerationAPI::Models::AuthorUpdateResponse::RiskEvaluation?, - status: ModerationAPI::Models::AuthorUpdateResponse::status, - trust_level: ModerationAPI::Models::AuthorUpdateResponse::TrustLevel, - company: String?, - email: String?, - external_id: String?, - external_link: String?, - last_incident: Float?, - name: String?, - profile_picture: String? - } - - class AuthorUpdateResponse < ModerationAPI::Internal::Type::BaseModel - attr_accessor id: String - - attr_accessor block: ModerationAPI::Models::AuthorUpdateResponse::Block? - - attr_accessor first_seen: Float - - attr_accessor last_seen: Float - - attr_accessor metadata: ModerationAPI::Models::AuthorUpdateResponse::Metadata - - attr_accessor metrics: ModerationAPI::Models::AuthorUpdateResponse::Metrics - - attr_accessor risk_evaluation: ModerationAPI::Models::AuthorUpdateResponse::RiskEvaluation? - - attr_accessor status: ModerationAPI::Models::AuthorUpdateResponse::status - - attr_accessor trust_level: ModerationAPI::Models::AuthorUpdateResponse::TrustLevel - - attr_accessor company: String? - - attr_accessor email: String? - - attr_accessor external_id: String? - - attr_accessor external_link: String? - - attr_accessor last_incident: Float? - - attr_accessor name: String? - - attr_accessor profile_picture: String? - - def initialize: ( - id: String, - block: ModerationAPI::Models::AuthorUpdateResponse::Block?, - first_seen: Float, - last_seen: Float, - metadata: ModerationAPI::Models::AuthorUpdateResponse::Metadata, - metrics: ModerationAPI::Models::AuthorUpdateResponse::Metrics, - risk_evaluation: ModerationAPI::Models::AuthorUpdateResponse::RiskEvaluation?, - status: ModerationAPI::Models::AuthorUpdateResponse::status, - trust_level: ModerationAPI::Models::AuthorUpdateResponse::TrustLevel, - ?company: String?, - ?email: String?, - ?external_id: String?, - ?external_link: String?, - ?last_incident: Float?, - ?name: String?, - ?profile_picture: String? - ) -> void - - def to_hash: -> { - id: String, - block: ModerationAPI::Models::AuthorUpdateResponse::Block?, - first_seen: Float, - last_seen: Float, - metadata: ModerationAPI::Models::AuthorUpdateResponse::Metadata, - metrics: ModerationAPI::Models::AuthorUpdateResponse::Metrics, - risk_evaluation: ModerationAPI::Models::AuthorUpdateResponse::RiskEvaluation?, - status: ModerationAPI::Models::AuthorUpdateResponse::status, - trust_level: ModerationAPI::Models::AuthorUpdateResponse::TrustLevel, - company: String?, - email: String?, - external_id: String?, - external_link: String?, - last_incident: Float?, - name: String?, - profile_picture: String? - } - - type block = { reason: String?, until_: Float? } - - class Block < ModerationAPI::Internal::Type::BaseModel - attr_accessor reason: String? - - attr_accessor until_: Float? - - def initialize: (?reason: String?, ?until_: Float?) -> void - - def to_hash: -> { reason: String?, until_: Float? } - end - - type metadata = - { - email_verified: bool?, - identity_verified: bool?, - is_paying_customer: bool?, - phone_verified: bool? - } - - class Metadata < ModerationAPI::Internal::Type::BaseModel - attr_accessor email_verified: bool? - - attr_accessor identity_verified: bool? - - attr_accessor is_paying_customer: bool? - - attr_accessor phone_verified: bool? - - def initialize: ( - ?email_verified: bool?, - ?identity_verified: bool?, - ?is_paying_customer: bool?, - ?phone_verified: bool? - ) -> void - - def to_hash: -> { - email_verified: bool?, - identity_verified: bool?, - is_paying_customer: bool?, - phone_verified: bool? - } - end - - type metrics = - { - flagged_content: Float, - total_content: Float, - average_sentiment: Float? - } - - class Metrics < ModerationAPI::Internal::Type::BaseModel - attr_accessor flagged_content: Float - - attr_accessor total_content: Float - - attr_accessor average_sentiment: Float? - - def initialize: ( - flagged_content: Float, - total_content: Float, - ?average_sentiment: Float? - ) -> void - - def to_hash: -> { - flagged_content: Float, - total_content: Float, - average_sentiment: Float? - } - end - - type risk_evaluation = { risk_level: Float? } - - class RiskEvaluation < ModerationAPI::Internal::Type::BaseModel - attr_accessor risk_level: Float? - - def initialize: (?risk_level: Float?) -> void - - def to_hash: -> { risk_level: Float? } - end - - type status = :enabled | :suspended | :blocked - - module Status - extend ModerationAPI::Internal::Type::Enum - - ENABLED: :enabled - SUSPENDED: :suspended - BLOCKED: :blocked - - def self?.values: -> ::Array[ModerationAPI::Models::AuthorUpdateResponse::status] - end - - type trust_level = { level: Float, manual: bool } - - class TrustLevel < ModerationAPI::Internal::Type::BaseModel - attr_accessor level: Float - - attr_accessor manual: bool - - def initialize: (level: Float, manual: bool) -> void - - def to_hash: -> { level: Float, manual: bool } - end - end - end -end diff --git a/sig/moderation_api/models/content_stream_params.rbs b/sig/moderation_api/models/content_stream_params.rbs deleted file mode 100644 index 0ec98f00..00000000 --- a/sig/moderation_api/models/content_stream_params.rbs +++ /dev/null @@ -1,36 +0,0 @@ -module ModerationAPI - module Models - type content_stream_params = - { - sec_web_socket_protocol: ModerationAPI::Models::ContentStreamParams::sec_web_socket_protocol - } - & ModerationAPI::Internal::Type::request_parameters - - class ContentStreamParams < ModerationAPI::Internal::Type::BaseModel - extend ModerationAPI::Internal::Type::RequestParameters::Converter - include ModerationAPI::Internal::Type::RequestParameters - - attr_accessor sec_web_socket_protocol: ModerationAPI::Models::ContentStreamParams::sec_web_socket_protocol - - def initialize: ( - sec_web_socket_protocol: ModerationAPI::Models::ContentStreamParams::sec_web_socket_protocol, - ?request_options: ModerationAPI::request_opts - ) -> void - - def to_hash: -> { - sec_web_socket_protocol: ModerationAPI::Models::ContentStreamParams::sec_web_socket_protocol, - request_options: ModerationAPI::RequestOptions - } - - type sec_web_socket_protocol = :"moderationapi.v1" - - module SecWebSocketProtocol - extend ModerationAPI::Internal::Type::Enum - - MODERATIONAPI_V1: :"moderationapi.v1" - - def self?.values: -> ::Array[ModerationAPI::Models::ContentStreamParams::sec_web_socket_protocol] - end - end - end -end diff --git a/sig/moderation_api/models/content_submit_params.rbs b/sig/moderation_api/models/content_submit_params.rbs deleted file mode 100644 index a997e82c..00000000 --- a/sig/moderation_api/models/content_submit_params.rbs +++ /dev/null @@ -1,1207 +0,0 @@ -module ModerationAPI - module Models - type content_submit_params = - { - content: ModerationAPI::Models::ContentSubmitParams::content, - author_id: String, - channel: String, - client_action: ModerationAPI::ContentSubmitParams::ClientAction, - content_id: String, - conversation_id: String, - do_not_store: bool, - metadata: ::Hash[Symbol, top], - meta_type: ModerationAPI::Models::ContentSubmitParams::meta_type, - policies: ::Array[ModerationAPI::Models::ContentSubmitParams::policy], - timestamp: Float - } - & ModerationAPI::Internal::Type::request_parameters - - class ContentSubmitParams < ModerationAPI::Internal::Type::BaseModel - extend ModerationAPI::Internal::Type::RequestParameters::Converter - include ModerationAPI::Internal::Type::RequestParameters - - attr_accessor content: ModerationAPI::Models::ContentSubmitParams::content - - attr_reader author_id: String? - - def author_id=: (String) -> String - - attr_reader channel: String? - - def channel=: (String) -> String - - attr_reader client_action: ModerationAPI::ContentSubmitParams::ClientAction? - - def client_action=: ( - ModerationAPI::ContentSubmitParams::ClientAction - ) -> ModerationAPI::ContentSubmitParams::ClientAction - - attr_reader content_id: String? - - def content_id=: (String) -> String - - attr_reader conversation_id: String? - - def conversation_id=: (String) -> String - - attr_reader do_not_store: bool? - - def do_not_store=: (bool) -> bool - - attr_reader metadata: ::Hash[Symbol, top]? - - def metadata=: (::Hash[Symbol, top]) -> ::Hash[Symbol, top] - - attr_reader meta_type: ModerationAPI::Models::ContentSubmitParams::meta_type? - - def meta_type=: ( - ModerationAPI::Models::ContentSubmitParams::meta_type - ) -> ModerationAPI::Models::ContentSubmitParams::meta_type - - attr_reader policies: ::Array[ModerationAPI::Models::ContentSubmitParams::policy]? - - def policies=: ( - ::Array[ModerationAPI::Models::ContentSubmitParams::policy] - ) -> ::Array[ModerationAPI::Models::ContentSubmitParams::policy] - - attr_reader timestamp: Float? - - def timestamp=: (Float) -> Float - - def initialize: ( - content: ModerationAPI::Models::ContentSubmitParams::content, - ?author_id: String, - ?channel: String, - ?client_action: ModerationAPI::ContentSubmitParams::ClientAction, - ?content_id: String, - ?conversation_id: String, - ?do_not_store: bool, - ?metadata: ::Hash[Symbol, top], - ?meta_type: ModerationAPI::Models::ContentSubmitParams::meta_type, - ?policies: ::Array[ModerationAPI::Models::ContentSubmitParams::policy], - ?timestamp: Float, - ?request_options: ModerationAPI::request_opts - ) -> void - - def to_hash: -> { - content: ModerationAPI::Models::ContentSubmitParams::content, - author_id: String, - channel: String, - client_action: ModerationAPI::ContentSubmitParams::ClientAction, - content_id: String, - conversation_id: String, - do_not_store: bool, - metadata: ::Hash[Symbol, top], - meta_type: ModerationAPI::Models::ContentSubmitParams::meta_type, - policies: ::Array[ModerationAPI::Models::ContentSubmitParams::policy], - timestamp: Float, - request_options: ModerationAPI::RequestOptions - } - - type content = - ModerationAPI::ContentSubmitParams::Content::Text - | ModerationAPI::ContentSubmitParams::Content::Image - | ModerationAPI::ContentSubmitParams::Content::Video - | ModerationAPI::ContentSubmitParams::Content::Audio - | ModerationAPI::ContentSubmitParams::Content::Object - - module Content - extend ModerationAPI::Internal::Type::Union - - type text = { text: String, type: :text } - - class Text < ModerationAPI::Internal::Type::BaseModel - attr_accessor text: String - - attr_accessor type: :text - - def initialize: (text: String, ?type: :text) -> void - - def to_hash: -> { text: String, type: :text } - end - - type image = { type: :image, data: String, url: String } - - class Image < ModerationAPI::Internal::Type::BaseModel - attr_accessor type: :image - - attr_reader data: String? - - def data=: (String) -> String - - attr_reader url: String? - - def url=: (String) -> String - - def initialize: (?data: String, ?url: String, ?type: :image) -> void - - def to_hash: -> { type: :image, data: String, url: String } - end - - type video = { type: :video, url: String } - - class Video < ModerationAPI::Internal::Type::BaseModel - attr_accessor type: :video - - attr_accessor url: String - - def initialize: (url: String, ?type: :video) -> void - - def to_hash: -> { type: :video, url: String } - end - - type audio = { type: :audio, url: String } - - class Audio < ModerationAPI::Internal::Type::BaseModel - attr_accessor type: :audio - - attr_accessor url: String - - def initialize: (url: String, ?type: :audio) -> void - - def to_hash: -> { type: :audio, url: String } - end - - type object = - { - data: ::Hash[Symbol, ModerationAPI::Models::ContentSubmitParams::Content::Object::data], - type: :object - } - - class Object < ModerationAPI::Internal::Type::BaseModel - attr_accessor data: ::Hash[Symbol, ModerationAPI::Models::ContentSubmitParams::Content::Object::data] - - attr_accessor type: :object - - def initialize: ( - data: ::Hash[Symbol, ModerationAPI::Models::ContentSubmitParams::Content::Object::data], - ?type: :object - ) -> void - - def to_hash: -> { - data: ::Hash[Symbol, ModerationAPI::Models::ContentSubmitParams::Content::Object::data], - type: :object - } - - type data = - ModerationAPI::ContentSubmitParams::Content::Object::Data::Text - | ModerationAPI::ContentSubmitParams::Content::Object::Data::Image - | ModerationAPI::ContentSubmitParams::Content::Object::Data::Video - | ModerationAPI::ContentSubmitParams::Content::Object::Data::Audio - - module Data - extend ModerationAPI::Internal::Type::Union - - type text = { text: String, type: :text } - - class Text < ModerationAPI::Internal::Type::BaseModel - attr_accessor text: String - - attr_accessor type: :text - - def initialize: (text: String, ?type: :text) -> void - - def to_hash: -> { text: String, type: :text } - end - - type image = { type: :image, data: String, url: String } - - class Image < ModerationAPI::Internal::Type::BaseModel - attr_accessor type: :image - - attr_reader data: String? - - def data=: (String) -> String - - attr_reader url: String? - - def url=: (String) -> String - - def initialize: ( - ?data: String, - ?url: String, - ?type: :image - ) -> void - - def to_hash: -> { type: :image, data: String, url: String } - end - - type video = { type: :video, url: String } - - class Video < ModerationAPI::Internal::Type::BaseModel - attr_accessor type: :video - - attr_accessor url: String - - def initialize: (url: String, ?type: :video) -> void - - def to_hash: -> { type: :video, url: String } - end - - type audio = { type: :audio, url: String } - - class Audio < ModerationAPI::Internal::Type::BaseModel - attr_accessor type: :audio - - attr_accessor url: String - - def initialize: (url: String, ?type: :audio) -> void - - def to_hash: -> { type: :audio, url: String } - end - - def self?.variants: -> ::Array[ModerationAPI::Models::ContentSubmitParams::Content::Object::data] - end - end - - def self?.variants: -> ::Array[ModerationAPI::Models::ContentSubmitParams::content] - end - - type client_action = - { - action: ModerationAPI::Models::ContentSubmitParams::ClientAction::action, - behavior: ModerationAPI::Models::ContentSubmitParams::ClientAction::behavior, - reason: String, - source: String - } - - class ClientAction < ModerationAPI::Internal::Type::BaseModel - attr_accessor action: ModerationAPI::Models::ContentSubmitParams::ClientAction::action - - attr_reader behavior: ModerationAPI::Models::ContentSubmitParams::ClientAction::behavior? - - def behavior=: ( - ModerationAPI::Models::ContentSubmitParams::ClientAction::behavior - ) -> ModerationAPI::Models::ContentSubmitParams::ClientAction::behavior - - attr_reader reason: String? - - def reason=: (String) -> String - - attr_reader source: String? - - def source=: (String) -> String - - def initialize: ( - action: ModerationAPI::Models::ContentSubmitParams::ClientAction::action, - ?behavior: ModerationAPI::Models::ContentSubmitParams::ClientAction::behavior, - ?reason: String, - ?source: String - ) -> void - - def to_hash: -> { - action: ModerationAPI::Models::ContentSubmitParams::ClientAction::action, - behavior: ModerationAPI::Models::ContentSubmitParams::ClientAction::behavior, - reason: String, - source: String - } - - type action = :review | :allow | :reject - - module Action - extend ModerationAPI::Internal::Type::Enum - - REVIEW: :review - ALLOW: :allow - REJECT: :reject - - def self?.values: -> ::Array[ModerationAPI::Models::ContentSubmitParams::ClientAction::action] - end - - type behavior = :override | :escalate - - module Behavior - extend ModerationAPI::Internal::Type::Enum - - OVERRIDE: :override - ESCALATE: :escalate - - def self?.values: -> ::Array[ModerationAPI::Models::ContentSubmitParams::ClientAction::behavior] - end - end - - type meta_type = - :profile - | :message - | :post - | :comment - | :event - | :product - | :review - | :voice - | :other - - module MetaType - extend ModerationAPI::Internal::Type::Enum - - PROFILE: :profile - MESSAGE: :message - POST: :post - COMMENT: :comment - EVENT: :event - PRODUCT: :product - REVIEW: :review - VOICE: :voice - OTHER: :other - - def self?.values: -> ::Array[ModerationAPI::Models::ContentSubmitParams::meta_type] - end - - type policy = - ModerationAPI::ContentSubmitParams::Policy::Toxicity - | ModerationAPI::ContentSubmitParams::Policy::PersonalInformation - | ModerationAPI::ContentSubmitParams::Policy::ToxicitySevere - | ModerationAPI::ContentSubmitParams::Policy::Hate - | ModerationAPI::ContentSubmitParams::Policy::Illicit - | ModerationAPI::ContentSubmitParams::Policy::IllicitDrugs - | ModerationAPI::ContentSubmitParams::Policy::IllicitAlcohol - | ModerationAPI::ContentSubmitParams::Policy::IllicitFirearms - | ModerationAPI::ContentSubmitParams::Policy::IllicitTobacco - | ModerationAPI::ContentSubmitParams::Policy::IllicitGambling - | ModerationAPI::ContentSubmitParams::Policy::Cannabis - | ModerationAPI::ContentSubmitParams::Policy::Adult - | ModerationAPI::ContentSubmitParams::Policy::Crypto - | ModerationAPI::ContentSubmitParams::Policy::Sexual - | ModerationAPI::ContentSubmitParams::Policy::SexualMinors - | ModerationAPI::ContentSubmitParams::Policy::Flirtation - | ModerationAPI::ContentSubmitParams::Policy::Profanity - | ModerationAPI::ContentSubmitParams::Policy::Violence - | ModerationAPI::ContentSubmitParams::Policy::SelfHarm - | ModerationAPI::ContentSubmitParams::Policy::Spam - | ModerationAPI::ContentSubmitParams::Policy::LowQualityContent - | ModerationAPI::ContentSubmitParams::Policy::FaceDetection - | ModerationAPI::ContentSubmitParams::Policy::SelfPromotion - | ModerationAPI::ContentSubmitParams::Policy::Political - | ModerationAPI::ContentSubmitParams::Policy::Religion - | ModerationAPI::ContentSubmitParams::Policy::CodeAbuse - | ModerationAPI::ContentSubmitParams::Policy::UnicodeSpoofing - | ModerationAPI::ContentSubmitParams::Policy::PiiMasking - | ModerationAPI::ContentSubmitParams::Policy::URLMasking - | ModerationAPI::ContentSubmitParams::Policy::URLRisk - | ModerationAPI::ContentSubmitParams::Policy::Guideline - - module Policy - extend ModerationAPI::Internal::Type::Union - - type toxicity = { id: :toxicity, flag: bool, threshold: Float } - - class Toxicity < ModerationAPI::Internal::Type::BaseModel - attr_accessor id: :toxicity - - attr_accessor flag: bool - - attr_reader threshold: Float? - - def threshold=: (Float) -> Float - - def initialize: ( - flag: bool, - ?threshold: Float, - ?id: :toxicity - ) -> void - - def to_hash: -> { id: :toxicity, flag: bool, threshold: Float } - end - - type personal_information = - { id: :personal_information, flag: bool, threshold: Float } - - class PersonalInformation < ModerationAPI::Internal::Type::BaseModel - attr_accessor id: :personal_information - - attr_accessor flag: bool - - attr_reader threshold: Float? - - def threshold=: (Float) -> Float - - def initialize: ( - flag: bool, - ?threshold: Float, - ?id: :personal_information - ) -> void - - def to_hash: -> { - id: :personal_information, - flag: bool, - threshold: Float - } - end - - type toxicity_severe = - { id: :toxicity_severe, flag: bool, threshold: Float } - - class ToxicitySevere < ModerationAPI::Internal::Type::BaseModel - attr_accessor id: :toxicity_severe - - attr_accessor flag: bool - - attr_reader threshold: Float? - - def threshold=: (Float) -> Float - - def initialize: ( - flag: bool, - ?threshold: Float, - ?id: :toxicity_severe - ) -> void - - def to_hash: -> { id: :toxicity_severe, flag: bool, threshold: Float } - end - - type hate = { id: :hate, flag: bool, threshold: Float } - - class Hate < ModerationAPI::Internal::Type::BaseModel - attr_accessor id: :hate - - attr_accessor flag: bool - - attr_reader threshold: Float? - - def threshold=: (Float) -> Float - - def initialize: (flag: bool, ?threshold: Float, ?id: :hate) -> void - - def to_hash: -> { id: :hate, flag: bool, threshold: Float } - end - - type illicit = { id: :illicit, flag: bool, threshold: Float } - - class Illicit < ModerationAPI::Internal::Type::BaseModel - attr_accessor id: :illicit - - attr_accessor flag: bool - - attr_reader threshold: Float? - - def threshold=: (Float) -> Float - - def initialize: (flag: bool, ?threshold: Float, ?id: :illicit) -> void - - def to_hash: -> { id: :illicit, flag: bool, threshold: Float } - end - - type illicit_drugs = - { id: :illicit_drugs, flag: bool, threshold: Float } - - class IllicitDrugs < ModerationAPI::Internal::Type::BaseModel - attr_accessor id: :illicit_drugs - - attr_accessor flag: bool - - attr_reader threshold: Float? - - def threshold=: (Float) -> Float - - def initialize: ( - flag: bool, - ?threshold: Float, - ?id: :illicit_drugs - ) -> void - - def to_hash: -> { id: :illicit_drugs, flag: bool, threshold: Float } - end - - type illicit_alcohol = - { id: :illicit_alcohol, flag: bool, threshold: Float } - - class IllicitAlcohol < ModerationAPI::Internal::Type::BaseModel - attr_accessor id: :illicit_alcohol - - attr_accessor flag: bool - - attr_reader threshold: Float? - - def threshold=: (Float) -> Float - - def initialize: ( - flag: bool, - ?threshold: Float, - ?id: :illicit_alcohol - ) -> void - - def to_hash: -> { id: :illicit_alcohol, flag: bool, threshold: Float } - end - - type illicit_firearms = - { id: :illicit_firearms, flag: bool, threshold: Float } - - class IllicitFirearms < ModerationAPI::Internal::Type::BaseModel - attr_accessor id: :illicit_firearms - - attr_accessor flag: bool - - attr_reader threshold: Float? - - def threshold=: (Float) -> Float - - def initialize: ( - flag: bool, - ?threshold: Float, - ?id: :illicit_firearms - ) -> void - - def to_hash: -> { - id: :illicit_firearms, - flag: bool, - threshold: Float - } - end - - type illicit_tobacco = - { id: :illicit_tobacco, flag: bool, threshold: Float } - - class IllicitTobacco < ModerationAPI::Internal::Type::BaseModel - attr_accessor id: :illicit_tobacco - - attr_accessor flag: bool - - attr_reader threshold: Float? - - def threshold=: (Float) -> Float - - def initialize: ( - flag: bool, - ?threshold: Float, - ?id: :illicit_tobacco - ) -> void - - def to_hash: -> { id: :illicit_tobacco, flag: bool, threshold: Float } - end - - type illicit_gambling = - { id: :illicit_gambling, flag: bool, threshold: Float } - - class IllicitGambling < ModerationAPI::Internal::Type::BaseModel - attr_accessor id: :illicit_gambling - - attr_accessor flag: bool - - attr_reader threshold: Float? - - def threshold=: (Float) -> Float - - def initialize: ( - flag: bool, - ?threshold: Float, - ?id: :illicit_gambling - ) -> void - - def to_hash: -> { - id: :illicit_gambling, - flag: bool, - threshold: Float - } - end - - type cannabis = { id: :cannabis, flag: bool, threshold: Float } - - class Cannabis < ModerationAPI::Internal::Type::BaseModel - attr_accessor id: :cannabis - - attr_accessor flag: bool - - attr_reader threshold: Float? - - def threshold=: (Float) -> Float - - def initialize: ( - flag: bool, - ?threshold: Float, - ?id: :cannabis - ) -> void - - def to_hash: -> { id: :cannabis, flag: bool, threshold: Float } - end - - type adult = { id: :adult, flag: bool, threshold: Float } - - class Adult < ModerationAPI::Internal::Type::BaseModel - attr_accessor id: :adult - - attr_accessor flag: bool - - attr_reader threshold: Float? - - def threshold=: (Float) -> Float - - def initialize: (flag: bool, ?threshold: Float, ?id: :adult) -> void - - def to_hash: -> { id: :adult, flag: bool, threshold: Float } - end - - type crypto = { id: :crypto, flag: bool, threshold: Float } - - class Crypto < ModerationAPI::Internal::Type::BaseModel - attr_accessor id: :crypto - - attr_accessor flag: bool - - attr_reader threshold: Float? - - def threshold=: (Float) -> Float - - def initialize: (flag: bool, ?threshold: Float, ?id: :crypto) -> void - - def to_hash: -> { id: :crypto, flag: bool, threshold: Float } - end - - type sexual = { id: :sexual, flag: bool, threshold: Float } - - class Sexual < ModerationAPI::Internal::Type::BaseModel - attr_accessor id: :sexual - - attr_accessor flag: bool - - attr_reader threshold: Float? - - def threshold=: (Float) -> Float - - def initialize: (flag: bool, ?threshold: Float, ?id: :sexual) -> void - - def to_hash: -> { id: :sexual, flag: bool, threshold: Float } - end - - type sexual_minors = - { id: :sexual_minors, flag: bool, threshold: Float } - - class SexualMinors < ModerationAPI::Internal::Type::BaseModel - attr_accessor id: :sexual_minors - - attr_accessor flag: bool - - attr_reader threshold: Float? - - def threshold=: (Float) -> Float - - def initialize: ( - flag: bool, - ?threshold: Float, - ?id: :sexual_minors - ) -> void - - def to_hash: -> { id: :sexual_minors, flag: bool, threshold: Float } - end - - type flirtation = { id: :flirtation, flag: bool, threshold: Float } - - class Flirtation < ModerationAPI::Internal::Type::BaseModel - attr_accessor id: :flirtation - - attr_accessor flag: bool - - attr_reader threshold: Float? - - def threshold=: (Float) -> Float - - def initialize: ( - flag: bool, - ?threshold: Float, - ?id: :flirtation - ) -> void - - def to_hash: -> { id: :flirtation, flag: bool, threshold: Float } - end - - type profanity = { id: :profanity, flag: bool, threshold: Float } - - class Profanity < ModerationAPI::Internal::Type::BaseModel - attr_accessor id: :profanity - - attr_accessor flag: bool - - attr_reader threshold: Float? - - def threshold=: (Float) -> Float - - def initialize: ( - flag: bool, - ?threshold: Float, - ?id: :profanity - ) -> void - - def to_hash: -> { id: :profanity, flag: bool, threshold: Float } - end - - type violence = { id: :violence, flag: bool, threshold: Float } - - class Violence < ModerationAPI::Internal::Type::BaseModel - attr_accessor id: :violence - - attr_accessor flag: bool - - attr_reader threshold: Float? - - def threshold=: (Float) -> Float - - def initialize: ( - flag: bool, - ?threshold: Float, - ?id: :violence - ) -> void - - def to_hash: -> { id: :violence, flag: bool, threshold: Float } - end - - type self_harm = { id: :self_harm, flag: bool, threshold: Float } - - class SelfHarm < ModerationAPI::Internal::Type::BaseModel - attr_accessor id: :self_harm - - attr_accessor flag: bool - - attr_reader threshold: Float? - - def threshold=: (Float) -> Float - - def initialize: ( - flag: bool, - ?threshold: Float, - ?id: :self_harm - ) -> void - - def to_hash: -> { id: :self_harm, flag: bool, threshold: Float } - end - - type spam = { id: :spam, flag: bool, threshold: Float } - - class Spam < ModerationAPI::Internal::Type::BaseModel - attr_accessor id: :spam - - attr_accessor flag: bool - - attr_reader threshold: Float? - - def threshold=: (Float) -> Float - - def initialize: (flag: bool, ?threshold: Float, ?id: :spam) -> void - - def to_hash: -> { id: :spam, flag: bool, threshold: Float } - end - - type low_quality_content = - { id: :low_quality, flag: bool, min_words: Integer, threshold: Float } - - class LowQualityContent < ModerationAPI::Internal::Type::BaseModel - attr_accessor id: :low_quality - - attr_accessor flag: bool - - attr_reader min_words: Integer? - - def min_words=: (Integer) -> Integer - - attr_reader threshold: Float? - - def threshold=: (Float) -> Float - - def initialize: ( - flag: bool, - ?min_words: Integer, - ?threshold: Float, - ?id: :low_quality - ) -> void - - def to_hash: -> { - id: :low_quality, - flag: bool, - min_words: Integer, - threshold: Float - } - end - - type face_detection = - { - id: :face_detection, - flag: bool, - comparator: ModerationAPI::Models::ContentSubmitParams::Policy::FaceDetection::comparator, - count: Integer, - threshold: Float - } - - class FaceDetection < ModerationAPI::Internal::Type::BaseModel - attr_accessor id: :face_detection - - attr_accessor flag: bool - - attr_reader comparator: ModerationAPI::Models::ContentSubmitParams::Policy::FaceDetection::comparator? - - def comparator=: ( - ModerationAPI::Models::ContentSubmitParams::Policy::FaceDetection::comparator - ) -> ModerationAPI::Models::ContentSubmitParams::Policy::FaceDetection::comparator - - attr_reader count: Integer? - - def count=: (Integer) -> Integer - - attr_reader threshold: Float? - - def threshold=: (Float) -> Float - - def initialize: ( - flag: bool, - ?comparator: ModerationAPI::Models::ContentSubmitParams::Policy::FaceDetection::comparator, - ?count: Integer, - ?threshold: Float, - ?id: :face_detection - ) -> void - - def to_hash: -> { - id: :face_detection, - flag: bool, - comparator: ModerationAPI::Models::ContentSubmitParams::Policy::FaceDetection::comparator, - count: Integer, - threshold: Float - } - - type comparator = :at_least | :fewer_than - - module Comparator - extend ModerationAPI::Internal::Type::Enum - - AT_LEAST: :at_least - FEWER_THAN: :fewer_than - - def self?.values: -> ::Array[ModerationAPI::Models::ContentSubmitParams::Policy::FaceDetection::comparator] - end - end - - type self_promotion = - { id: :self_promotion, flag: bool, threshold: Float } - - class SelfPromotion < ModerationAPI::Internal::Type::BaseModel - attr_accessor id: :self_promotion - - attr_accessor flag: bool - - attr_reader threshold: Float? - - def threshold=: (Float) -> Float - - def initialize: ( - flag: bool, - ?threshold: Float, - ?id: :self_promotion - ) -> void - - def to_hash: -> { id: :self_promotion, flag: bool, threshold: Float } - end - - type political = { id: :political, flag: bool, threshold: Float } - - class Political < ModerationAPI::Internal::Type::BaseModel - attr_accessor id: :political - - attr_accessor flag: bool - - attr_reader threshold: Float? - - def threshold=: (Float) -> Float - - def initialize: ( - flag: bool, - ?threshold: Float, - ?id: :political - ) -> void - - def to_hash: -> { id: :political, flag: bool, threshold: Float } - end - - type religion = { id: :religion, flag: bool, threshold: Float } - - class Religion < ModerationAPI::Internal::Type::BaseModel - attr_accessor id: :religion - - attr_accessor flag: bool - - attr_reader threshold: Float? - - def threshold=: (Float) -> Float - - def initialize: ( - flag: bool, - ?threshold: Float, - ?id: :religion - ) -> void - - def to_hash: -> { id: :religion, flag: bool, threshold: Float } - end - - type code_abuse = { id: :code_abuse, flag: bool, threshold: Float } - - class CodeAbuse < ModerationAPI::Internal::Type::BaseModel - attr_accessor id: :code_abuse - - attr_accessor flag: bool - - attr_reader threshold: Float? - - def threshold=: (Float) -> Float - - def initialize: ( - flag: bool, - ?threshold: Float, - ?id: :code_abuse - ) -> void - - def to_hash: -> { id: :code_abuse, flag: bool, threshold: Float } - end - - type unicode_spoofing = - { - id: :unicode_spoofing, - flag: bool, - signals: ::Hash[Symbol, ModerationAPI::ContentSubmitParams::Policy::UnicodeSpoofing::Signal], - threshold: Float - } - - class UnicodeSpoofing < ModerationAPI::Internal::Type::BaseModel - attr_accessor id: :unicode_spoofing - - attr_accessor flag: bool - - attr_reader signals: ::Hash[Symbol, ModerationAPI::ContentSubmitParams::Policy::UnicodeSpoofing::Signal]? - - def signals=: ( - ::Hash[Symbol, ModerationAPI::ContentSubmitParams::Policy::UnicodeSpoofing::Signal] - ) -> ::Hash[Symbol, ModerationAPI::ContentSubmitParams::Policy::UnicodeSpoofing::Signal] - - attr_reader threshold: Float? - - def threshold=: (Float) -> Float - - def initialize: ( - flag: bool, - ?signals: ::Hash[Symbol, ModerationAPI::ContentSubmitParams::Policy::UnicodeSpoofing::Signal], - ?threshold: Float, - ?id: :unicode_spoofing - ) -> void - - def to_hash: -> { - id: :unicode_spoofing, - flag: bool, - signals: ::Hash[Symbol, ModerationAPI::ContentSubmitParams::Policy::UnicodeSpoofing::Signal], - threshold: Float - } - - type signal = { flag: bool } - - class Signal < ModerationAPI::Internal::Type::BaseModel - attr_reader flag: bool? - - def flag=: (bool) -> bool - - def initialize: (?flag: bool) -> void - - def to_hash: -> { flag: bool } - end - end - - type pii_masking = - { - id: :pii, - entities: ::Hash[Symbol, ModerationAPI::ContentSubmitParams::Policy::PiiMasking::Entity] - } - - class PiiMasking < ModerationAPI::Internal::Type::BaseModel - attr_accessor id: :pii - - attr_accessor entities: ::Hash[Symbol, ModerationAPI::ContentSubmitParams::Policy::PiiMasking::Entity] - - def initialize: ( - entities: ::Hash[Symbol, ModerationAPI::ContentSubmitParams::Policy::PiiMasking::Entity], - ?id: :pii - ) -> void - - def to_hash: -> { - id: :pii, - entities: ::Hash[Symbol, ModerationAPI::ContentSubmitParams::Policy::PiiMasking::Entity] - } - - type entity = - { enable: bool, flag: bool, mask: String, should_mask: bool } - - class Entity < ModerationAPI::Internal::Type::BaseModel - attr_reader enable: bool? - - def enable=: (bool) -> bool - - attr_reader flag: bool? - - def flag=: (bool) -> bool - - attr_reader mask: String? - - def mask=: (String) -> String - - attr_reader should_mask: bool? - - def should_mask=: (bool) -> bool - - def initialize: ( - ?enable: bool, - ?flag: bool, - ?mask: String, - ?should_mask: bool - ) -> void - - def to_hash: -> { - enable: bool, - flag: bool, - mask: String, - should_mask: bool - } - end - end - - type url_masking = - { - id: :url, - entities: ::Hash[Symbol, ModerationAPI::ContentSubmitParams::Policy::URLMasking::Entity] - } - - class URLMasking < ModerationAPI::Internal::Type::BaseModel - attr_accessor id: :url - - attr_accessor entities: ::Hash[Symbol, ModerationAPI::ContentSubmitParams::Policy::URLMasking::Entity] - - def initialize: ( - entities: ::Hash[Symbol, ModerationAPI::ContentSubmitParams::Policy::URLMasking::Entity], - ?id: :url - ) -> void - - def to_hash: -> { - id: :url, - entities: ::Hash[Symbol, ModerationAPI::ContentSubmitParams::Policy::URLMasking::Entity] - } - - type entity = - { enable: bool, flag: bool, mask: String, should_mask: bool } - - class Entity < ModerationAPI::Internal::Type::BaseModel - attr_reader enable: bool? - - def enable=: (bool) -> bool - - attr_reader flag: bool? - - def flag=: (bool) -> bool - - attr_reader mask: String? - - def mask=: (String) -> String - - attr_reader should_mask: bool? - - def should_mask=: (bool) -> bool - - def initialize: ( - ?enable: bool, - ?flag: bool, - ?mask: String, - ?should_mask: bool - ) -> void - - def to_hash: -> { - enable: bool, - flag: bool, - mask: String, - should_mask: bool - } - end - end - - type url_risk = - { - id: :url_risk, - flag: bool, - allowlist_wordlist_ids: ::Array[String], - blocklist_wordlist_ids: ::Array[String], - flag_link_shorteners: bool, - threshold: Float - } - - class URLRisk < ModerationAPI::Internal::Type::BaseModel - attr_accessor id: :url_risk - - attr_accessor flag: bool - - attr_reader allowlist_wordlist_ids: ::Array[String]? - - def allowlist_wordlist_ids=: (::Array[String]) -> ::Array[String] - - attr_reader blocklist_wordlist_ids: ::Array[String]? - - def blocklist_wordlist_ids=: (::Array[String]) -> ::Array[String] - - attr_reader flag_link_shorteners: bool? - - def flag_link_shorteners=: (bool) -> bool - - attr_reader threshold: Float? - - def threshold=: (Float) -> Float - - def initialize: ( - flag: bool, - ?allowlist_wordlist_ids: ::Array[String], - ?blocklist_wordlist_ids: ::Array[String], - ?flag_link_shorteners: bool, - ?threshold: Float, - ?id: :url_risk - ) -> void - - def to_hash: -> { - id: :url_risk, - flag: bool, - allowlist_wordlist_ids: ::Array[String], - blocklist_wordlist_ids: ::Array[String], - flag_link_shorteners: bool, - threshold: Float - } - end - - type guideline = - { - id: :guideline, - flag: bool, - guideline_key: String, - instructions: String, - threshold: Float - } - - class Guideline < ModerationAPI::Internal::Type::BaseModel - attr_accessor id: :guideline - - attr_accessor flag: bool - - attr_accessor guideline_key: String - - attr_accessor instructions: String - - attr_reader threshold: Float? - - def threshold=: (Float) -> Float - - def initialize: ( - flag: bool, - guideline_key: String, - instructions: String, - ?threshold: Float, - ?id: :guideline - ) -> void - - def to_hash: -> { - id: :guideline, - flag: bool, - guideline_key: String, - instructions: String, - threshold: Float - } - end - - def self?.variants: -> ::Array[ModerationAPI::Models::ContentSubmitParams::policy] - end - end - end -end diff --git a/sig/moderation_api/models/content_submit_response.rbs b/sig/moderation_api/models/content_submit_response.rbs deleted file mode 100644 index 78b87041..00000000 --- a/sig/moderation_api/models/content_submit_response.rbs +++ /dev/null @@ -1,878 +0,0 @@ -module ModerationAPI - module Models - type content_submit_response = - { - author: ModerationAPI::Models::ContentSubmitResponse::Author?, - casebook: ModerationAPI::Models::ContentSubmitResponse::Casebook?, - content: ModerationAPI::Models::ContentSubmitResponse::Content, - evaluation: ModerationAPI::Models::ContentSubmitResponse::Evaluation, - insights: ::Array[ModerationAPI::Models::ContentSubmitResponse::insight], - meta: ModerationAPI::Models::ContentSubmitResponse::Meta, - policies: ::Array[ModerationAPI::Models::ContentSubmitResponse::policy], - recommendation: ModerationAPI::Models::ContentSubmitResponse::Recommendation, - errors: ::Array[ModerationAPI::Models::ContentSubmitResponse::Error] - } - - class ContentSubmitResponse < ModerationAPI::Internal::Type::BaseModel - attr_accessor author: ModerationAPI::Models::ContentSubmitResponse::Author? - - attr_accessor casebook: ModerationAPI::Models::ContentSubmitResponse::Casebook? - - attr_accessor content: ModerationAPI::Models::ContentSubmitResponse::Content - - attr_accessor evaluation: ModerationAPI::Models::ContentSubmitResponse::Evaluation - - attr_accessor insights: ::Array[ModerationAPI::Models::ContentSubmitResponse::insight] - - attr_accessor meta: ModerationAPI::Models::ContentSubmitResponse::Meta - - attr_accessor policies: ::Array[ModerationAPI::Models::ContentSubmitResponse::policy] - - attr_accessor recommendation: ModerationAPI::Models::ContentSubmitResponse::Recommendation - - attr_reader errors: ::Array[ModerationAPI::Models::ContentSubmitResponse::Error]? - - def errors=: ( - ::Array[ModerationAPI::Models::ContentSubmitResponse::Error] - ) -> ::Array[ModerationAPI::Models::ContentSubmitResponse::Error] - - def initialize: ( - author: ModerationAPI::Models::ContentSubmitResponse::Author?, - casebook: ModerationAPI::Models::ContentSubmitResponse::Casebook?, - content: ModerationAPI::Models::ContentSubmitResponse::Content, - evaluation: ModerationAPI::Models::ContentSubmitResponse::Evaluation, - insights: ::Array[ModerationAPI::Models::ContentSubmitResponse::insight], - meta: ModerationAPI::Models::ContentSubmitResponse::Meta, - policies: ::Array[ModerationAPI::Models::ContentSubmitResponse::policy], - recommendation: ModerationAPI::Models::ContentSubmitResponse::Recommendation, - ?errors: ::Array[ModerationAPI::Models::ContentSubmitResponse::Error] - ) -> void - - def to_hash: -> { - author: ModerationAPI::Models::ContentSubmitResponse::Author?, - casebook: ModerationAPI::Models::ContentSubmitResponse::Casebook?, - content: ModerationAPI::Models::ContentSubmitResponse::Content, - evaluation: ModerationAPI::Models::ContentSubmitResponse::Evaluation, - insights: ::Array[ModerationAPI::Models::ContentSubmitResponse::insight], - meta: ModerationAPI::Models::ContentSubmitResponse::Meta, - policies: ::Array[ModerationAPI::Models::ContentSubmitResponse::policy], - recommendation: ModerationAPI::Models::ContentSubmitResponse::Recommendation, - errors: ::Array[ModerationAPI::Models::ContentSubmitResponse::Error] - } - - type author = - { - id: String, - block: ModerationAPI::Models::ContentSubmitResponse::Author::Block?, - status: ModerationAPI::Models::ContentSubmitResponse::Author::status, - trust_level: ModerationAPI::Models::ContentSubmitResponse::Author::TrustLevel, - external_id: String? - } - - class Author < ModerationAPI::Internal::Type::BaseModel - attr_accessor id: String - - attr_accessor block: ModerationAPI::Models::ContentSubmitResponse::Author::Block? - - attr_accessor status: ModerationAPI::Models::ContentSubmitResponse::Author::status - - attr_accessor trust_level: ModerationAPI::Models::ContentSubmitResponse::Author::TrustLevel - - attr_accessor external_id: String? - - def initialize: ( - id: String, - block: ModerationAPI::Models::ContentSubmitResponse::Author::Block?, - status: ModerationAPI::Models::ContentSubmitResponse::Author::status, - trust_level: ModerationAPI::Models::ContentSubmitResponse::Author::TrustLevel, - ?external_id: String? - ) -> void - - def to_hash: -> { - id: String, - block: ModerationAPI::Models::ContentSubmitResponse::Author::Block?, - status: ModerationAPI::Models::ContentSubmitResponse::Author::status, - trust_level: ModerationAPI::Models::ContentSubmitResponse::Author::TrustLevel, - external_id: String? - } - - type block = { reason: String?, until_: Float? } - - class Block < ModerationAPI::Internal::Type::BaseModel - attr_accessor reason: String? - - attr_accessor until_: Float? - - def initialize: (?reason: String?, ?until_: Float?) -> void - - def to_hash: -> { reason: String?, until_: Float? } - end - - type status = :enabled | :suspended | :blocked - - module Status - extend ModerationAPI::Internal::Type::Enum - - ENABLED: :enabled - SUSPENDED: :suspended - BLOCKED: :blocked - - def self?.values: -> ::Array[ModerationAPI::Models::ContentSubmitResponse::Author::status] - end - - type trust_level = { level: Float, manual: bool } - - class TrustLevel < ModerationAPI::Internal::Type::BaseModel - attr_accessor level: Float - - attr_accessor manual: bool - - def initialize: (level: Float, manual: bool) -> void - - def to_hash: -> { level: Float, manual: bool } - end - end - - type casebook = - { - agreement: Float, - case_count: Float, - confidence: Float, - similarity: Float, - topic: ModerationAPI::Models::ContentSubmitResponse::Casebook::Topic?, - verdict: ModerationAPI::Models::ContentSubmitResponse::Casebook::verdict - } - - class Casebook < ModerationAPI::Internal::Type::BaseModel - attr_accessor agreement: Float - - attr_accessor case_count: Float - - attr_accessor confidence: Float - - attr_accessor similarity: Float - - attr_accessor topic: ModerationAPI::Models::ContentSubmitResponse::Casebook::Topic? - - attr_accessor verdict: ModerationAPI::Models::ContentSubmitResponse::Casebook::verdict - - def initialize: ( - agreement: Float, - case_count: Float, - confidence: Float, - similarity: Float, - topic: ModerationAPI::Models::ContentSubmitResponse::Casebook::Topic?, - verdict: ModerationAPI::Models::ContentSubmitResponse::Casebook::verdict - ) -> void - - def to_hash: -> { - agreement: Float, - case_count: Float, - confidence: Float, - similarity: Float, - topic: ModerationAPI::Models::ContentSubmitResponse::Casebook::Topic?, - verdict: ModerationAPI::Models::ContentSubmitResponse::Casebook::verdict - } - - type topic = { id: String, label: String } - - class Topic < ModerationAPI::Internal::Type::BaseModel - attr_accessor id: String - - attr_accessor label: String - - def initialize: (id: String, label: String) -> void - - def to_hash: -> { id: String, label: String } - end - - type verdict = :allow | :reject - - module Verdict - extend ModerationAPI::Internal::Type::Enum - - ALLOW: :allow - REJECT: :reject - - def self?.values: -> ::Array[ModerationAPI::Models::ContentSubmitResponse::Casebook::verdict] - end - end - - type content = - { - id: String, - masked: bool, - modified: ModerationAPI::Models::ContentSubmitResponse::Content::modified?, - unicode_cleaned: bool, - transcript: String? - } - - class Content < ModerationAPI::Internal::Type::BaseModel - attr_accessor id: String - - attr_accessor masked: bool - - attr_accessor modified: ModerationAPI::Models::ContentSubmitResponse::Content::modified? - - attr_accessor unicode_cleaned: bool - - attr_accessor transcript: String? - - def initialize: ( - id: String, - masked: bool, - modified: ModerationAPI::Models::ContentSubmitResponse::Content::modified?, - unicode_cleaned: bool, - ?transcript: String? - ) -> void - - def to_hash: -> { - id: String, - masked: bool, - modified: ModerationAPI::Models::ContentSubmitResponse::Content::modified?, - unicode_cleaned: bool, - transcript: String? - } - - type modified = - String - | ::Hash[Symbol, top] - | ::Hash[Symbol, ModerationAPI::Models::ContentSubmitResponse::Content::Modified::modified_nested_object_content] - - module Modified - extend ModerationAPI::Internal::Type::Union - - type modified_nested_object_content = - ModerationAPI::Models::ContentSubmitResponse::Content::Modified::ModifiedNestedObjectContent::Text - | ModerationAPI::Models::ContentSubmitResponse::Content::Modified::ModifiedNestedObjectContent::Image - | ModerationAPI::Models::ContentSubmitResponse::Content::Modified::ModifiedNestedObjectContent::Video - | ModerationAPI::Models::ContentSubmitResponse::Content::Modified::ModifiedNestedObjectContent::Audio - - module ModifiedNestedObjectContent - extend ModerationAPI::Internal::Type::Union - - type text = { text: String, type: :text } - - class Text < ModerationAPI::Internal::Type::BaseModel - attr_accessor text: String - - attr_accessor type: :text - - def initialize: (text: String, ?type: :text) -> void - - def to_hash: -> { text: String, type: :text } - end - - type image = { type: :image, data: String, url: String } - - class Image < ModerationAPI::Internal::Type::BaseModel - attr_accessor type: :image - - attr_reader data: String? - - def data=: (String) -> String - - attr_reader url: String? - - def url=: (String) -> String - - def initialize: ( - ?data: String, - ?url: String, - ?type: :image - ) -> void - - def to_hash: -> { type: :image, data: String, url: String } - end - - type video = { type: :video, url: String } - - class Video < ModerationAPI::Internal::Type::BaseModel - attr_accessor type: :video - - attr_accessor url: String - - def initialize: (url: String, ?type: :video) -> void - - def to_hash: -> { type: :video, url: String } - end - - type audio = { type: :audio, url: String } - - class Audio < ModerationAPI::Internal::Type::BaseModel - attr_accessor type: :audio - - attr_accessor url: String - - def initialize: (url: String, ?type: :audio) -> void - - def to_hash: -> { type: :audio, url: String } - end - - def self?.variants: -> ::Array[ModerationAPI::Models::ContentSubmitResponse::Content::Modified::modified_nested_object_content] - end - - def self?.variants: -> ::Array[ModerationAPI::Models::ContentSubmitResponse::Content::modified] - - ModifiedObjectContentMap: ModerationAPI::Internal::Type::Converter - - ModifiedNestedObjectContentMap: ModerationAPI::Internal::Type::Converter - end - end - - type evaluation = - { - flag_probability: Float, - flagged: bool, - severity_score: Float, - shadow_flagged: bool, - unicode_spoofed: bool - } - - class Evaluation < ModerationAPI::Internal::Type::BaseModel - attr_accessor flag_probability: Float - - attr_accessor flagged: bool - - attr_accessor severity_score: Float - - attr_reader shadow_flagged: bool? - - def shadow_flagged=: (bool) -> bool - - attr_reader unicode_spoofed: bool? - - def unicode_spoofed=: (bool) -> bool - - def initialize: ( - flag_probability: Float, - flagged: bool, - severity_score: Float, - ?shadow_flagged: bool, - ?unicode_spoofed: bool - ) -> void - - def to_hash: -> { - flag_probability: Float, - flagged: bool, - severity_score: Float, - shadow_flagged: bool, - unicode_spoofed: bool - } - end - - type insight = - ModerationAPI::Models::ContentSubmitResponse::Insight::SentimentInsight - | ModerationAPI::Models::ContentSubmitResponse::Insight::LanguageInsight - - module Insight - extend ModerationAPI::Internal::Type::Union - - type sentiment_insight = - { - id: :sentiment, - probability: Float, - type: :insight, - value: ModerationAPI::Models::ContentSubmitResponse::Insight::SentimentInsight::value? - } - - class SentimentInsight < ModerationAPI::Internal::Type::BaseModel - attr_accessor id: :sentiment - - attr_accessor probability: Float - - attr_accessor type: :insight - - attr_accessor value: ModerationAPI::Models::ContentSubmitResponse::Insight::SentimentInsight::value? - - def initialize: ( - probability: Float, - value: ModerationAPI::Models::ContentSubmitResponse::Insight::SentimentInsight::value?, - ?id: :sentiment, - ?type: :insight - ) -> void - - def to_hash: -> { - id: :sentiment, - probability: Float, - type: :insight, - value: ModerationAPI::Models::ContentSubmitResponse::Insight::SentimentInsight::value? - } - - type value = :positive | :neutral | :negative - - module Value - extend ModerationAPI::Internal::Type::Enum - - POSITIVE: :positive - NEUTRAL: :neutral - NEGATIVE: :negative - - def self?.values: -> ::Array[ModerationAPI::Models::ContentSubmitResponse::Insight::SentimentInsight::value] - end - end - - type language_insight = - { id: :language, probability: Float, type: :insight, value: String? } - - class LanguageInsight < ModerationAPI::Internal::Type::BaseModel - attr_accessor id: :language - - attr_accessor probability: Float - - attr_accessor type: :insight - - attr_accessor value: String? - - def initialize: ( - probability: Float, - value: String?, - ?id: :language, - ?type: :insight - ) -> void - - def to_hash: -> { - id: :language, - probability: Float, - type: :insight, - value: String? - } - end - - def self?.variants: -> ::Array[ModerationAPI::Models::ContentSubmitResponse::insight] - end - - type meta = - { - channel_key: String, - status: ModerationAPI::Models::ContentSubmitResponse::Meta::status, - timestamp: Float, - usage: Float, - processing_time: String - } - - class Meta < ModerationAPI::Internal::Type::BaseModel - attr_accessor channel_key: String - - attr_accessor status: ModerationAPI::Models::ContentSubmitResponse::Meta::status - - attr_accessor timestamp: Float - - attr_accessor usage: Float - - attr_reader processing_time: String? - - def processing_time=: (String) -> String - - def initialize: ( - channel_key: String, - status: ModerationAPI::Models::ContentSubmitResponse::Meta::status, - timestamp: Float, - usage: Float, - ?processing_time: String - ) -> void - - def to_hash: -> { - channel_key: String, - status: ModerationAPI::Models::ContentSubmitResponse::Meta::status, - timestamp: Float, - usage: Float, - processing_time: String - } - - type status = :success | :partial_success - - module Status - extend ModerationAPI::Internal::Type::Enum - - SUCCESS: :success - PARTIAL_SUCCESS: :partial_success - - def self?.values: -> ::Array[ModerationAPI::Models::ContentSubmitResponse::Meta::status] - end - end - - type policy = - ModerationAPI::Models::ContentSubmitResponse::Policy::ClassifierOutput - | ModerationAPI::Models::ContentSubmitResponse::Policy::EntityMatcherOutput - - module Policy - extend ModerationAPI::Internal::Type::Union - - type classifier_output = - { - id: String, - flagged: bool, - probability: Float, - type: :classifier, - data: ::Hash[Symbol, top], - flagged_fields: ::Array[String], - labels: ::Array[ModerationAPI::Models::ContentSubmitResponse::Policy::ClassifierOutput::Label] - } - - class ClassifierOutput < ModerationAPI::Internal::Type::BaseModel - attr_accessor id: String - - attr_accessor flagged: bool - - attr_accessor probability: Float - - attr_accessor type: :classifier - - attr_reader data: ::Hash[Symbol, top]? - - def data=: (::Hash[Symbol, top]) -> ::Hash[Symbol, top] - - attr_reader flagged_fields: ::Array[String]? - - def flagged_fields=: (::Array[String]) -> ::Array[String] - - attr_reader labels: ::Array[ModerationAPI::Models::ContentSubmitResponse::Policy::ClassifierOutput::Label]? - - def labels=: ( - ::Array[ModerationAPI::Models::ContentSubmitResponse::Policy::ClassifierOutput::Label] - ) -> ::Array[ModerationAPI::Models::ContentSubmitResponse::Policy::ClassifierOutput::Label] - - def initialize: ( - id: String, - flagged: bool, - probability: Float, - ?data: ::Hash[Symbol, top], - ?flagged_fields: ::Array[String], - ?labels: ::Array[ModerationAPI::Models::ContentSubmitResponse::Policy::ClassifierOutput::Label], - ?type: :classifier - ) -> void - - def to_hash: -> { - id: String, - flagged: bool, - probability: Float, - type: :classifier, - data: ::Hash[Symbol, top], - flagged_fields: ::Array[String], - labels: ::Array[ModerationAPI::Models::ContentSubmitResponse::Policy::ClassifierOutput::Label] - } - - type label = - { - id: String, - flagged: bool, - probability: Float, - shadow_flagged: bool - } - - class Label < ModerationAPI::Internal::Type::BaseModel - attr_accessor id: String - - attr_accessor flagged: bool - - attr_accessor probability: Float - - attr_reader shadow_flagged: bool? - - def shadow_flagged=: (bool) -> bool - - def initialize: ( - id: String, - flagged: bool, - probability: Float, - ?shadow_flagged: bool - ) -> void - - def to_hash: -> { - id: String, - flagged: bool, - probability: Float, - shadow_flagged: bool - } - end - end - - type entity_matcher_output = - { - id: String, - flagged: bool, - matches: ::Array[ModerationAPI::Models::ContentSubmitResponse::Policy::EntityMatcherOutput::Match], - probability: Float, - type: :entity_matcher, - flagged_fields: ::Array[String] - } - - class EntityMatcherOutput < ModerationAPI::Internal::Type::BaseModel - attr_accessor id: String - - attr_accessor flagged: bool - - attr_accessor matches: ::Array[ModerationAPI::Models::ContentSubmitResponse::Policy::EntityMatcherOutput::Match] - - attr_accessor probability: Float - - attr_accessor type: :entity_matcher - - attr_reader flagged_fields: ::Array[String]? - - def flagged_fields=: (::Array[String]) -> ::Array[String] - - def initialize: ( - id: String, - flagged: bool, - matches: ::Array[ModerationAPI::Models::ContentSubmitResponse::Policy::EntityMatcherOutput::Match], - probability: Float, - ?flagged_fields: ::Array[String], - ?type: :entity_matcher - ) -> void - - def to_hash: -> { - id: String, - flagged: bool, - matches: ::Array[ModerationAPI::Models::ContentSubmitResponse::Policy::EntityMatcherOutput::Match], - probability: Float, - type: :entity_matcher, - flagged_fields: ::Array[String] - } - - type match = - { - match: String, - probability: Float, - span: ::Array[Integer], - entity_type: String, - reasons: ::Array[String], - signals: ModerationAPI::Models::ContentSubmitResponse::Policy::EntityMatcherOutput::Match::Signals - } - - class Match < ModerationAPI::Internal::Type::BaseModel - attr_accessor match: String - - attr_accessor probability: Float - - attr_accessor span: ::Array[Integer] - - attr_reader entity_type: String? - - def entity_type=: (String) -> String - - attr_reader reasons: ::Array[String]? - - def reasons=: (::Array[String]) -> ::Array[String] - - attr_reader signals: ModerationAPI::Models::ContentSubmitResponse::Policy::EntityMatcherOutput::Match::Signals? - - def signals=: ( - ModerationAPI::Models::ContentSubmitResponse::Policy::EntityMatcherOutput::Match::Signals - ) -> ModerationAPI::Models::ContentSubmitResponse::Policy::EntityMatcherOutput::Match::Signals - - def initialize: ( - match: String, - probability: Float, - span: ::Array[Integer], - ?entity_type: String, - ?reasons: ::Array[String], - ?signals: ModerationAPI::Models::ContentSubmitResponse::Policy::EntityMatcherOutput::Match::Signals - ) -> void - - def to_hash: -> { - match: String, - probability: Float, - span: ::Array[Integer], - entity_type: String, - reasons: ::Array[String], - signals: ModerationAPI::Models::ContentSubmitResponse::Policy::EntityMatcherOutput::Match::Signals - } - - type signals = - { - bot_protection: bool?, - brand_impersonation: ModerationAPI::Models::ContentSubmitResponse::Policy::EntityMatcherOutput::Match::Signals::BrandImpersonation?, - domain_age_days: Integer?, - final_url: String?, - has_email_setup: bool?, - has_suspicious_characters: bool, - is_link_shortener: bool, - is_reported: bool, - redirect_count: Integer? - } - - class Signals < ModerationAPI::Internal::Type::BaseModel - attr_accessor bot_protection: bool? - - attr_accessor brand_impersonation: ModerationAPI::Models::ContentSubmitResponse::Policy::EntityMatcherOutput::Match::Signals::BrandImpersonation? - - attr_accessor domain_age_days: Integer? - - attr_accessor final_url: String? - - attr_accessor has_email_setup: bool? - - attr_accessor has_suspicious_characters: bool - - attr_accessor is_link_shortener: bool - - attr_accessor is_reported: bool - - attr_accessor redirect_count: Integer? - - def initialize: ( - bot_protection: bool?, - brand_impersonation: ModerationAPI::Models::ContentSubmitResponse::Policy::EntityMatcherOutput::Match::Signals::BrandImpersonation?, - domain_age_days: Integer?, - final_url: String?, - has_email_setup: bool?, - has_suspicious_characters: bool, - is_link_shortener: bool, - is_reported: bool, - redirect_count: Integer? - ) -> void - - def to_hash: -> { - bot_protection: bool?, - brand_impersonation: ModerationAPI::Models::ContentSubmitResponse::Policy::EntityMatcherOutput::Match::Signals::BrandImpersonation?, - domain_age_days: Integer?, - final_url: String?, - has_email_setup: bool?, - has_suspicious_characters: bool, - is_link_shortener: bool, - is_reported: bool, - redirect_count: Integer? - } - - type brand_impersonation = - { - brand: String, - method_: ModerationAPI::Models::ContentSubmitResponse::Policy::EntityMatcherOutput::Match::Signals::BrandImpersonation::method_ - } - - class BrandImpersonation < ModerationAPI::Internal::Type::BaseModel - attr_accessor brand: String - - attr_accessor method_: ModerationAPI::Models::ContentSubmitResponse::Policy::EntityMatcherOutput::Match::Signals::BrandImpersonation::method_ - - def initialize: ( - brand: String, - method_: ModerationAPI::Models::ContentSubmitResponse::Policy::EntityMatcherOutput::Match::Signals::BrandImpersonation::method_ - ) -> void - - def to_hash: -> { - brand: String, - method_: ModerationAPI::Models::ContentSubmitResponse::Policy::EntityMatcherOutput::Match::Signals::BrandImpersonation::method_ - } - - type method_ = :registered_domain_token | :subdomain_token - - module Method - extend ModerationAPI::Internal::Type::Enum - - REGISTERED_DOMAIN_TOKEN: :registered_domain_token - SUBDOMAIN_TOKEN: :subdomain_token - - def self?.values: -> ::Array[ModerationAPI::Models::ContentSubmitResponse::Policy::EntityMatcherOutput::Match::Signals::BrandImpersonation::method_] - end - end - end - end - end - - def self?.variants: -> ::Array[ModerationAPI::Models::ContentSubmitResponse::policy] - end - - type recommendation = - { - action: ModerationAPI::Models::ContentSubmitResponse::Recommendation::action, - reason_codes: ::Array[ModerationAPI::Models::ContentSubmitResponse::Recommendation::reason_code], - matched_rules: ::Array[ModerationAPI::Models::ContentSubmitResponse::Recommendation::MatchedRule] - } - - class Recommendation < ModerationAPI::Internal::Type::BaseModel - attr_accessor action: ModerationAPI::Models::ContentSubmitResponse::Recommendation::action - - attr_accessor reason_codes: ::Array[ModerationAPI::Models::ContentSubmitResponse::Recommendation::reason_code] - - attr_reader matched_rules: ::Array[ModerationAPI::Models::ContentSubmitResponse::Recommendation::MatchedRule]? - - def matched_rules=: ( - ::Array[ModerationAPI::Models::ContentSubmitResponse::Recommendation::MatchedRule] - ) -> ::Array[ModerationAPI::Models::ContentSubmitResponse::Recommendation::MatchedRule] - - def initialize: ( - action: ModerationAPI::Models::ContentSubmitResponse::Recommendation::action, - reason_codes: ::Array[ModerationAPI::Models::ContentSubmitResponse::Recommendation::reason_code], - ?matched_rules: ::Array[ModerationAPI::Models::ContentSubmitResponse::Recommendation::MatchedRule] - ) -> void - - def to_hash: -> { - action: ModerationAPI::Models::ContentSubmitResponse::Recommendation::action, - reason_codes: ::Array[ModerationAPI::Models::ContentSubmitResponse::Recommendation::reason_code], - matched_rules: ::Array[ModerationAPI::Models::ContentSubmitResponse::Recommendation::MatchedRule] - } - - type action = :review | :allow | :reject - - module Action - extend ModerationAPI::Internal::Type::Enum - - REVIEW: :review - ALLOW: :allow - REJECT: :reject - - def self?.values: -> ::Array[ModerationAPI::Models::ContentSubmitResponse::Recommendation::action] - end - - type reason_code = - :severity_reject - | :severity_review - | :author_block - | :dry_run - | :trusted_allow - | :untrusted_severity - | :rule_match - | :rule_default - | :rule_fallback - | :client_override - | :casebook_match - | String - - module ReasonCode - extend ModerationAPI::Internal::Type::Union - - def self?.variants: -> ::Array[ModerationAPI::Models::ContentSubmitResponse::Recommendation::reason_code] - - SEVERITY_REJECT: :severity_reject - SEVERITY_REVIEW: :severity_review - AUTHOR_BLOCK: :author_block - DRY_RUN: :dry_run - TRUSTED_ALLOW: :trusted_allow - UNTRUSTED_SEVERITY: :untrusted_severity - RULE_MATCH: :rule_match - RULE_DEFAULT: :rule_default - RULE_FALLBACK: :rule_fallback - CLIENT_OVERRIDE: :client_override - CASEBOOK_MATCH: :casebook_match - end - - type matched_rule = { key: String, name: String } - - class MatchedRule < ModerationAPI::Internal::Type::BaseModel - attr_accessor key: String - - attr_accessor name: String - - def initialize: (key: String, name: String) -> void - - def to_hash: -> { key: String, name: String } - end - end - - type error = { id: String, message: String } - - class Error < ModerationAPI::Internal::Type::BaseModel - attr_accessor id: String - - attr_accessor message: String - - def initialize: (id: String, message: String) -> void - - def to_hash: -> { id: String, message: String } - end - end - end -end diff --git a/sig/moderation_api/models/queue/item_list_params.rbs b/sig/moderation_api/models/queue/item_list_params.rbs deleted file mode 100644 index e2ec1549..00000000 --- a/sig/moderation_api/models/queue/item_list_params.rbs +++ /dev/null @@ -1,132 +0,0 @@ -module ModerationAPI - module Models - module Queue - type item_list_params = - { - id: String, - after_date: String, - author_id: String, - before_date: String, - conversation_ids: String, - filtered_action_ids: String, - include_resolved: String, - labels: String, - page_number: Float, - page_size: Float, - sort_direction: ModerationAPI::Models::Queue::ItemListParams::sort_direction, - sort_field: ModerationAPI::Models::Queue::ItemListParams::sort_field - } - & ModerationAPI::Internal::Type::request_parameters - - class ItemListParams < ModerationAPI::Internal::Type::BaseModel - extend ModerationAPI::Internal::Type::RequestParameters::Converter - include ModerationAPI::Internal::Type::RequestParameters - - attr_accessor id: String - - attr_reader after_date: String? - - def after_date=: (String) -> String - - attr_reader author_id: String? - - def author_id=: (String) -> String - - attr_reader before_date: String? - - def before_date=: (String) -> String - - attr_reader conversation_ids: String? - - def conversation_ids=: (String) -> String - - attr_reader filtered_action_ids: String? - - def filtered_action_ids=: (String) -> String - - attr_reader include_resolved: String? - - def include_resolved=: (String) -> String - - attr_reader labels: String? - - def labels=: (String) -> String - - attr_reader page_number: Float? - - def page_number=: (Float) -> Float - - attr_reader page_size: Float? - - def page_size=: (Float) -> Float - - attr_reader sort_direction: ModerationAPI::Models::Queue::ItemListParams::sort_direction? - - def sort_direction=: ( - ModerationAPI::Models::Queue::ItemListParams::sort_direction - ) -> ModerationAPI::Models::Queue::ItemListParams::sort_direction - - attr_reader sort_field: ModerationAPI::Models::Queue::ItemListParams::sort_field? - - def sort_field=: ( - ModerationAPI::Models::Queue::ItemListParams::sort_field - ) -> ModerationAPI::Models::Queue::ItemListParams::sort_field - - def initialize: ( - id: String, - ?after_date: String, - ?author_id: String, - ?before_date: String, - ?conversation_ids: String, - ?filtered_action_ids: String, - ?include_resolved: String, - ?labels: String, - ?page_number: Float, - ?page_size: Float, - ?sort_direction: ModerationAPI::Models::Queue::ItemListParams::sort_direction, - ?sort_field: ModerationAPI::Models::Queue::ItemListParams::sort_field, - ?request_options: ModerationAPI::request_opts - ) -> void - - def to_hash: -> { - id: String, - after_date: String, - author_id: String, - before_date: String, - conversation_ids: String, - filtered_action_ids: String, - include_resolved: String, - labels: String, - page_number: Float, - page_size: Float, - sort_direction: ModerationAPI::Models::Queue::ItemListParams::sort_direction, - sort_field: ModerationAPI::Models::Queue::ItemListParams::sort_field, - request_options: ModerationAPI::RequestOptions - } - - type sort_direction = :asc | :desc - - module SortDirection - extend ModerationAPI::Internal::Type::Enum - - ASC: :asc - DESC: :desc - - def self?.values: -> ::Array[ModerationAPI::Models::Queue::ItemListParams::sort_direction] - end - - type sort_field = :createdAt | :severity | :reviewedAt - - module SortField - extend ModerationAPI::Internal::Type::Enum - - CREATED_AT: :createdAt - SEVERITY: :severity - REVIEWED_AT: :reviewedAt - - def self?.values: -> ::Array[ModerationAPI::Models::Queue::ItemListParams::sort_field] - end - end - end - end -end diff --git a/sig/moderation_api/models/queue/item_list_response.rbs b/sig/moderation_api/models/queue/item_list_response.rbs deleted file mode 100644 index 8a507b62..00000000 --- a/sig/moderation_api/models/queue/item_list_response.rbs +++ /dev/null @@ -1,209 +0,0 @@ -module ModerationAPI - module Models - module Queue - type item_list_response = - { - items: ::Array[ModerationAPI::Models::Queue::ItemListResponse::Item], - pagination: ModerationAPI::Models::Queue::ItemListResponse::Pagination - } - - class ItemListResponse < ModerationAPI::Internal::Type::BaseModel - attr_accessor items: ::Array[ModerationAPI::Models::Queue::ItemListResponse::Item] - - attr_accessor pagination: ModerationAPI::Models::Queue::ItemListResponse::Pagination - - def initialize: ( - items: ::Array[ModerationAPI::Models::Queue::ItemListResponse::Item], - pagination: ModerationAPI::Models::Queue::ItemListResponse::Pagination - ) -> void - - def to_hash: -> { - items: ::Array[ModerationAPI::Models::Queue::ItemListResponse::Item], - pagination: ModerationAPI::Models::Queue::ItemListResponse::Pagination - } - - type item = - { - id: String, - content: String, - flagged: bool, - labels: ::Array[ModerationAPI::Models::Queue::ItemListResponse::Item::Label], - status: ModerationAPI::Models::Queue::ItemListResponse::Item::status, - timestamp: Float, - actions: ::Array[ModerationAPI::Models::Queue::ItemListResponse::Item::Action], - author_id: String, - content_type: String, - conversation_id: String, - language: String - } - - class Item < ModerationAPI::Internal::Type::BaseModel - attr_accessor id: String - - attr_accessor content: String - - attr_accessor flagged: bool - - attr_accessor labels: ::Array[ModerationAPI::Models::Queue::ItemListResponse::Item::Label] - - attr_accessor status: ModerationAPI::Models::Queue::ItemListResponse::Item::status - - attr_accessor timestamp: Float - - attr_reader actions: ::Array[ModerationAPI::Models::Queue::ItemListResponse::Item::Action]? - - def actions=: ( - ::Array[ModerationAPI::Models::Queue::ItemListResponse::Item::Action] - ) -> ::Array[ModerationAPI::Models::Queue::ItemListResponse::Item::Action] - - attr_reader author_id: String? - - def author_id=: (String) -> String - - attr_reader content_type: String? - - def content_type=: (String) -> String - - attr_reader conversation_id: String? - - def conversation_id=: (String) -> String - - attr_reader language: String? - - def language=: (String) -> String - - def initialize: ( - id: String, - content: String, - flagged: bool, - labels: ::Array[ModerationAPI::Models::Queue::ItemListResponse::Item::Label], - status: ModerationAPI::Models::Queue::ItemListResponse::Item::status, - timestamp: Float, - ?actions: ::Array[ModerationAPI::Models::Queue::ItemListResponse::Item::Action], - ?author_id: String, - ?content_type: String, - ?conversation_id: String, - ?language: String - ) -> void - - def to_hash: -> { - id: String, - content: String, - flagged: bool, - labels: ::Array[ModerationAPI::Models::Queue::ItemListResponse::Item::Label], - status: ModerationAPI::Models::Queue::ItemListResponse::Item::status, - timestamp: Float, - actions: ::Array[ModerationAPI::Models::Queue::ItemListResponse::Item::Action], - author_id: String, - content_type: String, - conversation_id: String, - language: String - } - - type label = { flagged: bool, label: String, score: Float } - - class Label < ModerationAPI::Internal::Type::BaseModel - attr_accessor flagged: bool - - attr_accessor label: String - - attr_accessor score: Float - - def initialize: (flagged: bool, label: String, score: Float) -> void - - def to_hash: -> { flagged: bool, label: String, score: Float } - end - - type status = :pending | :resolved - - module Status - extend ModerationAPI::Internal::Type::Enum - - PENDING: :pending - RESOLVED: :resolved - - def self?.values: -> ::Array[ModerationAPI::Models::Queue::ItemListResponse::Item::status] - end - - type action = - { - id: String, - name: String, - timestamp: Float, - comment: String, - reviewer: String - } - - class Action < ModerationAPI::Internal::Type::BaseModel - attr_accessor id: String - - attr_accessor name: String - - attr_accessor timestamp: Float - - attr_reader comment: String? - - def comment=: (String) -> String - - attr_reader reviewer: String? - - def reviewer=: (String) -> String - - def initialize: ( - id: String, - name: String, - timestamp: Float, - ?comment: String, - ?reviewer: String - ) -> void - - def to_hash: -> { - id: String, - name: String, - timestamp: Float, - comment: String, - reviewer: String - } - end - end - - type pagination = - { - current_page: Float, - has_next_page: bool, - has_previous_page: bool, - total_items: Float, - total_pages: Float - } - - class Pagination < ModerationAPI::Internal::Type::BaseModel - attr_accessor current_page: Float - - attr_accessor has_next_page: bool - - attr_accessor has_previous_page: bool - - attr_accessor total_items: Float - - attr_accessor total_pages: Float - - def initialize: ( - current_page: Float, - has_next_page: bool, - has_previous_page: bool, - total_items: Float, - total_pages: Float - ) -> void - - def to_hash: -> { - current_page: Float, - has_next_page: bool, - has_previous_page: bool, - total_items: Float, - total_pages: Float - } - end - end - end - end -end diff --git a/sig/moderation_api/models/queue/item_resolve_params.rbs b/sig/moderation_api/models/queue/item_resolve_params.rbs deleted file mode 100644 index ad3a6cbe..00000000 --- a/sig/moderation_api/models/queue/item_resolve_params.rbs +++ /dev/null @@ -1,36 +0,0 @@ -module ModerationAPI - module Models - module Queue - type item_resolve_params = - { id: String, item_id: String, comment: String } - & ModerationAPI::Internal::Type::request_parameters - - class ItemResolveParams < ModerationAPI::Internal::Type::BaseModel - extend ModerationAPI::Internal::Type::RequestParameters::Converter - include ModerationAPI::Internal::Type::RequestParameters - - attr_accessor id: String - - attr_accessor item_id: String - - attr_reader comment: String? - - def comment=: (String) -> String - - def initialize: ( - id: String, - item_id: String, - ?comment: String, - ?request_options: ModerationAPI::request_opts - ) -> void - - def to_hash: -> { - id: String, - item_id: String, - comment: String, - request_options: ModerationAPI::RequestOptions - } - end - end - end -end diff --git a/sig/moderation_api/models/queue/item_resolve_response.rbs b/sig/moderation_api/models/queue/item_resolve_response.rbs deleted file mode 100644 index 22d4dfa5..00000000 --- a/sig/moderation_api/models/queue/item_resolve_response.rbs +++ /dev/null @@ -1,26 +0,0 @@ -module ModerationAPI - module Models - module Queue - type item_resolve_response = - { resolved_at: String, success: bool, comment: String } - - class ItemResolveResponse < ModerationAPI::Internal::Type::BaseModel - attr_accessor resolved_at: String - - attr_accessor success: bool - - attr_reader comment: String? - - def comment=: (String) -> String - - def initialize: ( - resolved_at: String, - success: bool, - ?comment: String - ) -> void - - def to_hash: -> { resolved_at: String, success: bool, comment: String } - end - end - end -end diff --git a/sig/moderation_api/models/queue/item_unresolve_params.rbs b/sig/moderation_api/models/queue/item_unresolve_params.rbs deleted file mode 100644 index 797945fa..00000000 --- a/sig/moderation_api/models/queue/item_unresolve_params.rbs +++ /dev/null @@ -1,36 +0,0 @@ -module ModerationAPI - module Models - module Queue - type item_unresolve_params = - { id: String, item_id: String, comment: String } - & ModerationAPI::Internal::Type::request_parameters - - class ItemUnresolveParams < ModerationAPI::Internal::Type::BaseModel - extend ModerationAPI::Internal::Type::RequestParameters::Converter - include ModerationAPI::Internal::Type::RequestParameters - - attr_accessor id: String - - attr_accessor item_id: String - - attr_reader comment: String? - - def comment=: (String) -> String - - def initialize: ( - id: String, - item_id: String, - ?comment: String, - ?request_options: ModerationAPI::request_opts - ) -> void - - def to_hash: -> { - id: String, - item_id: String, - comment: String, - request_options: ModerationAPI::RequestOptions - } - end - end - end -end diff --git a/sig/moderation_api/models/queue/item_unresolve_response.rbs b/sig/moderation_api/models/queue/item_unresolve_response.rbs deleted file mode 100644 index 5246d507..00000000 --- a/sig/moderation_api/models/queue/item_unresolve_response.rbs +++ /dev/null @@ -1,24 +0,0 @@ -module ModerationAPI - module Models - module Queue - type item_unresolve_response = - { status: String, success: bool, unresolved_at: String } - - class ItemUnresolveResponse < ModerationAPI::Internal::Type::BaseModel - attr_accessor status: String - - attr_accessor success: bool - - attr_accessor unresolved_at: String - - def initialize: ( - status: String, - success: bool, - unresolved_at: String - ) -> void - - def to_hash: -> { status: String, success: bool, unresolved_at: String } - end - end - end -end diff --git a/sig/moderation_api/models/queue_get_stats_params.rbs b/sig/moderation_api/models/queue_get_stats_params.rbs deleted file mode 100644 index b05e44a1..00000000 --- a/sig/moderation_api/models/queue_get_stats_params.rbs +++ /dev/null @@ -1,30 +0,0 @@ -module ModerationAPI - module Models - type queue_get_stats_params = - { id: String, within_days: String } - & ModerationAPI::Internal::Type::request_parameters - - class QueueGetStatsParams < ModerationAPI::Internal::Type::BaseModel - extend ModerationAPI::Internal::Type::RequestParameters::Converter - include ModerationAPI::Internal::Type::RequestParameters - - attr_accessor id: String - - attr_reader within_days: String? - - def within_days=: (String) -> String - - def initialize: ( - id: String, - ?within_days: String, - ?request_options: ModerationAPI::request_opts - ) -> void - - def to_hash: -> { - id: String, - within_days: String, - request_options: ModerationAPI::RequestOptions - } - end - end -end diff --git a/sig/moderation_api/models/queue_get_stats_response.rbs b/sig/moderation_api/models/queue_get_stats_response.rbs deleted file mode 100644 index 3e1abe9c..00000000 --- a/sig/moderation_api/models/queue_get_stats_response.rbs +++ /dev/null @@ -1,207 +0,0 @@ -module ModerationAPI - module Models - type queue_get_stats_response = - { - action_stats: ::Array[ModerationAPI::Models::QueueGetStatsResponse::ActionStat], - review_stats: ModerationAPI::Models::QueueGetStatsResponse::ReviewStats, - top_reviewers: ::Array[ModerationAPI::Models::QueueGetStatsResponse::TopReviewer], - trends: ModerationAPI::Models::QueueGetStatsResponse::Trends - } - - class QueueGetStatsResponse < ModerationAPI::Internal::Type::BaseModel - attr_accessor action_stats: ::Array[ModerationAPI::Models::QueueGetStatsResponse::ActionStat] - - attr_accessor review_stats: ModerationAPI::Models::QueueGetStatsResponse::ReviewStats - - attr_accessor top_reviewers: ::Array[ModerationAPI::Models::QueueGetStatsResponse::TopReviewer] - - attr_accessor trends: ModerationAPI::Models::QueueGetStatsResponse::Trends - - def initialize: ( - action_stats: ::Array[ModerationAPI::Models::QueueGetStatsResponse::ActionStat], - review_stats: ModerationAPI::Models::QueueGetStatsResponse::ReviewStats, - top_reviewers: ::Array[ModerationAPI::Models::QueueGetStatsResponse::TopReviewer], - trends: ModerationAPI::Models::QueueGetStatsResponse::Trends - ) -> void - - def to_hash: -> { - action_stats: ::Array[ModerationAPI::Models::QueueGetStatsResponse::ActionStat], - review_stats: ModerationAPI::Models::QueueGetStatsResponse::ReviewStats, - top_reviewers: ::Array[ModerationAPI::Models::QueueGetStatsResponse::TopReviewer], - trends: ModerationAPI::Models::QueueGetStatsResponse::Trends - } - - type action_stat = - { - action_id: String, - action_name: String, - count: Float, - percentage_of_total: Float - } - - class ActionStat < ModerationAPI::Internal::Type::BaseModel - attr_accessor action_id: String - - attr_accessor action_name: String - - attr_accessor count: Float - - attr_accessor percentage_of_total: Float - - def initialize: ( - action_id: String, - action_name: String, - count: Float, - percentage_of_total: Float - ) -> void - - def to_hash: -> { - action_id: String, - action_name: String, - count: Float, - percentage_of_total: Float - } - end - - type review_stats = - { - average_time_to_review: Float, - total_pending: Float, - total_reviewed: Float - } - - class ReviewStats < ModerationAPI::Internal::Type::BaseModel - attr_accessor average_time_to_review: Float - - attr_accessor total_pending: Float - - attr_accessor total_reviewed: Float - - def initialize: ( - average_time_to_review: Float, - total_pending: Float, - total_reviewed: Float - ) -> void - - def to_hash: -> { - average_time_to_review: Float, - total_pending: Float, - total_reviewed: Float - } - end - - type top_reviewer = - { - average_time_per_review: Float, - name: String, - review_count: Float, - top_actions: ::Array[ModerationAPI::Models::QueueGetStatsResponse::TopReviewer::TopAction], - user_id: String, - accuracy_score: Float - } - - class TopReviewer < ModerationAPI::Internal::Type::BaseModel - attr_accessor average_time_per_review: Float - - attr_accessor name: String - - attr_accessor review_count: Float - - attr_accessor top_actions: ::Array[ModerationAPI::Models::QueueGetStatsResponse::TopReviewer::TopAction] - - attr_accessor user_id: String - - attr_reader accuracy_score: Float? - - def accuracy_score=: (Float) -> Float - - def initialize: ( - average_time_per_review: Float, - name: String, - review_count: Float, - top_actions: ::Array[ModerationAPI::Models::QueueGetStatsResponse::TopReviewer::TopAction], - user_id: String, - ?accuracy_score: Float - ) -> void - - def to_hash: -> { - average_time_per_review: Float, - name: String, - review_count: Float, - top_actions: ::Array[ModerationAPI::Models::QueueGetStatsResponse::TopReviewer::TopAction], - user_id: String, - accuracy_score: Float - } - - type top_action = - { action_id: String, action_name: String, count: Float } - - class TopAction < ModerationAPI::Internal::Type::BaseModel - attr_accessor action_id: String - - attr_accessor action_name: String - - attr_accessor count: Float - - def initialize: ( - action_id: String, - action_name: String, - count: Float - ) -> void - - def to_hash: -> { - action_id: String, - action_name: String, - count: Float - } - end - end - - type trends = - { - daily_review_counts: ::Array[ModerationAPI::Models::QueueGetStatsResponse::Trends::DailyReviewCount], - flagged_content_trends: ::Array[ModerationAPI::Models::QueueGetStatsResponse::Trends::FlaggedContentTrend] - } - - class Trends < ModerationAPI::Internal::Type::BaseModel - attr_accessor daily_review_counts: ::Array[ModerationAPI::Models::QueueGetStatsResponse::Trends::DailyReviewCount] - - attr_accessor flagged_content_trends: ::Array[ModerationAPI::Models::QueueGetStatsResponse::Trends::FlaggedContentTrend] - - def initialize: ( - daily_review_counts: ::Array[ModerationAPI::Models::QueueGetStatsResponse::Trends::DailyReviewCount], - flagged_content_trends: ::Array[ModerationAPI::Models::QueueGetStatsResponse::Trends::FlaggedContentTrend] - ) -> void - - def to_hash: -> { - daily_review_counts: ::Array[ModerationAPI::Models::QueueGetStatsResponse::Trends::DailyReviewCount], - flagged_content_trends: ::Array[ModerationAPI::Models::QueueGetStatsResponse::Trends::FlaggedContentTrend] - } - - type daily_review_count = { count: Float, date: String } - - class DailyReviewCount < ModerationAPI::Internal::Type::BaseModel - attr_accessor count: Float - - attr_accessor date: String - - def initialize: (count: Float, date: String) -> void - - def to_hash: -> { count: Float, date: String } - end - - type flagged_content_trend = { label: String, trend: Float } - - class FlaggedContentTrend < ModerationAPI::Internal::Type::BaseModel - attr_accessor label: String - - attr_accessor trend: Float - - def initialize: (label: String, trend: Float) -> void - - def to_hash: -> { label: String, trend: Float } - end - end - end - end -end diff --git a/sig/moderation_api/models/queue_retrieve_params.rbs b/sig/moderation_api/models/queue_retrieve_params.rbs deleted file mode 100644 index 23142f61..00000000 --- a/sig/moderation_api/models/queue_retrieve_params.rbs +++ /dev/null @@ -1,23 +0,0 @@ -module ModerationAPI - module Models - type queue_retrieve_params = - { id: String } & ModerationAPI::Internal::Type::request_parameters - - class QueueRetrieveParams < ModerationAPI::Internal::Type::BaseModel - extend ModerationAPI::Internal::Type::RequestParameters::Converter - include ModerationAPI::Internal::Type::RequestParameters - - attr_accessor id: String - - def initialize: ( - id: String, - ?request_options: ModerationAPI::request_opts - ) -> void - - def to_hash: -> { - id: String, - request_options: ModerationAPI::RequestOptions - } - end - end -end diff --git a/sig/moderation_api/models/queue_retrieve_response.rbs b/sig/moderation_api/models/queue_retrieve_response.rbs deleted file mode 100644 index 51442f80..00000000 --- a/sig/moderation_api/models/queue_retrieve_response.rbs +++ /dev/null @@ -1,444 +0,0 @@ -module ModerationAPI - module Models - type queue_retrieve_response = - { queue: ModerationAPI::Models::QueueRetrieveResponse::Queue } - - class QueueRetrieveResponse < ModerationAPI::Internal::Type::BaseModel - attr_accessor queue: ModerationAPI::Models::QueueRetrieveResponse::Queue - - def initialize: ( - queue: ModerationAPI::Models::QueueRetrieveResponse::Queue - ) -> void - - def to_hash: -> { - queue: ModerationAPI::Models::QueueRetrieveResponse::Queue - } - - type queue = - { - id: String, - description: String, - filter: ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter, - name: String, - resolved_items_count: Float, - total_items_count: Float, - unresolved_items_count: Float - } - - class Queue < ModerationAPI::Internal::Type::BaseModel - attr_accessor id: String - - attr_accessor description: String - - attr_accessor filter: ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter - - attr_accessor name: String - - attr_accessor resolved_items_count: Float - - attr_accessor total_items_count: Float - - attr_accessor unresolved_items_count: Float - - def initialize: ( - id: String, - description: String, - filter: ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter, - name: String, - resolved_items_count: Float, - total_items_count: Float, - unresolved_items_count: Float - ) -> void - - def to_hash: -> { - id: String, - description: String, - filter: ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter, - name: String, - resolved_items_count: Float, - total_items_count: Float, - unresolved_items_count: Float - } - - type filter = - { - after_date: String, - author_id: String, - author_trust_levels: ::Array[Integer], - before_date: String, - casebook_agreement: ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::casebook_agreement, - casebook_answer: ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::casebook_answer, - check_status: ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::check_status?, - clear_date_window: bool, - content_id: String, - content_types: ::Array[ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::content_type], - conversation_ids: ::Array[String?], - filtered_action_ids: ::Array[String], - filtered_channel_ids: ::Array[String], - filter_labels: ::Array[ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::FilterLabel], - is_flagged: ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::is_flagged, - labels: ::Array[String], - languages: ::Array[String], - max_severity: Integer, - media_types: ::Array[ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::media_type], - metadata_filters: ::Array[ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::MetadataFilter], - min_severity: Integer, - recommendation_actions: ::Array[ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::recommendation_action], - search: ::Array[String], - within: Float, - within_unit: ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::within_unit - } - - class Filter < ModerationAPI::Internal::Type::BaseModel - attr_reader after_date: String? - - def after_date=: (String) -> String - - attr_reader author_id: String? - - def author_id=: (String) -> String - - attr_reader author_trust_levels: ::Array[Integer]? - - def author_trust_levels=: (::Array[Integer]) -> ::Array[Integer] - - attr_reader before_date: String? - - def before_date=: (String) -> String - - attr_reader casebook_agreement: ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::casebook_agreement? - - def casebook_agreement=: ( - ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::casebook_agreement - ) -> ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::casebook_agreement - - attr_reader casebook_answer: ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::casebook_answer? - - def casebook_answer=: ( - ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::casebook_answer - ) -> ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::casebook_answer - - attr_accessor check_status: ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::check_status? - - attr_reader clear_date_window: bool? - - def clear_date_window=: (bool) -> bool - - attr_reader content_id: String? - - def content_id=: (String) -> String - - attr_reader content_types: ::Array[ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::content_type]? - - def content_types=: ( - ::Array[ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::content_type] - ) -> ::Array[ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::content_type] - - attr_reader conversation_ids: ::Array[String?]? - - def conversation_ids=: (::Array[String?]) -> ::Array[String?] - - attr_reader filtered_action_ids: ::Array[String]? - - def filtered_action_ids=: (::Array[String]) -> ::Array[String] - - attr_reader filtered_channel_ids: ::Array[String]? - - def filtered_channel_ids=: (::Array[String]) -> ::Array[String] - - attr_reader filter_labels: ::Array[ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::FilterLabel]? - - def filter_labels=: ( - ::Array[ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::FilterLabel] - ) -> ::Array[ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::FilterLabel] - - attr_reader is_flagged: ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::is_flagged? - - def is_flagged=: ( - ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::is_flagged - ) -> ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::is_flagged - - attr_reader labels: ::Array[String]? - - def labels=: (::Array[String]) -> ::Array[String] - - attr_reader languages: ::Array[String]? - - def languages=: (::Array[String]) -> ::Array[String] - - attr_reader max_severity: Integer? - - def max_severity=: (Integer) -> Integer - - attr_reader media_types: ::Array[ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::media_type]? - - def media_types=: ( - ::Array[ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::media_type] - ) -> ::Array[ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::media_type] - - attr_reader metadata_filters: ::Array[ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::MetadataFilter]? - - def metadata_filters=: ( - ::Array[ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::MetadataFilter] - ) -> ::Array[ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::MetadataFilter] - - attr_reader min_severity: Integer? - - def min_severity=: (Integer) -> Integer - - attr_reader recommendation_actions: ::Array[ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::recommendation_action]? - - def recommendation_actions=: ( - ::Array[ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::recommendation_action] - ) -> ::Array[ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::recommendation_action] - - attr_reader search: ::Array[String]? - - def search=: (::Array[String]) -> ::Array[String] - - attr_reader within: Float? - - def within=: (Float) -> Float - - attr_reader within_unit: ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::within_unit? - - def within_unit=: ( - ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::within_unit - ) -> ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::within_unit - - def initialize: ( - ?after_date: String, - ?author_id: String, - ?author_trust_levels: ::Array[Integer], - ?before_date: String, - ?casebook_agreement: ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::casebook_agreement, - ?casebook_answer: ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::casebook_answer, - ?check_status: ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::check_status?, - ?clear_date_window: bool, - ?content_id: String, - ?content_types: ::Array[ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::content_type], - ?conversation_ids: ::Array[String?], - ?filtered_action_ids: ::Array[String], - ?filtered_channel_ids: ::Array[String], - ?filter_labels: ::Array[ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::FilterLabel], - ?is_flagged: ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::is_flagged, - ?labels: ::Array[String], - ?languages: ::Array[String], - ?max_severity: Integer, - ?media_types: ::Array[ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::media_type], - ?metadata_filters: ::Array[ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::MetadataFilter], - ?min_severity: Integer, - ?recommendation_actions: ::Array[ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::recommendation_action], - ?search: ::Array[String], - ?within: Float, - ?within_unit: ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::within_unit - ) -> void - - def to_hash: -> { - after_date: String, - author_id: String, - author_trust_levels: ::Array[Integer], - before_date: String, - casebook_agreement: ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::casebook_agreement, - casebook_answer: ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::casebook_answer, - check_status: ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::check_status?, - clear_date_window: bool, - content_id: String, - content_types: ::Array[ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::content_type], - conversation_ids: ::Array[String?], - filtered_action_ids: ::Array[String], - filtered_channel_ids: ::Array[String], - filter_labels: ::Array[ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::FilterLabel], - is_flagged: ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::is_flagged, - labels: ::Array[String], - languages: ::Array[String], - max_severity: Integer, - media_types: ::Array[ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::media_type], - metadata_filters: ::Array[ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::MetadataFilter], - min_severity: Integer, - recommendation_actions: ::Array[ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::recommendation_action], - search: ::Array[String], - within: Float, - within_unit: ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::within_unit - } - - type casebook_agreement = :ALL | :OVERRULED | :AGREED - - module CasebookAgreement - extend ModerationAPI::Internal::Type::Enum - - ALL: :ALL - OVERRULED: :OVERRULED - AGREED: :AGREED - - def self?.values: -> ::Array[ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::casebook_agreement] - end - - type casebook_answer = :ALL | :ALLOWED | :REJECTED | :NO_ANSWER - - module CasebookAnswer - extend ModerationAPI::Internal::Type::Enum - - ALL: :ALL - ALLOWED: :ALLOWED - REJECTED: :REJECTED - NO_ANSWER: :NO_ANSWER - - def self?.values: -> ::Array[ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::casebook_answer] - end - - type check_status = :all | :checked | :unchecked - - module CheckStatus - extend ModerationAPI::Internal::Type::Enum - - ALL: :all - CHECKED: :checked - UNCHECKED: :unchecked - - def self?.values: -> ::Array[ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::check_status] - end - - type content_type = - :profile - | :message - | :post - | :comment - | :event - | :product - | :review - | :voice - | :other - - module ContentType - extend ModerationAPI::Internal::Type::Enum - - PROFILE: :profile - MESSAGE: :message - POST: :post - COMMENT: :comment - EVENT: :event - PRODUCT: :product - REVIEW: :review - VOICE: :voice - OTHER: :other - - def self?.values: -> ::Array[ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::content_type] - end - - type filter_label = - { - label: String, - type: ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::FilterLabel::type_, - max_threshold: Float?, - min_threshold: Float? - } - - class FilterLabel < ModerationAPI::Internal::Type::BaseModel - attr_accessor label: String - - attr_accessor type: ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::FilterLabel::type_ - - attr_accessor max_threshold: Float? - - attr_accessor min_threshold: Float? - - def initialize: ( - label: String, - type: ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::FilterLabel::type_, - ?max_threshold: Float?, - ?min_threshold: Float? - ) -> void - - def to_hash: -> { - label: String, - type: ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::FilterLabel::type_, - max_threshold: Float?, - min_threshold: Float? - } - - type type_ = :FLAGGED | :NOT_FLAGGED | :THRESHOLDS | :MATCHED - - module Type - extend ModerationAPI::Internal::Type::Enum - - FLAGGED: :FLAGGED - NOT_FLAGGED: :NOT_FLAGGED - THRESHOLDS: :THRESHOLDS - MATCHED: :MATCHED - - def self?.values: -> ::Array[ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::FilterLabel::type_] - end - end - - type is_flagged = :ALL | :FLAGGED | :NOT_FLAGGED | :SHADOW_FLAGGED - - module IsFlagged - extend ModerationAPI::Internal::Type::Enum - - ALL: :ALL - FLAGGED: :FLAGGED - NOT_FLAGGED: :NOT_FLAGGED - SHADOW_FLAGGED: :SHADOW_FLAGGED - - def self?.values: -> ::Array[ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::is_flagged] - end - - type media_type = :text | :image | :video | :object | :audio - - module MediaType - extend ModerationAPI::Internal::Type::Enum - - TEXT: :text - IMAGE: :image - VIDEO: :video - OBJECT: :object - AUDIO: :audio - - def self?.values: -> ::Array[ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::media_type] - end - - type metadata_filter = { key: String, value: String } - - class MetadataFilter < ModerationAPI::Internal::Type::BaseModel - attr_accessor key: String - - attr_accessor value: String - - def initialize: (key: String, value: String) -> void - - def to_hash: -> { key: String, value: String } - end - - type recommendation_action = :review | :allow | :reject - - module RecommendationAction - extend ModerationAPI::Internal::Type::Enum - - REVIEW: :review - ALLOW: :allow - REJECT: :reject - - def self?.values: -> ::Array[ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::recommendation_action] - end - - type within_unit = - :MINUTES | :HOURS | :DAYS | :WEEKS | :MONTHS | :YEARS - - module WithinUnit - extend ModerationAPI::Internal::Type::Enum - - MINUTES: :MINUTES - HOURS: :HOURS - DAYS: :DAYS - WEEKS: :WEEKS - MONTHS: :MONTHS - YEARS: :YEARS - - def self?.values: -> ::Array[ModerationAPI::Models::QueueRetrieveResponse::Queue::Filter::within_unit] - end - end - end - end - end -end diff --git a/sig/moderation_api/models/webhook_create_params.rbs b/sig/moderation_api/models/webhook_create_params.rbs deleted file mode 100644 index 984db3a3..00000000 --- a/sig/moderation_api/models/webhook_create_params.rbs +++ /dev/null @@ -1,72 +0,0 @@ -module ModerationAPI - module Models - type webhook_create_params = - { - event_types: ::Array[ModerationAPI::Models::WebhookCreateParams::event_type], - name: String, - url: String, - description: String? - } - & ModerationAPI::Internal::Type::request_parameters - - class WebhookCreateParams < ModerationAPI::Internal::Type::BaseModel - extend ModerationAPI::Internal::Type::RequestParameters::Converter - include ModerationAPI::Internal::Type::RequestParameters - - attr_accessor event_types: ::Array[ModerationAPI::Models::WebhookCreateParams::event_type] - - attr_accessor name: String - - attr_accessor url: String - - attr_accessor description: String? - - def initialize: ( - event_types: ::Array[ModerationAPI::Models::WebhookCreateParams::event_type], - name: String, - url: String, - ?description: String?, - ?request_options: ModerationAPI::request_opts - ) -> void - - def to_hash: -> { - event_types: ::Array[ModerationAPI::Models::WebhookCreateParams::event_type], - name: String, - url: String, - description: String?, - request_options: ModerationAPI::RequestOptions - } - - type event_type = - :QUEUE_ITEM_NEW - | :QUEUE_ITEM_COMPLETED - | :QUEUE_ITEM_ACTION - | :QUEUE_ITEM_REJECTED - | :QUEUE_ITEM_ALLOWED - | :AUTHOR_BLOCKED - | :AUTHOR_UNBLOCKED - | :AUTHOR_SUSPENDED - | :AUTHOR_UPDATED - | :AUTHOR_TRUST_LEVEL_CHANGED - | :AUTHOR_ACTION - - module EventType - extend ModerationAPI::Internal::Type::Enum - - QUEUE_ITEM_NEW: :QUEUE_ITEM_NEW - QUEUE_ITEM_COMPLETED: :QUEUE_ITEM_COMPLETED - QUEUE_ITEM_ACTION: :QUEUE_ITEM_ACTION - QUEUE_ITEM_REJECTED: :QUEUE_ITEM_REJECTED - QUEUE_ITEM_ALLOWED: :QUEUE_ITEM_ALLOWED - AUTHOR_BLOCKED: :AUTHOR_BLOCKED - AUTHOR_UNBLOCKED: :AUTHOR_UNBLOCKED - AUTHOR_SUSPENDED: :AUTHOR_SUSPENDED - AUTHOR_UPDATED: :AUTHOR_UPDATED - AUTHOR_TRUST_LEVEL_CHANGED: :AUTHOR_TRUST_LEVEL_CHANGED - AUTHOR_ACTION: :AUTHOR_ACTION - - def self?.values: -> ::Array[ModerationAPI::Models::WebhookCreateParams::event_type] - end - end - end -end diff --git a/sig/moderation_api/models/webhook_create_response.rbs b/sig/moderation_api/models/webhook_create_response.rbs deleted file mode 100644 index 1df45cfa..00000000 --- a/sig/moderation_api/models/webhook_create_response.rbs +++ /dev/null @@ -1,92 +0,0 @@ -module ModerationAPI - module Models - type webhook_create_response = - { - id: String, - created_at: String, - event_types: ::Array[ModerationAPI::Models::WebhookCreateResponse::event_type], - name: String, - payload_version: ModerationAPI::Models::WebhookCreateResponse::payload_version, - url: String, - description: String? - } - - class WebhookCreateResponse < ModerationAPI::Internal::Type::BaseModel - attr_accessor id: String - - attr_accessor created_at: String - - attr_accessor event_types: ::Array[ModerationAPI::Models::WebhookCreateResponse::event_type] - - attr_accessor name: String - - attr_accessor payload_version: ModerationAPI::Models::WebhookCreateResponse::payload_version - - attr_accessor url: String - - attr_accessor description: String? - - def initialize: ( - id: String, - created_at: String, - event_types: ::Array[ModerationAPI::Models::WebhookCreateResponse::event_type], - name: String, - payload_version: ModerationAPI::Models::WebhookCreateResponse::payload_version, - url: String, - ?description: String? - ) -> void - - def to_hash: -> { - id: String, - created_at: String, - event_types: ::Array[ModerationAPI::Models::WebhookCreateResponse::event_type], - name: String, - payload_version: ModerationAPI::Models::WebhookCreateResponse::payload_version, - url: String, - description: String? - } - - type event_type = - :QUEUE_ITEM_NEW - | :QUEUE_ITEM_COMPLETED - | :QUEUE_ITEM_ACTION - | :QUEUE_ITEM_REJECTED - | :QUEUE_ITEM_ALLOWED - | :AUTHOR_BLOCKED - | :AUTHOR_UNBLOCKED - | :AUTHOR_SUSPENDED - | :AUTHOR_UPDATED - | :AUTHOR_TRUST_LEVEL_CHANGED - | :AUTHOR_ACTION - - module EventType - extend ModerationAPI::Internal::Type::Enum - - QUEUE_ITEM_NEW: :QUEUE_ITEM_NEW - QUEUE_ITEM_COMPLETED: :QUEUE_ITEM_COMPLETED - QUEUE_ITEM_ACTION: :QUEUE_ITEM_ACTION - QUEUE_ITEM_REJECTED: :QUEUE_ITEM_REJECTED - QUEUE_ITEM_ALLOWED: :QUEUE_ITEM_ALLOWED - AUTHOR_BLOCKED: :AUTHOR_BLOCKED - AUTHOR_UNBLOCKED: :AUTHOR_UNBLOCKED - AUTHOR_SUSPENDED: :AUTHOR_SUSPENDED - AUTHOR_UPDATED: :AUTHOR_UPDATED - AUTHOR_TRUST_LEVEL_CHANGED: :AUTHOR_TRUST_LEVEL_CHANGED - AUTHOR_ACTION: :AUTHOR_ACTION - - def self?.values: -> ::Array[ModerationAPI::Models::WebhookCreateResponse::event_type] - end - - type payload_version = :V1 | :V2 - - module PayloadVersion - extend ModerationAPI::Internal::Type::Enum - - V1: :V1 - V2: :V2 - - def self?.values: -> ::Array[ModerationAPI::Models::WebhookCreateResponse::payload_version] - end - end - end -end diff --git a/sig/moderation_api/models/webhook_delete_params.rbs b/sig/moderation_api/models/webhook_delete_params.rbs deleted file mode 100644 index 87a7ef23..00000000 --- a/sig/moderation_api/models/webhook_delete_params.rbs +++ /dev/null @@ -1,23 +0,0 @@ -module ModerationAPI - module Models - type webhook_delete_params = - { id: String } & ModerationAPI::Internal::Type::request_parameters - - class WebhookDeleteParams < ModerationAPI::Internal::Type::BaseModel - extend ModerationAPI::Internal::Type::RequestParameters::Converter - include ModerationAPI::Internal::Type::RequestParameters - - attr_accessor id: String - - def initialize: ( - id: String, - ?request_options: ModerationAPI::request_opts - ) -> void - - def to_hash: -> { - id: String, - request_options: ModerationAPI::RequestOptions - } - end - end -end diff --git a/sig/moderation_api/models/webhook_delete_response.rbs b/sig/moderation_api/models/webhook_delete_response.rbs deleted file mode 100644 index 4a2e216f..00000000 --- a/sig/moderation_api/models/webhook_delete_response.rbs +++ /dev/null @@ -1,15 +0,0 @@ -module ModerationAPI - module Models - type webhook_delete_response = { id: String, deleted: bool } - - class WebhookDeleteResponse < ModerationAPI::Internal::Type::BaseModel - attr_accessor id: String - - attr_accessor deleted: bool - - def initialize: (id: String, deleted: bool) -> void - - def to_hash: -> { id: String, deleted: bool } - end - end -end diff --git a/sig/moderation_api/models/webhook_event.rbs b/sig/moderation_api/models/webhook_event.rbs deleted file mode 100644 index 0074e727..00000000 --- a/sig/moderation_api/models/webhook_event.rbs +++ /dev/null @@ -1,5130 +0,0 @@ -module ModerationAPI - module Models - type webhook_event = - ModerationAPI::WebhookEvent::AuthorBlocked - | ModerationAPI::WebhookEvent::AuthorUnblocked - | ModerationAPI::WebhookEvent::AuthorSuspended - | ModerationAPI::WebhookEvent::AuthorUpdated - | ModerationAPI::WebhookEvent::AuthorTrustLevelChanged - | ModerationAPI::WebhookEvent::AuthorAction - | ModerationAPI::WebhookEvent::QueueItemResolved - | ModerationAPI::WebhookEvent::QueueItemAction - | ModerationAPI::WebhookEvent::QueueItemRejected - | ModerationAPI::WebhookEvent::QueueItemAllowed - - module WebhookEvent - extend ModerationAPI::Internal::Type::Union - - type author_blocked = - { - id: String, - api_version: :v2, - created: Time, - data: ModerationAPI::WebhookEvent::AuthorBlocked::Data, - type: :"author.blocked" - } - - class AuthorBlocked < ModerationAPI::Internal::Type::BaseModel - attr_accessor id: String - - attr_accessor api_version: :v2 - - attr_accessor created: Time - - attr_accessor data: ModerationAPI::WebhookEvent::AuthorBlocked::Data - - attr_accessor type: :"author.blocked" - - def initialize: ( - id: String, - created: Time, - data: ModerationAPI::WebhookEvent::AuthorBlocked::Data, - ?api_version: :v2, - ?type: :"author.blocked" - ) -> void - - def to_hash: -> { - id: String, - api_version: :v2, - created: Time, - data: ModerationAPI::WebhookEvent::AuthorBlocked::Data, - type: :"author.blocked" - } - - type data = - { object: ModerationAPI::WebhookEvent::AuthorBlocked::Data::Object } - - class Data < ModerationAPI::Internal::Type::BaseModel - attr_accessor object: ModerationAPI::WebhookEvent::AuthorBlocked::Data::Object - - def initialize: ( - object: ModerationAPI::WebhookEvent::AuthorBlocked::Data::Object - ) -> void - - def to_hash: -> { - object: ModerationAPI::WebhookEvent::AuthorBlocked::Data::Object - } - - type object = - { - id: String, - author: ModerationAPI::WebhookEvent::AuthorBlocked::Data::Object::Author, - created_at: Time, - key: String?, - name: String?, - value: String?, - queue: ModerationAPI::WebhookEvent::AuthorBlocked::Data::Object::Queue - } - - class Object < ModerationAPI::Internal::Type::BaseModel - attr_accessor id: String - - attr_accessor author: ModerationAPI::WebhookEvent::AuthorBlocked::Data::Object::Author - - attr_accessor created_at: Time - - attr_accessor key: String? - - attr_accessor name: String? - - attr_accessor value: String? - - attr_reader queue: ModerationAPI::WebhookEvent::AuthorBlocked::Data::Object::Queue? - - def queue=: ( - ModerationAPI::WebhookEvent::AuthorBlocked::Data::Object::Queue - ) -> ModerationAPI::WebhookEvent::AuthorBlocked::Data::Object::Queue - - def initialize: ( - id: String, - author: ModerationAPI::WebhookEvent::AuthorBlocked::Data::Object::Author, - created_at: Time, - key: String?, - name: String?, - value: String?, - ?queue: ModerationAPI::WebhookEvent::AuthorBlocked::Data::Object::Queue - ) -> void - - def to_hash: -> { - id: String, - author: ModerationAPI::WebhookEvent::AuthorBlocked::Data::Object::Author, - created_at: Time, - key: String?, - name: String?, - value: String?, - queue: ModerationAPI::WebhookEvent::AuthorBlocked::Data::Object::Queue - } - - type author = - { - id: String, - block: ModerationAPI::WebhookEvent::AuthorBlocked::Data::Object::Author::Block?, - first_seen: Float, - last_seen: Float, - metadata: ModerationAPI::WebhookEvent::AuthorBlocked::Data::Object::Author::Metadata, - metrics: ModerationAPI::WebhookEvent::AuthorBlocked::Data::Object::Author::Metrics, - risk_evaluation: ModerationAPI::WebhookEvent::AuthorBlocked::Data::Object::Author::RiskEvaluation?, - status: ModerationAPI::Models::WebhookEvent::AuthorBlocked::Data::Object::Author::status, - trust_level: ModerationAPI::WebhookEvent::AuthorBlocked::Data::Object::Author::TrustLevel, - company: String?, - email: String?, - external_id: String?, - external_link: String?, - last_incident: Float?, - name: String?, - profile_picture: String? - } - - class Author < ModerationAPI::Internal::Type::BaseModel - attr_accessor id: String - - attr_accessor block: ModerationAPI::WebhookEvent::AuthorBlocked::Data::Object::Author::Block? - - attr_accessor first_seen: Float - - attr_accessor last_seen: Float - - attr_accessor metadata: ModerationAPI::WebhookEvent::AuthorBlocked::Data::Object::Author::Metadata - - attr_accessor metrics: ModerationAPI::WebhookEvent::AuthorBlocked::Data::Object::Author::Metrics - - attr_accessor risk_evaluation: ModerationAPI::WebhookEvent::AuthorBlocked::Data::Object::Author::RiskEvaluation? - - attr_accessor status: ModerationAPI::Models::WebhookEvent::AuthorBlocked::Data::Object::Author::status - - attr_accessor trust_level: ModerationAPI::WebhookEvent::AuthorBlocked::Data::Object::Author::TrustLevel - - attr_accessor company: String? - - attr_accessor email: String? - - attr_accessor external_id: String? - - attr_accessor external_link: String? - - attr_accessor last_incident: Float? - - attr_accessor name: String? - - attr_accessor profile_picture: String? - - def initialize: ( - id: String, - block: ModerationAPI::WebhookEvent::AuthorBlocked::Data::Object::Author::Block?, - first_seen: Float, - last_seen: Float, - metadata: ModerationAPI::WebhookEvent::AuthorBlocked::Data::Object::Author::Metadata, - metrics: ModerationAPI::WebhookEvent::AuthorBlocked::Data::Object::Author::Metrics, - risk_evaluation: ModerationAPI::WebhookEvent::AuthorBlocked::Data::Object::Author::RiskEvaluation?, - status: ModerationAPI::Models::WebhookEvent::AuthorBlocked::Data::Object::Author::status, - trust_level: ModerationAPI::WebhookEvent::AuthorBlocked::Data::Object::Author::TrustLevel, - ?company: String?, - ?email: String?, - ?external_id: String?, - ?external_link: String?, - ?last_incident: Float?, - ?name: String?, - ?profile_picture: String? - ) -> void - - def to_hash: -> { - id: String, - block: ModerationAPI::WebhookEvent::AuthorBlocked::Data::Object::Author::Block?, - first_seen: Float, - last_seen: Float, - metadata: ModerationAPI::WebhookEvent::AuthorBlocked::Data::Object::Author::Metadata, - metrics: ModerationAPI::WebhookEvent::AuthorBlocked::Data::Object::Author::Metrics, - risk_evaluation: ModerationAPI::WebhookEvent::AuthorBlocked::Data::Object::Author::RiskEvaluation?, - status: ModerationAPI::Models::WebhookEvent::AuthorBlocked::Data::Object::Author::status, - trust_level: ModerationAPI::WebhookEvent::AuthorBlocked::Data::Object::Author::TrustLevel, - company: String?, - email: String?, - external_id: String?, - external_link: String?, - last_incident: Float?, - name: String?, - profile_picture: String? - } - - type block = { reason: String?, until_: Float? } - - class Block < ModerationAPI::Internal::Type::BaseModel - attr_accessor reason: String? - - attr_accessor until_: Float? - - def initialize: (?reason: String?, ?until_: Float?) -> void - - def to_hash: -> { reason: String?, until_: Float? } - end - - type metadata = - { - email_verified: bool?, - identity_verified: bool?, - is_paying_customer: bool?, - phone_verified: bool? - } - - class Metadata < ModerationAPI::Internal::Type::BaseModel - attr_accessor email_verified: bool? - - attr_accessor identity_verified: bool? - - attr_accessor is_paying_customer: bool? - - attr_accessor phone_verified: bool? - - def initialize: ( - ?email_verified: bool?, - ?identity_verified: bool?, - ?is_paying_customer: bool?, - ?phone_verified: bool? - ) -> void - - def to_hash: -> { - email_verified: bool?, - identity_verified: bool?, - is_paying_customer: bool?, - phone_verified: bool? - } - end - - type metrics = - { - flagged_content: Float, - total_content: Float, - average_sentiment: Float? - } - - class Metrics < ModerationAPI::Internal::Type::BaseModel - attr_accessor flagged_content: Float - - attr_accessor total_content: Float - - attr_accessor average_sentiment: Float? - - def initialize: ( - flagged_content: Float, - total_content: Float, - ?average_sentiment: Float? - ) -> void - - def to_hash: -> { - flagged_content: Float, - total_content: Float, - average_sentiment: Float? - } - end - - type risk_evaluation = { risk_level: Float? } - - class RiskEvaluation < ModerationAPI::Internal::Type::BaseModel - attr_accessor risk_level: Float? - - def initialize: (?risk_level: Float?) -> void - - def to_hash: -> { risk_level: Float? } - end - - type status = :enabled | :suspended | :blocked - - module Status - extend ModerationAPI::Internal::Type::Enum - - ENABLED: :enabled - SUSPENDED: :suspended - BLOCKED: :blocked - - def self?.values: -> ::Array[ModerationAPI::Models::WebhookEvent::AuthorBlocked::Data::Object::Author::status] - end - - type trust_level = { level: Float, manual: bool } - - class TrustLevel < ModerationAPI::Internal::Type::BaseModel - attr_accessor level: Float - - attr_accessor manual: bool - - def initialize: (level: Float, manual: bool) -> void - - def to_hash: -> { level: Float, manual: bool } - end - end - - type queue = { id: String } - - class Queue < ModerationAPI::Internal::Type::BaseModel - attr_accessor id: String - - def initialize: (id: String) -> void - - def to_hash: -> { id: String } - end - end - end - end - - type author_unblocked = - { - id: String, - api_version: :v2, - created: Time, - data: ModerationAPI::WebhookEvent::AuthorUnblocked::Data, - type: :"author.unblocked" - } - - class AuthorUnblocked < ModerationAPI::Internal::Type::BaseModel - attr_accessor id: String - - attr_accessor api_version: :v2 - - attr_accessor created: Time - - attr_accessor data: ModerationAPI::WebhookEvent::AuthorUnblocked::Data - - attr_accessor type: :"author.unblocked" - - def initialize: ( - id: String, - created: Time, - data: ModerationAPI::WebhookEvent::AuthorUnblocked::Data, - ?api_version: :v2, - ?type: :"author.unblocked" - ) -> void - - def to_hash: -> { - id: String, - api_version: :v2, - created: Time, - data: ModerationAPI::WebhookEvent::AuthorUnblocked::Data, - type: :"author.unblocked" - } - - type data = - { object: ModerationAPI::WebhookEvent::AuthorUnblocked::Data::Object } - - class Data < ModerationAPI::Internal::Type::BaseModel - attr_accessor object: ModerationAPI::WebhookEvent::AuthorUnblocked::Data::Object - - def initialize: ( - object: ModerationAPI::WebhookEvent::AuthorUnblocked::Data::Object - ) -> void - - def to_hash: -> { - object: ModerationAPI::WebhookEvent::AuthorUnblocked::Data::Object - } - - type object = - { - id: String, - author: ModerationAPI::WebhookEvent::AuthorUnblocked::Data::Object::Author, - created_at: Time, - key: String?, - name: String?, - value: String?, - queue: ModerationAPI::WebhookEvent::AuthorUnblocked::Data::Object::Queue - } - - class Object < ModerationAPI::Internal::Type::BaseModel - attr_accessor id: String - - attr_accessor author: ModerationAPI::WebhookEvent::AuthorUnblocked::Data::Object::Author - - attr_accessor created_at: Time - - attr_accessor key: String? - - attr_accessor name: String? - - attr_accessor value: String? - - attr_reader queue: ModerationAPI::WebhookEvent::AuthorUnblocked::Data::Object::Queue? - - def queue=: ( - ModerationAPI::WebhookEvent::AuthorUnblocked::Data::Object::Queue - ) -> ModerationAPI::WebhookEvent::AuthorUnblocked::Data::Object::Queue - - def initialize: ( - id: String, - author: ModerationAPI::WebhookEvent::AuthorUnblocked::Data::Object::Author, - created_at: Time, - key: String?, - name: String?, - value: String?, - ?queue: ModerationAPI::WebhookEvent::AuthorUnblocked::Data::Object::Queue - ) -> void - - def to_hash: -> { - id: String, - author: ModerationAPI::WebhookEvent::AuthorUnblocked::Data::Object::Author, - created_at: Time, - key: String?, - name: String?, - value: String?, - queue: ModerationAPI::WebhookEvent::AuthorUnblocked::Data::Object::Queue - } - - type author = - { - id: String, - block: ModerationAPI::WebhookEvent::AuthorUnblocked::Data::Object::Author::Block?, - first_seen: Float, - last_seen: Float, - metadata: ModerationAPI::WebhookEvent::AuthorUnblocked::Data::Object::Author::Metadata, - metrics: ModerationAPI::WebhookEvent::AuthorUnblocked::Data::Object::Author::Metrics, - risk_evaluation: ModerationAPI::WebhookEvent::AuthorUnblocked::Data::Object::Author::RiskEvaluation?, - status: ModerationAPI::Models::WebhookEvent::AuthorUnblocked::Data::Object::Author::status, - trust_level: ModerationAPI::WebhookEvent::AuthorUnblocked::Data::Object::Author::TrustLevel, - company: String?, - email: String?, - external_id: String?, - external_link: String?, - last_incident: Float?, - name: String?, - profile_picture: String? - } - - class Author < ModerationAPI::Internal::Type::BaseModel - attr_accessor id: String - - attr_accessor block: ModerationAPI::WebhookEvent::AuthorUnblocked::Data::Object::Author::Block? - - attr_accessor first_seen: Float - - attr_accessor last_seen: Float - - attr_accessor metadata: ModerationAPI::WebhookEvent::AuthorUnblocked::Data::Object::Author::Metadata - - attr_accessor metrics: ModerationAPI::WebhookEvent::AuthorUnblocked::Data::Object::Author::Metrics - - attr_accessor risk_evaluation: ModerationAPI::WebhookEvent::AuthorUnblocked::Data::Object::Author::RiskEvaluation? - - attr_accessor status: ModerationAPI::Models::WebhookEvent::AuthorUnblocked::Data::Object::Author::status - - attr_accessor trust_level: ModerationAPI::WebhookEvent::AuthorUnblocked::Data::Object::Author::TrustLevel - - attr_accessor company: String? - - attr_accessor email: String? - - attr_accessor external_id: String? - - attr_accessor external_link: String? - - attr_accessor last_incident: Float? - - attr_accessor name: String? - - attr_accessor profile_picture: String? - - def initialize: ( - id: String, - block: ModerationAPI::WebhookEvent::AuthorUnblocked::Data::Object::Author::Block?, - first_seen: Float, - last_seen: Float, - metadata: ModerationAPI::WebhookEvent::AuthorUnblocked::Data::Object::Author::Metadata, - metrics: ModerationAPI::WebhookEvent::AuthorUnblocked::Data::Object::Author::Metrics, - risk_evaluation: ModerationAPI::WebhookEvent::AuthorUnblocked::Data::Object::Author::RiskEvaluation?, - status: ModerationAPI::Models::WebhookEvent::AuthorUnblocked::Data::Object::Author::status, - trust_level: ModerationAPI::WebhookEvent::AuthorUnblocked::Data::Object::Author::TrustLevel, - ?company: String?, - ?email: String?, - ?external_id: String?, - ?external_link: String?, - ?last_incident: Float?, - ?name: String?, - ?profile_picture: String? - ) -> void - - def to_hash: -> { - id: String, - block: ModerationAPI::WebhookEvent::AuthorUnblocked::Data::Object::Author::Block?, - first_seen: Float, - last_seen: Float, - metadata: ModerationAPI::WebhookEvent::AuthorUnblocked::Data::Object::Author::Metadata, - metrics: ModerationAPI::WebhookEvent::AuthorUnblocked::Data::Object::Author::Metrics, - risk_evaluation: ModerationAPI::WebhookEvent::AuthorUnblocked::Data::Object::Author::RiskEvaluation?, - status: ModerationAPI::Models::WebhookEvent::AuthorUnblocked::Data::Object::Author::status, - trust_level: ModerationAPI::WebhookEvent::AuthorUnblocked::Data::Object::Author::TrustLevel, - company: String?, - email: String?, - external_id: String?, - external_link: String?, - last_incident: Float?, - name: String?, - profile_picture: String? - } - - type block = { reason: String?, until_: Float? } - - class Block < ModerationAPI::Internal::Type::BaseModel - attr_accessor reason: String? - - attr_accessor until_: Float? - - def initialize: (?reason: String?, ?until_: Float?) -> void - - def to_hash: -> { reason: String?, until_: Float? } - end - - type metadata = - { - email_verified: bool?, - identity_verified: bool?, - is_paying_customer: bool?, - phone_verified: bool? - } - - class Metadata < ModerationAPI::Internal::Type::BaseModel - attr_accessor email_verified: bool? - - attr_accessor identity_verified: bool? - - attr_accessor is_paying_customer: bool? - - attr_accessor phone_verified: bool? - - def initialize: ( - ?email_verified: bool?, - ?identity_verified: bool?, - ?is_paying_customer: bool?, - ?phone_verified: bool? - ) -> void - - def to_hash: -> { - email_verified: bool?, - identity_verified: bool?, - is_paying_customer: bool?, - phone_verified: bool? - } - end - - type metrics = - { - flagged_content: Float, - total_content: Float, - average_sentiment: Float? - } - - class Metrics < ModerationAPI::Internal::Type::BaseModel - attr_accessor flagged_content: Float - - attr_accessor total_content: Float - - attr_accessor average_sentiment: Float? - - def initialize: ( - flagged_content: Float, - total_content: Float, - ?average_sentiment: Float? - ) -> void - - def to_hash: -> { - flagged_content: Float, - total_content: Float, - average_sentiment: Float? - } - end - - type risk_evaluation = { risk_level: Float? } - - class RiskEvaluation < ModerationAPI::Internal::Type::BaseModel - attr_accessor risk_level: Float? - - def initialize: (?risk_level: Float?) -> void - - def to_hash: -> { risk_level: Float? } - end - - type status = :enabled | :suspended | :blocked - - module Status - extend ModerationAPI::Internal::Type::Enum - - ENABLED: :enabled - SUSPENDED: :suspended - BLOCKED: :blocked - - def self?.values: -> ::Array[ModerationAPI::Models::WebhookEvent::AuthorUnblocked::Data::Object::Author::status] - end - - type trust_level = { level: Float, manual: bool } - - class TrustLevel < ModerationAPI::Internal::Type::BaseModel - attr_accessor level: Float - - attr_accessor manual: bool - - def initialize: (level: Float, manual: bool) -> void - - def to_hash: -> { level: Float, manual: bool } - end - end - - type queue = { id: String } - - class Queue < ModerationAPI::Internal::Type::BaseModel - attr_accessor id: String - - def initialize: (id: String) -> void - - def to_hash: -> { id: String } - end - end - end - end - - type author_suspended = - { - id: String, - api_version: :v2, - created: Time, - data: ModerationAPI::WebhookEvent::AuthorSuspended::Data, - type: :"author.suspended" - } - - class AuthorSuspended < ModerationAPI::Internal::Type::BaseModel - attr_accessor id: String - - attr_accessor api_version: :v2 - - attr_accessor created: Time - - attr_accessor data: ModerationAPI::WebhookEvent::AuthorSuspended::Data - - attr_accessor type: :"author.suspended" - - def initialize: ( - id: String, - created: Time, - data: ModerationAPI::WebhookEvent::AuthorSuspended::Data, - ?api_version: :v2, - ?type: :"author.suspended" - ) -> void - - def to_hash: -> { - id: String, - api_version: :v2, - created: Time, - data: ModerationAPI::WebhookEvent::AuthorSuspended::Data, - type: :"author.suspended" - } - - type data = - { object: ModerationAPI::WebhookEvent::AuthorSuspended::Data::Object } - - class Data < ModerationAPI::Internal::Type::BaseModel - attr_accessor object: ModerationAPI::WebhookEvent::AuthorSuspended::Data::Object - - def initialize: ( - object: ModerationAPI::WebhookEvent::AuthorSuspended::Data::Object - ) -> void - - def to_hash: -> { - object: ModerationAPI::WebhookEvent::AuthorSuspended::Data::Object - } - - type object = - { - id: String, - author: ModerationAPI::WebhookEvent::AuthorSuspended::Data::Object::Author, - created_at: Time, - key: String?, - name: String?, - value: String?, - queue: ModerationAPI::WebhookEvent::AuthorSuspended::Data::Object::Queue - } - - class Object < ModerationAPI::Internal::Type::BaseModel - attr_accessor id: String - - attr_accessor author: ModerationAPI::WebhookEvent::AuthorSuspended::Data::Object::Author - - attr_accessor created_at: Time - - attr_accessor key: String? - - attr_accessor name: String? - - attr_accessor value: String? - - attr_reader queue: ModerationAPI::WebhookEvent::AuthorSuspended::Data::Object::Queue? - - def queue=: ( - ModerationAPI::WebhookEvent::AuthorSuspended::Data::Object::Queue - ) -> ModerationAPI::WebhookEvent::AuthorSuspended::Data::Object::Queue - - def initialize: ( - id: String, - author: ModerationAPI::WebhookEvent::AuthorSuspended::Data::Object::Author, - created_at: Time, - key: String?, - name: String?, - value: String?, - ?queue: ModerationAPI::WebhookEvent::AuthorSuspended::Data::Object::Queue - ) -> void - - def to_hash: -> { - id: String, - author: ModerationAPI::WebhookEvent::AuthorSuspended::Data::Object::Author, - created_at: Time, - key: String?, - name: String?, - value: String?, - queue: ModerationAPI::WebhookEvent::AuthorSuspended::Data::Object::Queue - } - - type author = - { - id: String, - block: ModerationAPI::WebhookEvent::AuthorSuspended::Data::Object::Author::Block?, - first_seen: Float, - last_seen: Float, - metadata: ModerationAPI::WebhookEvent::AuthorSuspended::Data::Object::Author::Metadata, - metrics: ModerationAPI::WebhookEvent::AuthorSuspended::Data::Object::Author::Metrics, - risk_evaluation: ModerationAPI::WebhookEvent::AuthorSuspended::Data::Object::Author::RiskEvaluation?, - status: ModerationAPI::Models::WebhookEvent::AuthorSuspended::Data::Object::Author::status, - trust_level: ModerationAPI::WebhookEvent::AuthorSuspended::Data::Object::Author::TrustLevel, - company: String?, - email: String?, - external_id: String?, - external_link: String?, - last_incident: Float?, - name: String?, - profile_picture: String? - } - - class Author < ModerationAPI::Internal::Type::BaseModel - attr_accessor id: String - - attr_accessor block: ModerationAPI::WebhookEvent::AuthorSuspended::Data::Object::Author::Block? - - attr_accessor first_seen: Float - - attr_accessor last_seen: Float - - attr_accessor metadata: ModerationAPI::WebhookEvent::AuthorSuspended::Data::Object::Author::Metadata - - attr_accessor metrics: ModerationAPI::WebhookEvent::AuthorSuspended::Data::Object::Author::Metrics - - attr_accessor risk_evaluation: ModerationAPI::WebhookEvent::AuthorSuspended::Data::Object::Author::RiskEvaluation? - - attr_accessor status: ModerationAPI::Models::WebhookEvent::AuthorSuspended::Data::Object::Author::status - - attr_accessor trust_level: ModerationAPI::WebhookEvent::AuthorSuspended::Data::Object::Author::TrustLevel - - attr_accessor company: String? - - attr_accessor email: String? - - attr_accessor external_id: String? - - attr_accessor external_link: String? - - attr_accessor last_incident: Float? - - attr_accessor name: String? - - attr_accessor profile_picture: String? - - def initialize: ( - id: String, - block: ModerationAPI::WebhookEvent::AuthorSuspended::Data::Object::Author::Block?, - first_seen: Float, - last_seen: Float, - metadata: ModerationAPI::WebhookEvent::AuthorSuspended::Data::Object::Author::Metadata, - metrics: ModerationAPI::WebhookEvent::AuthorSuspended::Data::Object::Author::Metrics, - risk_evaluation: ModerationAPI::WebhookEvent::AuthorSuspended::Data::Object::Author::RiskEvaluation?, - status: ModerationAPI::Models::WebhookEvent::AuthorSuspended::Data::Object::Author::status, - trust_level: ModerationAPI::WebhookEvent::AuthorSuspended::Data::Object::Author::TrustLevel, - ?company: String?, - ?email: String?, - ?external_id: String?, - ?external_link: String?, - ?last_incident: Float?, - ?name: String?, - ?profile_picture: String? - ) -> void - - def to_hash: -> { - id: String, - block: ModerationAPI::WebhookEvent::AuthorSuspended::Data::Object::Author::Block?, - first_seen: Float, - last_seen: Float, - metadata: ModerationAPI::WebhookEvent::AuthorSuspended::Data::Object::Author::Metadata, - metrics: ModerationAPI::WebhookEvent::AuthorSuspended::Data::Object::Author::Metrics, - risk_evaluation: ModerationAPI::WebhookEvent::AuthorSuspended::Data::Object::Author::RiskEvaluation?, - status: ModerationAPI::Models::WebhookEvent::AuthorSuspended::Data::Object::Author::status, - trust_level: ModerationAPI::WebhookEvent::AuthorSuspended::Data::Object::Author::TrustLevel, - company: String?, - email: String?, - external_id: String?, - external_link: String?, - last_incident: Float?, - name: String?, - profile_picture: String? - } - - type block = { reason: String?, until_: Float? } - - class Block < ModerationAPI::Internal::Type::BaseModel - attr_accessor reason: String? - - attr_accessor until_: Float? - - def initialize: (?reason: String?, ?until_: Float?) -> void - - def to_hash: -> { reason: String?, until_: Float? } - end - - type metadata = - { - email_verified: bool?, - identity_verified: bool?, - is_paying_customer: bool?, - phone_verified: bool? - } - - class Metadata < ModerationAPI::Internal::Type::BaseModel - attr_accessor email_verified: bool? - - attr_accessor identity_verified: bool? - - attr_accessor is_paying_customer: bool? - - attr_accessor phone_verified: bool? - - def initialize: ( - ?email_verified: bool?, - ?identity_verified: bool?, - ?is_paying_customer: bool?, - ?phone_verified: bool? - ) -> void - - def to_hash: -> { - email_verified: bool?, - identity_verified: bool?, - is_paying_customer: bool?, - phone_verified: bool? - } - end - - type metrics = - { - flagged_content: Float, - total_content: Float, - average_sentiment: Float? - } - - class Metrics < ModerationAPI::Internal::Type::BaseModel - attr_accessor flagged_content: Float - - attr_accessor total_content: Float - - attr_accessor average_sentiment: Float? - - def initialize: ( - flagged_content: Float, - total_content: Float, - ?average_sentiment: Float? - ) -> void - - def to_hash: -> { - flagged_content: Float, - total_content: Float, - average_sentiment: Float? - } - end - - type risk_evaluation = { risk_level: Float? } - - class RiskEvaluation < ModerationAPI::Internal::Type::BaseModel - attr_accessor risk_level: Float? - - def initialize: (?risk_level: Float?) -> void - - def to_hash: -> { risk_level: Float? } - end - - type status = :enabled | :suspended | :blocked - - module Status - extend ModerationAPI::Internal::Type::Enum - - ENABLED: :enabled - SUSPENDED: :suspended - BLOCKED: :blocked - - def self?.values: -> ::Array[ModerationAPI::Models::WebhookEvent::AuthorSuspended::Data::Object::Author::status] - end - - type trust_level = { level: Float, manual: bool } - - class TrustLevel < ModerationAPI::Internal::Type::BaseModel - attr_accessor level: Float - - attr_accessor manual: bool - - def initialize: (level: Float, manual: bool) -> void - - def to_hash: -> { level: Float, manual: bool } - end - end - - type queue = { id: String } - - class Queue < ModerationAPI::Internal::Type::BaseModel - attr_accessor id: String - - def initialize: (id: String) -> void - - def to_hash: -> { id: String } - end - end - end - end - - type author_updated = - { - id: String, - api_version: :v2, - created: Time, - data: ModerationAPI::WebhookEvent::AuthorUpdated::Data, - type: :"author.updated" - } - - class AuthorUpdated < ModerationAPI::Internal::Type::BaseModel - attr_accessor id: String - - attr_accessor api_version: :v2 - - attr_accessor created: Time - - attr_accessor data: ModerationAPI::WebhookEvent::AuthorUpdated::Data - - attr_accessor type: :"author.updated" - - def initialize: ( - id: String, - created: Time, - data: ModerationAPI::WebhookEvent::AuthorUpdated::Data, - ?api_version: :v2, - ?type: :"author.updated" - ) -> void - - def to_hash: -> { - id: String, - api_version: :v2, - created: Time, - data: ModerationAPI::WebhookEvent::AuthorUpdated::Data, - type: :"author.updated" - } - - type data = - { object: ModerationAPI::WebhookEvent::AuthorUpdated::Data::Object } - - class Data < ModerationAPI::Internal::Type::BaseModel - attr_accessor object: ModerationAPI::WebhookEvent::AuthorUpdated::Data::Object - - def initialize: ( - object: ModerationAPI::WebhookEvent::AuthorUpdated::Data::Object - ) -> void - - def to_hash: -> { - object: ModerationAPI::WebhookEvent::AuthorUpdated::Data::Object - } - - type object = - { - id: String, - block: ModerationAPI::WebhookEvent::AuthorUpdated::Data::Object::Block?, - first_seen: Float, - last_seen: Float, - metadata: ModerationAPI::WebhookEvent::AuthorUpdated::Data::Object::Metadata, - metrics: ModerationAPI::WebhookEvent::AuthorUpdated::Data::Object::Metrics, - risk_evaluation: ModerationAPI::WebhookEvent::AuthorUpdated::Data::Object::RiskEvaluation?, - status: ModerationAPI::Models::WebhookEvent::AuthorUpdated::Data::Object::status, - trust_level: ModerationAPI::WebhookEvent::AuthorUpdated::Data::Object::TrustLevel, - company: String?, - email: String?, - external_id: String?, - external_link: String?, - last_incident: Float?, - name: String?, - profile_picture: String? - } - - class Object < ModerationAPI::Internal::Type::BaseModel - attr_accessor id: String - - attr_accessor block: ModerationAPI::WebhookEvent::AuthorUpdated::Data::Object::Block? - - attr_accessor first_seen: Float - - attr_accessor last_seen: Float - - attr_accessor metadata: ModerationAPI::WebhookEvent::AuthorUpdated::Data::Object::Metadata - - attr_accessor metrics: ModerationAPI::WebhookEvent::AuthorUpdated::Data::Object::Metrics - - attr_accessor risk_evaluation: ModerationAPI::WebhookEvent::AuthorUpdated::Data::Object::RiskEvaluation? - - attr_accessor status: ModerationAPI::Models::WebhookEvent::AuthorUpdated::Data::Object::status - - attr_accessor trust_level: ModerationAPI::WebhookEvent::AuthorUpdated::Data::Object::TrustLevel - - attr_accessor company: String? - - attr_accessor email: String? - - attr_accessor external_id: String? - - attr_accessor external_link: String? - - attr_accessor last_incident: Float? - - attr_accessor name: String? - - attr_accessor profile_picture: String? - - def initialize: ( - id: String, - block: ModerationAPI::WebhookEvent::AuthorUpdated::Data::Object::Block?, - first_seen: Float, - last_seen: Float, - metadata: ModerationAPI::WebhookEvent::AuthorUpdated::Data::Object::Metadata, - metrics: ModerationAPI::WebhookEvent::AuthorUpdated::Data::Object::Metrics, - risk_evaluation: ModerationAPI::WebhookEvent::AuthorUpdated::Data::Object::RiskEvaluation?, - status: ModerationAPI::Models::WebhookEvent::AuthorUpdated::Data::Object::status, - trust_level: ModerationAPI::WebhookEvent::AuthorUpdated::Data::Object::TrustLevel, - ?company: String?, - ?email: String?, - ?external_id: String?, - ?external_link: String?, - ?last_incident: Float?, - ?name: String?, - ?profile_picture: String? - ) -> void - - def to_hash: -> { - id: String, - block: ModerationAPI::WebhookEvent::AuthorUpdated::Data::Object::Block?, - first_seen: Float, - last_seen: Float, - metadata: ModerationAPI::WebhookEvent::AuthorUpdated::Data::Object::Metadata, - metrics: ModerationAPI::WebhookEvent::AuthorUpdated::Data::Object::Metrics, - risk_evaluation: ModerationAPI::WebhookEvent::AuthorUpdated::Data::Object::RiskEvaluation?, - status: ModerationAPI::Models::WebhookEvent::AuthorUpdated::Data::Object::status, - trust_level: ModerationAPI::WebhookEvent::AuthorUpdated::Data::Object::TrustLevel, - company: String?, - email: String?, - external_id: String?, - external_link: String?, - last_incident: Float?, - name: String?, - profile_picture: String? - } - - type block = { reason: String?, until_: Float? } - - class Block < ModerationAPI::Internal::Type::BaseModel - attr_accessor reason: String? - - attr_accessor until_: Float? - - def initialize: (?reason: String?, ?until_: Float?) -> void - - def to_hash: -> { reason: String?, until_: Float? } - end - - type metadata = - { - email_verified: bool?, - identity_verified: bool?, - is_paying_customer: bool?, - phone_verified: bool? - } - - class Metadata < ModerationAPI::Internal::Type::BaseModel - attr_accessor email_verified: bool? - - attr_accessor identity_verified: bool? - - attr_accessor is_paying_customer: bool? - - attr_accessor phone_verified: bool? - - def initialize: ( - ?email_verified: bool?, - ?identity_verified: bool?, - ?is_paying_customer: bool?, - ?phone_verified: bool? - ) -> void - - def to_hash: -> { - email_verified: bool?, - identity_verified: bool?, - is_paying_customer: bool?, - phone_verified: bool? - } - end - - type metrics = - { - flagged_content: Float, - total_content: Float, - average_sentiment: Float? - } - - class Metrics < ModerationAPI::Internal::Type::BaseModel - attr_accessor flagged_content: Float - - attr_accessor total_content: Float - - attr_accessor average_sentiment: Float? - - def initialize: ( - flagged_content: Float, - total_content: Float, - ?average_sentiment: Float? - ) -> void - - def to_hash: -> { - flagged_content: Float, - total_content: Float, - average_sentiment: Float? - } - end - - type risk_evaluation = { risk_level: Float? } - - class RiskEvaluation < ModerationAPI::Internal::Type::BaseModel - attr_accessor risk_level: Float? - - def initialize: (?risk_level: Float?) -> void - - def to_hash: -> { risk_level: Float? } - end - - type status = :enabled | :suspended | :blocked - - module Status - extend ModerationAPI::Internal::Type::Enum - - ENABLED: :enabled - SUSPENDED: :suspended - BLOCKED: :blocked - - def self?.values: -> ::Array[ModerationAPI::Models::WebhookEvent::AuthorUpdated::Data::Object::status] - end - - type trust_level = { level: Float, manual: bool } - - class TrustLevel < ModerationAPI::Internal::Type::BaseModel - attr_accessor level: Float - - attr_accessor manual: bool - - def initialize: (level: Float, manual: bool) -> void - - def to_hash: -> { level: Float, manual: bool } - end - end - end - end - - type author_trust_level_changed = - { - id: String, - api_version: :v2, - created: Time, - data: ModerationAPI::WebhookEvent::AuthorTrustLevelChanged::Data, - type: :"author.trust_level_changed" - } - - class AuthorTrustLevelChanged < ModerationAPI::Internal::Type::BaseModel - attr_accessor id: String - - attr_accessor api_version: :v2 - - attr_accessor created: Time - - attr_accessor data: ModerationAPI::WebhookEvent::AuthorTrustLevelChanged::Data - - attr_accessor type: :"author.trust_level_changed" - - def initialize: ( - id: String, - created: Time, - data: ModerationAPI::WebhookEvent::AuthorTrustLevelChanged::Data, - ?api_version: :v2, - ?type: :"author.trust_level_changed" - ) -> void - - def to_hash: -> { - id: String, - api_version: :v2, - created: Time, - data: ModerationAPI::WebhookEvent::AuthorTrustLevelChanged::Data, - type: :"author.trust_level_changed" - } - - type data = - { - object: ModerationAPI::WebhookEvent::AuthorTrustLevelChanged::Data::Object - } - - class Data < ModerationAPI::Internal::Type::BaseModel - attr_accessor object: ModerationAPI::WebhookEvent::AuthorTrustLevelChanged::Data::Object - - def initialize: ( - object: ModerationAPI::WebhookEvent::AuthorTrustLevelChanged::Data::Object - ) -> void - - def to_hash: -> { - object: ModerationAPI::WebhookEvent::AuthorTrustLevelChanged::Data::Object - } - - type object = - { - id: String, - block: ModerationAPI::WebhookEvent::AuthorTrustLevelChanged::Data::Object::Block?, - first_seen: Float, - last_seen: Float, - metadata: ModerationAPI::WebhookEvent::AuthorTrustLevelChanged::Data::Object::Metadata, - metrics: ModerationAPI::WebhookEvent::AuthorTrustLevelChanged::Data::Object::Metrics, - risk_evaluation: ModerationAPI::WebhookEvent::AuthorTrustLevelChanged::Data::Object::RiskEvaluation?, - status: ModerationAPI::Models::WebhookEvent::AuthorTrustLevelChanged::Data::Object::status, - trust_level: ModerationAPI::WebhookEvent::AuthorTrustLevelChanged::Data::Object::TrustLevel, - company: String?, - email: String?, - external_id: String?, - external_link: String?, - last_incident: Float?, - name: String?, - profile_picture: String? - } - - class Object < ModerationAPI::Internal::Type::BaseModel - attr_accessor id: String - - attr_accessor block: ModerationAPI::WebhookEvent::AuthorTrustLevelChanged::Data::Object::Block? - - attr_accessor first_seen: Float - - attr_accessor last_seen: Float - - attr_accessor metadata: ModerationAPI::WebhookEvent::AuthorTrustLevelChanged::Data::Object::Metadata - - attr_accessor metrics: ModerationAPI::WebhookEvent::AuthorTrustLevelChanged::Data::Object::Metrics - - attr_accessor risk_evaluation: ModerationAPI::WebhookEvent::AuthorTrustLevelChanged::Data::Object::RiskEvaluation? - - attr_accessor status: ModerationAPI::Models::WebhookEvent::AuthorTrustLevelChanged::Data::Object::status - - attr_accessor trust_level: ModerationAPI::WebhookEvent::AuthorTrustLevelChanged::Data::Object::TrustLevel - - attr_accessor company: String? - - attr_accessor email: String? - - attr_accessor external_id: String? - - attr_accessor external_link: String? - - attr_accessor last_incident: Float? - - attr_accessor name: String? - - attr_accessor profile_picture: String? - - def initialize: ( - id: String, - block: ModerationAPI::WebhookEvent::AuthorTrustLevelChanged::Data::Object::Block?, - first_seen: Float, - last_seen: Float, - metadata: ModerationAPI::WebhookEvent::AuthorTrustLevelChanged::Data::Object::Metadata, - metrics: ModerationAPI::WebhookEvent::AuthorTrustLevelChanged::Data::Object::Metrics, - risk_evaluation: ModerationAPI::WebhookEvent::AuthorTrustLevelChanged::Data::Object::RiskEvaluation?, - status: ModerationAPI::Models::WebhookEvent::AuthorTrustLevelChanged::Data::Object::status, - trust_level: ModerationAPI::WebhookEvent::AuthorTrustLevelChanged::Data::Object::TrustLevel, - ?company: String?, - ?email: String?, - ?external_id: String?, - ?external_link: String?, - ?last_incident: Float?, - ?name: String?, - ?profile_picture: String? - ) -> void - - def to_hash: -> { - id: String, - block: ModerationAPI::WebhookEvent::AuthorTrustLevelChanged::Data::Object::Block?, - first_seen: Float, - last_seen: Float, - metadata: ModerationAPI::WebhookEvent::AuthorTrustLevelChanged::Data::Object::Metadata, - metrics: ModerationAPI::WebhookEvent::AuthorTrustLevelChanged::Data::Object::Metrics, - risk_evaluation: ModerationAPI::WebhookEvent::AuthorTrustLevelChanged::Data::Object::RiskEvaluation?, - status: ModerationAPI::Models::WebhookEvent::AuthorTrustLevelChanged::Data::Object::status, - trust_level: ModerationAPI::WebhookEvent::AuthorTrustLevelChanged::Data::Object::TrustLevel, - company: String?, - email: String?, - external_id: String?, - external_link: String?, - last_incident: Float?, - name: String?, - profile_picture: String? - } - - type block = { reason: String?, until_: Float? } - - class Block < ModerationAPI::Internal::Type::BaseModel - attr_accessor reason: String? - - attr_accessor until_: Float? - - def initialize: (?reason: String?, ?until_: Float?) -> void - - def to_hash: -> { reason: String?, until_: Float? } - end - - type metadata = - { - email_verified: bool?, - identity_verified: bool?, - is_paying_customer: bool?, - phone_verified: bool? - } - - class Metadata < ModerationAPI::Internal::Type::BaseModel - attr_accessor email_verified: bool? - - attr_accessor identity_verified: bool? - - attr_accessor is_paying_customer: bool? - - attr_accessor phone_verified: bool? - - def initialize: ( - ?email_verified: bool?, - ?identity_verified: bool?, - ?is_paying_customer: bool?, - ?phone_verified: bool? - ) -> void - - def to_hash: -> { - email_verified: bool?, - identity_verified: bool?, - is_paying_customer: bool?, - phone_verified: bool? - } - end - - type metrics = - { - flagged_content: Float, - total_content: Float, - average_sentiment: Float? - } - - class Metrics < ModerationAPI::Internal::Type::BaseModel - attr_accessor flagged_content: Float - - attr_accessor total_content: Float - - attr_accessor average_sentiment: Float? - - def initialize: ( - flagged_content: Float, - total_content: Float, - ?average_sentiment: Float? - ) -> void - - def to_hash: -> { - flagged_content: Float, - total_content: Float, - average_sentiment: Float? - } - end - - type risk_evaluation = { risk_level: Float? } - - class RiskEvaluation < ModerationAPI::Internal::Type::BaseModel - attr_accessor risk_level: Float? - - def initialize: (?risk_level: Float?) -> void - - def to_hash: -> { risk_level: Float? } - end - - type status = :enabled | :suspended | :blocked - - module Status - extend ModerationAPI::Internal::Type::Enum - - ENABLED: :enabled - SUSPENDED: :suspended - BLOCKED: :blocked - - def self?.values: -> ::Array[ModerationAPI::Models::WebhookEvent::AuthorTrustLevelChanged::Data::Object::status] - end - - type trust_level = { level: Float, manual: bool } - - class TrustLevel < ModerationAPI::Internal::Type::BaseModel - attr_accessor level: Float - - attr_accessor manual: bool - - def initialize: (level: Float, manual: bool) -> void - - def to_hash: -> { level: Float, manual: bool } - end - end - end - end - - type author_action = - { - id: String, - api_version: :v2, - created: Time, - data: ModerationAPI::WebhookEvent::AuthorAction::Data, - type: :"author.action" - } - - class AuthorAction < ModerationAPI::Internal::Type::BaseModel - attr_accessor id: String - - attr_accessor api_version: :v2 - - attr_accessor created: Time - - attr_accessor data: ModerationAPI::WebhookEvent::AuthorAction::Data - - attr_accessor type: :"author.action" - - def initialize: ( - id: String, - created: Time, - data: ModerationAPI::WebhookEvent::AuthorAction::Data, - ?api_version: :v2, - ?type: :"author.action" - ) -> void - - def to_hash: -> { - id: String, - api_version: :v2, - created: Time, - data: ModerationAPI::WebhookEvent::AuthorAction::Data, - type: :"author.action" - } - - type data = - { object: ModerationAPI::WebhookEvent::AuthorAction::Data::Object } - - class Data < ModerationAPI::Internal::Type::BaseModel - attr_accessor object: ModerationAPI::WebhookEvent::AuthorAction::Data::Object - - def initialize: ( - object: ModerationAPI::WebhookEvent::AuthorAction::Data::Object - ) -> void - - def to_hash: -> { - object: ModerationAPI::WebhookEvent::AuthorAction::Data::Object - } - - type object = - { - id: String, - author: ModerationAPI::WebhookEvent::AuthorAction::Data::Object::Author, - created_at: Time, - key: String?, - name: String?, - value: String?, - queue: ModerationAPI::WebhookEvent::AuthorAction::Data::Object::Queue - } - - class Object < ModerationAPI::Internal::Type::BaseModel - attr_accessor id: String - - attr_accessor author: ModerationAPI::WebhookEvent::AuthorAction::Data::Object::Author - - attr_accessor created_at: Time - - attr_accessor key: String? - - attr_accessor name: String? - - attr_accessor value: String? - - attr_reader queue: ModerationAPI::WebhookEvent::AuthorAction::Data::Object::Queue? - - def queue=: ( - ModerationAPI::WebhookEvent::AuthorAction::Data::Object::Queue - ) -> ModerationAPI::WebhookEvent::AuthorAction::Data::Object::Queue - - def initialize: ( - id: String, - author: ModerationAPI::WebhookEvent::AuthorAction::Data::Object::Author, - created_at: Time, - key: String?, - name: String?, - value: String?, - ?queue: ModerationAPI::WebhookEvent::AuthorAction::Data::Object::Queue - ) -> void - - def to_hash: -> { - id: String, - author: ModerationAPI::WebhookEvent::AuthorAction::Data::Object::Author, - created_at: Time, - key: String?, - name: String?, - value: String?, - queue: ModerationAPI::WebhookEvent::AuthorAction::Data::Object::Queue - } - - type author = - { - id: String, - block: ModerationAPI::WebhookEvent::AuthorAction::Data::Object::Author::Block?, - first_seen: Float, - last_seen: Float, - metadata: ModerationAPI::WebhookEvent::AuthorAction::Data::Object::Author::Metadata, - metrics: ModerationAPI::WebhookEvent::AuthorAction::Data::Object::Author::Metrics, - risk_evaluation: ModerationAPI::WebhookEvent::AuthorAction::Data::Object::Author::RiskEvaluation?, - status: ModerationAPI::Models::WebhookEvent::AuthorAction::Data::Object::Author::status, - trust_level: ModerationAPI::WebhookEvent::AuthorAction::Data::Object::Author::TrustLevel, - company: String?, - email: String?, - external_id: String?, - external_link: String?, - last_incident: Float?, - name: String?, - profile_picture: String? - } - - class Author < ModerationAPI::Internal::Type::BaseModel - attr_accessor id: String - - attr_accessor block: ModerationAPI::WebhookEvent::AuthorAction::Data::Object::Author::Block? - - attr_accessor first_seen: Float - - attr_accessor last_seen: Float - - attr_accessor metadata: ModerationAPI::WebhookEvent::AuthorAction::Data::Object::Author::Metadata - - attr_accessor metrics: ModerationAPI::WebhookEvent::AuthorAction::Data::Object::Author::Metrics - - attr_accessor risk_evaluation: ModerationAPI::WebhookEvent::AuthorAction::Data::Object::Author::RiskEvaluation? - - attr_accessor status: ModerationAPI::Models::WebhookEvent::AuthorAction::Data::Object::Author::status - - attr_accessor trust_level: ModerationAPI::WebhookEvent::AuthorAction::Data::Object::Author::TrustLevel - - attr_accessor company: String? - - attr_accessor email: String? - - attr_accessor external_id: String? - - attr_accessor external_link: String? - - attr_accessor last_incident: Float? - - attr_accessor name: String? - - attr_accessor profile_picture: String? - - def initialize: ( - id: String, - block: ModerationAPI::WebhookEvent::AuthorAction::Data::Object::Author::Block?, - first_seen: Float, - last_seen: Float, - metadata: ModerationAPI::WebhookEvent::AuthorAction::Data::Object::Author::Metadata, - metrics: ModerationAPI::WebhookEvent::AuthorAction::Data::Object::Author::Metrics, - risk_evaluation: ModerationAPI::WebhookEvent::AuthorAction::Data::Object::Author::RiskEvaluation?, - status: ModerationAPI::Models::WebhookEvent::AuthorAction::Data::Object::Author::status, - trust_level: ModerationAPI::WebhookEvent::AuthorAction::Data::Object::Author::TrustLevel, - ?company: String?, - ?email: String?, - ?external_id: String?, - ?external_link: String?, - ?last_incident: Float?, - ?name: String?, - ?profile_picture: String? - ) -> void - - def to_hash: -> { - id: String, - block: ModerationAPI::WebhookEvent::AuthorAction::Data::Object::Author::Block?, - first_seen: Float, - last_seen: Float, - metadata: ModerationAPI::WebhookEvent::AuthorAction::Data::Object::Author::Metadata, - metrics: ModerationAPI::WebhookEvent::AuthorAction::Data::Object::Author::Metrics, - risk_evaluation: ModerationAPI::WebhookEvent::AuthorAction::Data::Object::Author::RiskEvaluation?, - status: ModerationAPI::Models::WebhookEvent::AuthorAction::Data::Object::Author::status, - trust_level: ModerationAPI::WebhookEvent::AuthorAction::Data::Object::Author::TrustLevel, - company: String?, - email: String?, - external_id: String?, - external_link: String?, - last_incident: Float?, - name: String?, - profile_picture: String? - } - - type block = { reason: String?, until_: Float? } - - class Block < ModerationAPI::Internal::Type::BaseModel - attr_accessor reason: String? - - attr_accessor until_: Float? - - def initialize: (?reason: String?, ?until_: Float?) -> void - - def to_hash: -> { reason: String?, until_: Float? } - end - - type metadata = - { - email_verified: bool?, - identity_verified: bool?, - is_paying_customer: bool?, - phone_verified: bool? - } - - class Metadata < ModerationAPI::Internal::Type::BaseModel - attr_accessor email_verified: bool? - - attr_accessor identity_verified: bool? - - attr_accessor is_paying_customer: bool? - - attr_accessor phone_verified: bool? - - def initialize: ( - ?email_verified: bool?, - ?identity_verified: bool?, - ?is_paying_customer: bool?, - ?phone_verified: bool? - ) -> void - - def to_hash: -> { - email_verified: bool?, - identity_verified: bool?, - is_paying_customer: bool?, - phone_verified: bool? - } - end - - type metrics = - { - flagged_content: Float, - total_content: Float, - average_sentiment: Float? - } - - class Metrics < ModerationAPI::Internal::Type::BaseModel - attr_accessor flagged_content: Float - - attr_accessor total_content: Float - - attr_accessor average_sentiment: Float? - - def initialize: ( - flagged_content: Float, - total_content: Float, - ?average_sentiment: Float? - ) -> void - - def to_hash: -> { - flagged_content: Float, - total_content: Float, - average_sentiment: Float? - } - end - - type risk_evaluation = { risk_level: Float? } - - class RiskEvaluation < ModerationAPI::Internal::Type::BaseModel - attr_accessor risk_level: Float? - - def initialize: (?risk_level: Float?) -> void - - def to_hash: -> { risk_level: Float? } - end - - type status = :enabled | :suspended | :blocked - - module Status - extend ModerationAPI::Internal::Type::Enum - - ENABLED: :enabled - SUSPENDED: :suspended - BLOCKED: :blocked - - def self?.values: -> ::Array[ModerationAPI::Models::WebhookEvent::AuthorAction::Data::Object::Author::status] - end - - type trust_level = { level: Float, manual: bool } - - class TrustLevel < ModerationAPI::Internal::Type::BaseModel - attr_accessor level: Float - - attr_accessor manual: bool - - def initialize: (level: Float, manual: bool) -> void - - def to_hash: -> { level: Float, manual: bool } - end - end - - type queue = { id: String } - - class Queue < ModerationAPI::Internal::Type::BaseModel - attr_accessor id: String - - def initialize: (id: String) -> void - - def to_hash: -> { id: String } - end - end - end - end - - type queue_item_resolved = - { - id: String, - api_version: :v2, - created: Time, - data: ModerationAPI::WebhookEvent::QueueItemResolved::Data, - type: :"queue_item.resolved" - } - - class QueueItemResolved < ModerationAPI::Internal::Type::BaseModel - attr_accessor id: String - - attr_accessor api_version: :v2 - - attr_accessor created: Time - - attr_accessor data: ModerationAPI::WebhookEvent::QueueItemResolved::Data - - attr_accessor type: :"queue_item.resolved" - - def initialize: ( - id: String, - created: Time, - data: ModerationAPI::WebhookEvent::QueueItemResolved::Data, - ?api_version: :v2, - ?type: :"queue_item.resolved" - ) -> void - - def to_hash: -> { - id: String, - api_version: :v2, - created: Time, - data: ModerationAPI::WebhookEvent::QueueItemResolved::Data, - type: :"queue_item.resolved" - } - - type data = - { - object: ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object - } - - class Data < ModerationAPI::Internal::Type::BaseModel - attr_accessor object: ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object - - def initialize: ( - object: ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object - ) -> void - - def to_hash: -> { - object: ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object - } - - type object = - { - item: ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item, - author: ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Author, - queue: ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Queue - } - - class Object < ModerationAPI::Internal::Type::BaseModel - attr_accessor item: ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item - - attr_reader author: ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Author? - - def author=: ( - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Author - ) -> ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Author - - attr_reader queue: ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Queue? - - def queue=: ( - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Queue - ) -> ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Queue - - def initialize: ( - item: ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item, - ?author: ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Author, - ?queue: ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Queue - ) -> void - - def to_hash: -> { - item: ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item, - author: ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Author, - queue: ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Queue - } - - type item = - { - id: String, - author_id: String?, - channel_key: String?, - client_action: ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::ClientAction?, - content: ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object::Item::content, - conversation_id: String?, - flagged: bool?, - flagged_fields: ::Array[String], - labels: ::Array[ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::Label]?, - language: String?, - meta_type: ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object::Item::meta_type?, - metadata: ::Hash[Symbol, top]?, - timestamp: Time - } - - class Item < ModerationAPI::Internal::Type::BaseModel - attr_accessor id: String - - attr_accessor author_id: String? - - attr_accessor channel_key: String? - - attr_accessor client_action: ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::ClientAction? - - attr_accessor content: ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object::Item::content - - attr_accessor conversation_id: String? - - attr_accessor flagged: bool? - - attr_accessor flagged_fields: ::Array[String] - - attr_accessor labels: ::Array[ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::Label]? - - attr_accessor language: String? - - attr_accessor meta_type: ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object::Item::meta_type? - - attr_accessor metadata: ::Hash[Symbol, top]? - - attr_accessor timestamp: Time - - def initialize: ( - id: String, - author_id: String?, - channel_key: String?, - client_action: ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::ClientAction?, - content: ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object::Item::content, - conversation_id: String?, - flagged: bool?, - flagged_fields: ::Array[String], - labels: ::Array[ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::Label]?, - language: String?, - meta_type: ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object::Item::meta_type?, - metadata: ::Hash[Symbol, top]?, - timestamp: Time - ) -> void - - def to_hash: -> { - id: String, - author_id: String?, - channel_key: String?, - client_action: ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::ClientAction?, - content: ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object::Item::content, - conversation_id: String?, - flagged: bool?, - flagged_fields: ::Array[String], - labels: ::Array[ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::Label]?, - language: String?, - meta_type: ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object::Item::meta_type?, - metadata: ::Hash[Symbol, top]?, - timestamp: Time - } - - type client_action = - { - action: ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object::Item::ClientAction::action, - behavior: ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object::Item::ClientAction::behavior, - reason: String, - source: String - } - - class ClientAction < ModerationAPI::Internal::Type::BaseModel - attr_accessor action: ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object::Item::ClientAction::action - - attr_reader behavior: ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object::Item::ClientAction::behavior? - - def behavior=: ( - ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object::Item::ClientAction::behavior - ) -> ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object::Item::ClientAction::behavior - - attr_reader reason: String? - - def reason=: (String) -> String - - attr_reader source: String? - - def source=: (String) -> String - - def initialize: ( - action: ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object::Item::ClientAction::action, - ?behavior: ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object::Item::ClientAction::behavior, - ?reason: String, - ?source: String - ) -> void - - def to_hash: -> { - action: ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object::Item::ClientAction::action, - behavior: ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object::Item::ClientAction::behavior, - reason: String, - source: String - } - - type action = :review | :allow | :reject - - module Action - extend ModerationAPI::Internal::Type::Enum - - REVIEW: :review - ALLOW: :allow - REJECT: :reject - - def self?.values: -> ::Array[ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object::Item::ClientAction::action] - end - - type behavior = :override | :escalate - - module Behavior - extend ModerationAPI::Internal::Type::Enum - - OVERRIDE: :override - ESCALATE: :escalate - - def self?.values: -> ::Array[ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object::Item::ClientAction::behavior] - end - end - - type content = - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::Content::Text - | ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::Content::Image - | ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::Content::Video - | ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::Content::Audio - | ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::Content::Object - - module Content - extend ModerationAPI::Internal::Type::Union - - type text = { text: String, type: :text } - - class Text < ModerationAPI::Internal::Type::BaseModel - attr_accessor text: String - - attr_accessor type: :text - - def initialize: (text: String, ?type: :text) -> void - - def to_hash: -> { text: String, type: :text } - end - - type image = { type: :image, data: String, url: String } - - class Image < ModerationAPI::Internal::Type::BaseModel - attr_accessor type: :image - - attr_reader data: String? - - def data=: (String) -> String - - attr_reader url: String? - - def url=: (String) -> String - - def initialize: ( - ?data: String, - ?url: String, - ?type: :image - ) -> void - - def to_hash: -> { type: :image, data: String, url: String } - end - - type video = { type: :video, url: String } - - class Video < ModerationAPI::Internal::Type::BaseModel - attr_accessor type: :video - - attr_accessor url: String - - def initialize: (url: String, ?type: :video) -> void - - def to_hash: -> { type: :video, url: String } - end - - type audio = { type: :audio, url: String } - - class Audio < ModerationAPI::Internal::Type::BaseModel - attr_accessor type: :audio - - attr_accessor url: String - - def initialize: (url: String, ?type: :audio) -> void - - def to_hash: -> { type: :audio, url: String } - end - - type object = - { - data: ::Hash[Symbol, ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object::Item::Content::Object::data], - type: :object - } - - class Object < ModerationAPI::Internal::Type::BaseModel - attr_accessor data: ::Hash[Symbol, ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object::Item::Content::Object::data] - - attr_accessor type: :object - - def initialize: ( - data: ::Hash[Symbol, ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object::Item::Content::Object::data], - ?type: :object - ) -> void - - def to_hash: -> { - data: ::Hash[Symbol, ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object::Item::Content::Object::data], - type: :object - } - - type data = - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::Content::Object::Data::Text - | ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::Content::Object::Data::Image - | ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::Content::Object::Data::Video - | ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::Content::Object::Data::Audio - - module Data - extend ModerationAPI::Internal::Type::Union - - type text = { text: String, type: :text } - - class Text < ModerationAPI::Internal::Type::BaseModel - attr_accessor text: String - - attr_accessor type: :text - - def initialize: (text: String, ?type: :text) -> void - - def to_hash: -> { text: String, type: :text } - end - - type image = { type: :image, data: String, url: String } - - class Image < ModerationAPI::Internal::Type::BaseModel - attr_accessor type: :image - - attr_reader data: String? - - def data=: (String) -> String - - attr_reader url: String? - - def url=: (String) -> String - - def initialize: ( - ?data: String, - ?url: String, - ?type: :image - ) -> void - - def to_hash: -> { - type: :image, - data: String, - url: String - } - end - - type video = { type: :video, url: String } - - class Video < ModerationAPI::Internal::Type::BaseModel - attr_accessor type: :video - - attr_accessor url: String - - def initialize: (url: String, ?type: :video) -> void - - def to_hash: -> { type: :video, url: String } - end - - type audio = { type: :audio, url: String } - - class Audio < ModerationAPI::Internal::Type::BaseModel - attr_accessor type: :audio - - attr_accessor url: String - - def initialize: (url: String, ?type: :audio) -> void - - def to_hash: -> { type: :audio, url: String } - end - - def self?.variants: -> ::Array[ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object::Item::Content::Object::data] - end - end - - def self?.variants: -> ::Array[ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object::Item::content] - end - - type label = - { - label: String, - score: Float, - flagged: bool, - manual: bool, - matches: ::Array[ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::Label::Match], - shadow_flagged: bool - } - - class Label < ModerationAPI::Internal::Type::BaseModel - attr_accessor label: String - - attr_accessor score: Float - - attr_reader flagged: bool? - - def flagged=: (bool) -> bool - - attr_reader manual: bool? - - def manual=: (bool) -> bool - - attr_reader matches: ::Array[ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::Label::Match]? - - def matches=: ( - ::Array[ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::Label::Match] - ) -> ::Array[ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::Label::Match] - - attr_reader shadow_flagged: bool? - - def shadow_flagged=: (bool) -> bool - - def initialize: ( - label: String, - score: Float, - ?flagged: bool, - ?manual: bool, - ?matches: ::Array[ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::Label::Match], - ?shadow_flagged: bool - ) -> void - - def to_hash: -> { - label: String, - score: Float, - flagged: bool, - manual: bool, - matches: ::Array[ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::Label::Match], - shadow_flagged: bool - } - - type match = - { - match: String, - probability: Float, - span: ::Array[top], - entity_type: String, - mask: String?, - reasons: ::Array[String], - scripts: ::Array[String], - signals: ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::Label::Match::Signals, - skeleton: String - } - - class Match < ModerationAPI::Internal::Type::BaseModel - attr_accessor match: String - - attr_accessor probability: Float - - attr_accessor span: ::Array[top] - - attr_reader entity_type: String? - - def entity_type=: (String) -> String - - attr_accessor mask: String? - - attr_reader reasons: ::Array[String]? - - def reasons=: (::Array[String]) -> ::Array[String] - - attr_reader scripts: ::Array[String]? - - def scripts=: (::Array[String]) -> ::Array[String] - - attr_reader signals: ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::Label::Match::Signals? - - def signals=: ( - ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::Label::Match::Signals - ) -> ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::Label::Match::Signals - - attr_reader skeleton: String? - - def skeleton=: (String) -> String - - def initialize: ( - match: String, - probability: Float, - span: ::Array[top], - ?entity_type: String, - ?mask: String?, - ?reasons: ::Array[String], - ?scripts: ::Array[String], - ?signals: ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::Label::Match::Signals, - ?skeleton: String - ) -> void - - def to_hash: -> { - match: String, - probability: Float, - span: ::Array[top], - entity_type: String, - mask: String?, - reasons: ::Array[String], - scripts: ::Array[String], - signals: ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::Label::Match::Signals, - skeleton: String - } - - type signals = - { - bot_protection: bool?, - brand_impersonation: ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::Label::Match::Signals::BrandImpersonation?, - domain_age_days: Float?, - final_url: String?, - has_email_setup: bool?, - has_suspicious_characters: bool, - is_link_shortener: bool, - is_reported: bool, - redirect_count: Float? - } - - class Signals < ModerationAPI::Internal::Type::BaseModel - attr_accessor bot_protection: bool? - - attr_accessor brand_impersonation: ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::Label::Match::Signals::BrandImpersonation? - - attr_accessor domain_age_days: Float? - - attr_accessor final_url: String? - - attr_accessor has_email_setup: bool? - - attr_accessor has_suspicious_characters: bool - - attr_accessor is_link_shortener: bool - - attr_accessor is_reported: bool - - attr_accessor redirect_count: Float? - - def initialize: ( - bot_protection: bool?, - brand_impersonation: ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::Label::Match::Signals::BrandImpersonation?, - domain_age_days: Float?, - final_url: String?, - has_email_setup: bool?, - has_suspicious_characters: bool, - is_link_shortener: bool, - is_reported: bool, - redirect_count: Float? - ) -> void - - def to_hash: -> { - bot_protection: bool?, - brand_impersonation: ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Item::Label::Match::Signals::BrandImpersonation?, - domain_age_days: Float?, - final_url: String?, - has_email_setup: bool?, - has_suspicious_characters: bool, - is_link_shortener: bool, - is_reported: bool, - redirect_count: Float? - } - - type brand_impersonation = - { brand: String, method_: String } - - class BrandImpersonation < ModerationAPI::Internal::Type::BaseModel - attr_accessor brand: String - - attr_accessor method_: String - - def initialize: (brand: String, method_: String) -> void - - def to_hash: -> { brand: String, method_: String } - end - end - end - end - - type meta_type = - :profile - | :message - | :post - | :comment - | :event - | :product - | :review - | :voice - | :other - - module MetaType - extend ModerationAPI::Internal::Type::Enum - - PROFILE: :profile - MESSAGE: :message - POST: :post - COMMENT: :comment - EVENT: :event - PRODUCT: :product - REVIEW: :review - VOICE: :voice - OTHER: :other - - def self?.values: -> ::Array[ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object::Item::meta_type] - end - end - - type author = - { - id: String, - block: ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Author::Block?, - first_seen: Float, - last_seen: Float, - metadata: ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Author::Metadata, - metrics: ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Author::Metrics, - risk_evaluation: ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Author::RiskEvaluation?, - status: ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object::Author::status, - trust_level: ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Author::TrustLevel, - company: String?, - email: String?, - external_id: String?, - external_link: String?, - last_incident: Float?, - name: String?, - profile_picture: String? - } - - class Author < ModerationAPI::Internal::Type::BaseModel - attr_accessor id: String - - attr_accessor block: ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Author::Block? - - attr_accessor first_seen: Float - - attr_accessor last_seen: Float - - attr_accessor metadata: ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Author::Metadata - - attr_accessor metrics: ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Author::Metrics - - attr_accessor risk_evaluation: ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Author::RiskEvaluation? - - attr_accessor status: ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object::Author::status - - attr_accessor trust_level: ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Author::TrustLevel - - attr_accessor company: String? - - attr_accessor email: String? - - attr_accessor external_id: String? - - attr_accessor external_link: String? - - attr_accessor last_incident: Float? - - attr_accessor name: String? - - attr_accessor profile_picture: String? - - def initialize: ( - id: String, - block: ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Author::Block?, - first_seen: Float, - last_seen: Float, - metadata: ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Author::Metadata, - metrics: ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Author::Metrics, - risk_evaluation: ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Author::RiskEvaluation?, - status: ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object::Author::status, - trust_level: ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Author::TrustLevel, - ?company: String?, - ?email: String?, - ?external_id: String?, - ?external_link: String?, - ?last_incident: Float?, - ?name: String?, - ?profile_picture: String? - ) -> void - - def to_hash: -> { - id: String, - block: ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Author::Block?, - first_seen: Float, - last_seen: Float, - metadata: ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Author::Metadata, - metrics: ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Author::Metrics, - risk_evaluation: ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Author::RiskEvaluation?, - status: ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object::Author::status, - trust_level: ModerationAPI::WebhookEvent::QueueItemResolved::Data::Object::Author::TrustLevel, - company: String?, - email: String?, - external_id: String?, - external_link: String?, - last_incident: Float?, - name: String?, - profile_picture: String? - } - - type block = { reason: String?, until_: Float? } - - class Block < ModerationAPI::Internal::Type::BaseModel - attr_accessor reason: String? - - attr_accessor until_: Float? - - def initialize: (?reason: String?, ?until_: Float?) -> void - - def to_hash: -> { reason: String?, until_: Float? } - end - - type metadata = - { - email_verified: bool?, - identity_verified: bool?, - is_paying_customer: bool?, - phone_verified: bool? - } - - class Metadata < ModerationAPI::Internal::Type::BaseModel - attr_accessor email_verified: bool? - - attr_accessor identity_verified: bool? - - attr_accessor is_paying_customer: bool? - - attr_accessor phone_verified: bool? - - def initialize: ( - ?email_verified: bool?, - ?identity_verified: bool?, - ?is_paying_customer: bool?, - ?phone_verified: bool? - ) -> void - - def to_hash: -> { - email_verified: bool?, - identity_verified: bool?, - is_paying_customer: bool?, - phone_verified: bool? - } - end - - type metrics = - { - flagged_content: Float, - total_content: Float, - average_sentiment: Float? - } - - class Metrics < ModerationAPI::Internal::Type::BaseModel - attr_accessor flagged_content: Float - - attr_accessor total_content: Float - - attr_accessor average_sentiment: Float? - - def initialize: ( - flagged_content: Float, - total_content: Float, - ?average_sentiment: Float? - ) -> void - - def to_hash: -> { - flagged_content: Float, - total_content: Float, - average_sentiment: Float? - } - end - - type risk_evaluation = { risk_level: Float? } - - class RiskEvaluation < ModerationAPI::Internal::Type::BaseModel - attr_accessor risk_level: Float? - - def initialize: (?risk_level: Float?) -> void - - def to_hash: -> { risk_level: Float? } - end - - type status = :enabled | :suspended | :blocked - - module Status - extend ModerationAPI::Internal::Type::Enum - - ENABLED: :enabled - SUSPENDED: :suspended - BLOCKED: :blocked - - def self?.values: -> ::Array[ModerationAPI::Models::WebhookEvent::QueueItemResolved::Data::Object::Author::status] - end - - type trust_level = { level: Float, manual: bool } - - class TrustLevel < ModerationAPI::Internal::Type::BaseModel - attr_accessor level: Float - - attr_accessor manual: bool - - def initialize: (level: Float, manual: bool) -> void - - def to_hash: -> { level: Float, manual: bool } - end - end - - type queue = { id: String } - - class Queue < ModerationAPI::Internal::Type::BaseModel - attr_accessor id: String - - def initialize: (id: String) -> void - - def to_hash: -> { id: String } - end - end - end - end - - type queue_item_action = - { - id: String, - api_version: :v2, - created: Time, - data: ModerationAPI::WebhookEvent::QueueItemAction::Data, - type: :"queue_item.action" - } - - class QueueItemAction < ModerationAPI::Internal::Type::BaseModel - attr_accessor id: String - - attr_accessor api_version: :v2 - - attr_accessor created: Time - - attr_accessor data: ModerationAPI::WebhookEvent::QueueItemAction::Data - - attr_accessor type: :"queue_item.action" - - def initialize: ( - id: String, - created: Time, - data: ModerationAPI::WebhookEvent::QueueItemAction::Data, - ?api_version: :v2, - ?type: :"queue_item.action" - ) -> void - - def to_hash: -> { - id: String, - api_version: :v2, - created: Time, - data: ModerationAPI::WebhookEvent::QueueItemAction::Data, - type: :"queue_item.action" - } - - type data = - { object: ModerationAPI::WebhookEvent::QueueItemAction::Data::Object } - - class Data < ModerationAPI::Internal::Type::BaseModel - attr_accessor object: ModerationAPI::WebhookEvent::QueueItemAction::Data::Object - - def initialize: ( - object: ModerationAPI::WebhookEvent::QueueItemAction::Data::Object - ) -> void - - def to_hash: -> { - object: ModerationAPI::WebhookEvent::QueueItemAction::Data::Object - } - - type object = - { - id: String, - created_at: Time, - key: String?, - name: String?, - value: String?, - author: ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Author, - item: ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item, - queue: ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Queue - } - - class Object < ModerationAPI::Internal::Type::BaseModel - attr_accessor id: String - - attr_accessor created_at: Time - - attr_accessor key: String? - - attr_accessor name: String? - - attr_accessor value: String? - - attr_reader author: ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Author? - - def author=: ( - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Author - ) -> ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Author - - attr_reader item: ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item? - - def item=: ( - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item - ) -> ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item - - attr_reader queue: ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Queue? - - def queue=: ( - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Queue - ) -> ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Queue - - def initialize: ( - id: String, - created_at: Time, - key: String?, - name: String?, - value: String?, - ?author: ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Author, - ?item: ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item, - ?queue: ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Queue - ) -> void - - def to_hash: -> { - id: String, - created_at: Time, - key: String?, - name: String?, - value: String?, - author: ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Author, - item: ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item, - queue: ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Queue - } - - type author = - { - id: String, - block: ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Author::Block?, - first_seen: Float, - last_seen: Float, - metadata: ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Author::Metadata, - metrics: ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Author::Metrics, - risk_evaluation: ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Author::RiskEvaluation?, - status: ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object::Author::status, - trust_level: ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Author::TrustLevel, - company: String?, - email: String?, - external_id: String?, - external_link: String?, - last_incident: Float?, - name: String?, - profile_picture: String? - } - - class Author < ModerationAPI::Internal::Type::BaseModel - attr_accessor id: String - - attr_accessor block: ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Author::Block? - - attr_accessor first_seen: Float - - attr_accessor last_seen: Float - - attr_accessor metadata: ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Author::Metadata - - attr_accessor metrics: ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Author::Metrics - - attr_accessor risk_evaluation: ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Author::RiskEvaluation? - - attr_accessor status: ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object::Author::status - - attr_accessor trust_level: ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Author::TrustLevel - - attr_accessor company: String? - - attr_accessor email: String? - - attr_accessor external_id: String? - - attr_accessor external_link: String? - - attr_accessor last_incident: Float? - - attr_accessor name: String? - - attr_accessor profile_picture: String? - - def initialize: ( - id: String, - block: ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Author::Block?, - first_seen: Float, - last_seen: Float, - metadata: ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Author::Metadata, - metrics: ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Author::Metrics, - risk_evaluation: ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Author::RiskEvaluation?, - status: ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object::Author::status, - trust_level: ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Author::TrustLevel, - ?company: String?, - ?email: String?, - ?external_id: String?, - ?external_link: String?, - ?last_incident: Float?, - ?name: String?, - ?profile_picture: String? - ) -> void - - def to_hash: -> { - id: String, - block: ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Author::Block?, - first_seen: Float, - last_seen: Float, - metadata: ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Author::Metadata, - metrics: ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Author::Metrics, - risk_evaluation: ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Author::RiskEvaluation?, - status: ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object::Author::status, - trust_level: ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Author::TrustLevel, - company: String?, - email: String?, - external_id: String?, - external_link: String?, - last_incident: Float?, - name: String?, - profile_picture: String? - } - - type block = { reason: String?, until_: Float? } - - class Block < ModerationAPI::Internal::Type::BaseModel - attr_accessor reason: String? - - attr_accessor until_: Float? - - def initialize: (?reason: String?, ?until_: Float?) -> void - - def to_hash: -> { reason: String?, until_: Float? } - end - - type metadata = - { - email_verified: bool?, - identity_verified: bool?, - is_paying_customer: bool?, - phone_verified: bool? - } - - class Metadata < ModerationAPI::Internal::Type::BaseModel - attr_accessor email_verified: bool? - - attr_accessor identity_verified: bool? - - attr_accessor is_paying_customer: bool? - - attr_accessor phone_verified: bool? - - def initialize: ( - ?email_verified: bool?, - ?identity_verified: bool?, - ?is_paying_customer: bool?, - ?phone_verified: bool? - ) -> void - - def to_hash: -> { - email_verified: bool?, - identity_verified: bool?, - is_paying_customer: bool?, - phone_verified: bool? - } - end - - type metrics = - { - flagged_content: Float, - total_content: Float, - average_sentiment: Float? - } - - class Metrics < ModerationAPI::Internal::Type::BaseModel - attr_accessor flagged_content: Float - - attr_accessor total_content: Float - - attr_accessor average_sentiment: Float? - - def initialize: ( - flagged_content: Float, - total_content: Float, - ?average_sentiment: Float? - ) -> void - - def to_hash: -> { - flagged_content: Float, - total_content: Float, - average_sentiment: Float? - } - end - - type risk_evaluation = { risk_level: Float? } - - class RiskEvaluation < ModerationAPI::Internal::Type::BaseModel - attr_accessor risk_level: Float? - - def initialize: (?risk_level: Float?) -> void - - def to_hash: -> { risk_level: Float? } - end - - type status = :enabled | :suspended | :blocked - - module Status - extend ModerationAPI::Internal::Type::Enum - - ENABLED: :enabled - SUSPENDED: :suspended - BLOCKED: :blocked - - def self?.values: -> ::Array[ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object::Author::status] - end - - type trust_level = { level: Float, manual: bool } - - class TrustLevel < ModerationAPI::Internal::Type::BaseModel - attr_accessor level: Float - - attr_accessor manual: bool - - def initialize: (level: Float, manual: bool) -> void - - def to_hash: -> { level: Float, manual: bool } - end - end - - type item = - { - id: String, - author_id: String?, - channel_key: String?, - client_action: ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::ClientAction?, - content: ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object::Item::content, - conversation_id: String?, - flagged: bool?, - flagged_fields: ::Array[String], - labels: ::Array[ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::Label]?, - language: String?, - meta_type: ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object::Item::meta_type?, - metadata: ::Hash[Symbol, top]?, - timestamp: Time - } - - class Item < ModerationAPI::Internal::Type::BaseModel - attr_accessor id: String - - attr_accessor author_id: String? - - attr_accessor channel_key: String? - - attr_accessor client_action: ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::ClientAction? - - attr_accessor content: ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object::Item::content - - attr_accessor conversation_id: String? - - attr_accessor flagged: bool? - - attr_accessor flagged_fields: ::Array[String] - - attr_accessor labels: ::Array[ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::Label]? - - attr_accessor language: String? - - attr_accessor meta_type: ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object::Item::meta_type? - - attr_accessor metadata: ::Hash[Symbol, top]? - - attr_accessor timestamp: Time - - def initialize: ( - id: String, - author_id: String?, - channel_key: String?, - client_action: ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::ClientAction?, - content: ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object::Item::content, - conversation_id: String?, - flagged: bool?, - flagged_fields: ::Array[String], - labels: ::Array[ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::Label]?, - language: String?, - meta_type: ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object::Item::meta_type?, - metadata: ::Hash[Symbol, top]?, - timestamp: Time - ) -> void - - def to_hash: -> { - id: String, - author_id: String?, - channel_key: String?, - client_action: ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::ClientAction?, - content: ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object::Item::content, - conversation_id: String?, - flagged: bool?, - flagged_fields: ::Array[String], - labels: ::Array[ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::Label]?, - language: String?, - meta_type: ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object::Item::meta_type?, - metadata: ::Hash[Symbol, top]?, - timestamp: Time - } - - type client_action = - { - action: ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object::Item::ClientAction::action, - behavior: ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object::Item::ClientAction::behavior, - reason: String, - source: String - } - - class ClientAction < ModerationAPI::Internal::Type::BaseModel - attr_accessor action: ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object::Item::ClientAction::action - - attr_reader behavior: ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object::Item::ClientAction::behavior? - - def behavior=: ( - ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object::Item::ClientAction::behavior - ) -> ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object::Item::ClientAction::behavior - - attr_reader reason: String? - - def reason=: (String) -> String - - attr_reader source: String? - - def source=: (String) -> String - - def initialize: ( - action: ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object::Item::ClientAction::action, - ?behavior: ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object::Item::ClientAction::behavior, - ?reason: String, - ?source: String - ) -> void - - def to_hash: -> { - action: ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object::Item::ClientAction::action, - behavior: ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object::Item::ClientAction::behavior, - reason: String, - source: String - } - - type action = :review | :allow | :reject - - module Action - extend ModerationAPI::Internal::Type::Enum - - REVIEW: :review - ALLOW: :allow - REJECT: :reject - - def self?.values: -> ::Array[ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object::Item::ClientAction::action] - end - - type behavior = :override | :escalate - - module Behavior - extend ModerationAPI::Internal::Type::Enum - - OVERRIDE: :override - ESCALATE: :escalate - - def self?.values: -> ::Array[ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object::Item::ClientAction::behavior] - end - end - - type content = - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::Content::Text - | ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::Content::Image - | ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::Content::Video - | ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::Content::Audio - | ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::Content::Object - - module Content - extend ModerationAPI::Internal::Type::Union - - type text = { text: String, type: :text } - - class Text < ModerationAPI::Internal::Type::BaseModel - attr_accessor text: String - - attr_accessor type: :text - - def initialize: (text: String, ?type: :text) -> void - - def to_hash: -> { text: String, type: :text } - end - - type image = { type: :image, data: String, url: String } - - class Image < ModerationAPI::Internal::Type::BaseModel - attr_accessor type: :image - - attr_reader data: String? - - def data=: (String) -> String - - attr_reader url: String? - - def url=: (String) -> String - - def initialize: ( - ?data: String, - ?url: String, - ?type: :image - ) -> void - - def to_hash: -> { type: :image, data: String, url: String } - end - - type video = { type: :video, url: String } - - class Video < ModerationAPI::Internal::Type::BaseModel - attr_accessor type: :video - - attr_accessor url: String - - def initialize: (url: String, ?type: :video) -> void - - def to_hash: -> { type: :video, url: String } - end - - type audio = { type: :audio, url: String } - - class Audio < ModerationAPI::Internal::Type::BaseModel - attr_accessor type: :audio - - attr_accessor url: String - - def initialize: (url: String, ?type: :audio) -> void - - def to_hash: -> { type: :audio, url: String } - end - - type object = - { - data: ::Hash[Symbol, ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object::Item::Content::Object::data], - type: :object - } - - class Object < ModerationAPI::Internal::Type::BaseModel - attr_accessor data: ::Hash[Symbol, ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object::Item::Content::Object::data] - - attr_accessor type: :object - - def initialize: ( - data: ::Hash[Symbol, ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object::Item::Content::Object::data], - ?type: :object - ) -> void - - def to_hash: -> { - data: ::Hash[Symbol, ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object::Item::Content::Object::data], - type: :object - } - - type data = - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::Content::Object::Data::Text - | ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::Content::Object::Data::Image - | ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::Content::Object::Data::Video - | ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::Content::Object::Data::Audio - - module Data - extend ModerationAPI::Internal::Type::Union - - type text = { text: String, type: :text } - - class Text < ModerationAPI::Internal::Type::BaseModel - attr_accessor text: String - - attr_accessor type: :text - - def initialize: (text: String, ?type: :text) -> void - - def to_hash: -> { text: String, type: :text } - end - - type image = { type: :image, data: String, url: String } - - class Image < ModerationAPI::Internal::Type::BaseModel - attr_accessor type: :image - - attr_reader data: String? - - def data=: (String) -> String - - attr_reader url: String? - - def url=: (String) -> String - - def initialize: ( - ?data: String, - ?url: String, - ?type: :image - ) -> void - - def to_hash: -> { - type: :image, - data: String, - url: String - } - end - - type video = { type: :video, url: String } - - class Video < ModerationAPI::Internal::Type::BaseModel - attr_accessor type: :video - - attr_accessor url: String - - def initialize: (url: String, ?type: :video) -> void - - def to_hash: -> { type: :video, url: String } - end - - type audio = { type: :audio, url: String } - - class Audio < ModerationAPI::Internal::Type::BaseModel - attr_accessor type: :audio - - attr_accessor url: String - - def initialize: (url: String, ?type: :audio) -> void - - def to_hash: -> { type: :audio, url: String } - end - - def self?.variants: -> ::Array[ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object::Item::Content::Object::data] - end - end - - def self?.variants: -> ::Array[ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object::Item::content] - end - - type label = - { - label: String, - score: Float, - flagged: bool, - manual: bool, - matches: ::Array[ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::Label::Match], - shadow_flagged: bool - } - - class Label < ModerationAPI::Internal::Type::BaseModel - attr_accessor label: String - - attr_accessor score: Float - - attr_reader flagged: bool? - - def flagged=: (bool) -> bool - - attr_reader manual: bool? - - def manual=: (bool) -> bool - - attr_reader matches: ::Array[ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::Label::Match]? - - def matches=: ( - ::Array[ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::Label::Match] - ) -> ::Array[ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::Label::Match] - - attr_reader shadow_flagged: bool? - - def shadow_flagged=: (bool) -> bool - - def initialize: ( - label: String, - score: Float, - ?flagged: bool, - ?manual: bool, - ?matches: ::Array[ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::Label::Match], - ?shadow_flagged: bool - ) -> void - - def to_hash: -> { - label: String, - score: Float, - flagged: bool, - manual: bool, - matches: ::Array[ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::Label::Match], - shadow_flagged: bool - } - - type match = - { - match: String, - probability: Float, - span: ::Array[top], - entity_type: String, - mask: String?, - reasons: ::Array[String], - scripts: ::Array[String], - signals: ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::Label::Match::Signals, - skeleton: String - } - - class Match < ModerationAPI::Internal::Type::BaseModel - attr_accessor match: String - - attr_accessor probability: Float - - attr_accessor span: ::Array[top] - - attr_reader entity_type: String? - - def entity_type=: (String) -> String - - attr_accessor mask: String? - - attr_reader reasons: ::Array[String]? - - def reasons=: (::Array[String]) -> ::Array[String] - - attr_reader scripts: ::Array[String]? - - def scripts=: (::Array[String]) -> ::Array[String] - - attr_reader signals: ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::Label::Match::Signals? - - def signals=: ( - ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::Label::Match::Signals - ) -> ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::Label::Match::Signals - - attr_reader skeleton: String? - - def skeleton=: (String) -> String - - def initialize: ( - match: String, - probability: Float, - span: ::Array[top], - ?entity_type: String, - ?mask: String?, - ?reasons: ::Array[String], - ?scripts: ::Array[String], - ?signals: ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::Label::Match::Signals, - ?skeleton: String - ) -> void - - def to_hash: -> { - match: String, - probability: Float, - span: ::Array[top], - entity_type: String, - mask: String?, - reasons: ::Array[String], - scripts: ::Array[String], - signals: ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::Label::Match::Signals, - skeleton: String - } - - type signals = - { - bot_protection: bool?, - brand_impersonation: ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::Label::Match::Signals::BrandImpersonation?, - domain_age_days: Float?, - final_url: String?, - has_email_setup: bool?, - has_suspicious_characters: bool, - is_link_shortener: bool, - is_reported: bool, - redirect_count: Float? - } - - class Signals < ModerationAPI::Internal::Type::BaseModel - attr_accessor bot_protection: bool? - - attr_accessor brand_impersonation: ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::Label::Match::Signals::BrandImpersonation? - - attr_accessor domain_age_days: Float? - - attr_accessor final_url: String? - - attr_accessor has_email_setup: bool? - - attr_accessor has_suspicious_characters: bool - - attr_accessor is_link_shortener: bool - - attr_accessor is_reported: bool - - attr_accessor redirect_count: Float? - - def initialize: ( - bot_protection: bool?, - brand_impersonation: ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::Label::Match::Signals::BrandImpersonation?, - domain_age_days: Float?, - final_url: String?, - has_email_setup: bool?, - has_suspicious_characters: bool, - is_link_shortener: bool, - is_reported: bool, - redirect_count: Float? - ) -> void - - def to_hash: -> { - bot_protection: bool?, - brand_impersonation: ModerationAPI::WebhookEvent::QueueItemAction::Data::Object::Item::Label::Match::Signals::BrandImpersonation?, - domain_age_days: Float?, - final_url: String?, - has_email_setup: bool?, - has_suspicious_characters: bool, - is_link_shortener: bool, - is_reported: bool, - redirect_count: Float? - } - - type brand_impersonation = - { brand: String, method_: String } - - class BrandImpersonation < ModerationAPI::Internal::Type::BaseModel - attr_accessor brand: String - - attr_accessor method_: String - - def initialize: (brand: String, method_: String) -> void - - def to_hash: -> { brand: String, method_: String } - end - end - end - end - - type meta_type = - :profile - | :message - | :post - | :comment - | :event - | :product - | :review - | :voice - | :other - - module MetaType - extend ModerationAPI::Internal::Type::Enum - - PROFILE: :profile - MESSAGE: :message - POST: :post - COMMENT: :comment - EVENT: :event - PRODUCT: :product - REVIEW: :review - VOICE: :voice - OTHER: :other - - def self?.values: -> ::Array[ModerationAPI::Models::WebhookEvent::QueueItemAction::Data::Object::Item::meta_type] - end - end - - type queue = { id: String } - - class Queue < ModerationAPI::Internal::Type::BaseModel - attr_accessor id: String - - def initialize: (id: String) -> void - - def to_hash: -> { id: String } - end - end - end - end - - type queue_item_rejected = - { - id: String, - api_version: :v2, - created: Time, - data: ModerationAPI::WebhookEvent::QueueItemRejected::Data, - type: :"queue_item.rejected" - } - - class QueueItemRejected < ModerationAPI::Internal::Type::BaseModel - attr_accessor id: String - - attr_accessor api_version: :v2 - - attr_accessor created: Time - - attr_accessor data: ModerationAPI::WebhookEvent::QueueItemRejected::Data - - attr_accessor type: :"queue_item.rejected" - - def initialize: ( - id: String, - created: Time, - data: ModerationAPI::WebhookEvent::QueueItemRejected::Data, - ?api_version: :v2, - ?type: :"queue_item.rejected" - ) -> void - - def to_hash: -> { - id: String, - api_version: :v2, - created: Time, - data: ModerationAPI::WebhookEvent::QueueItemRejected::Data, - type: :"queue_item.rejected" - } - - type data = - { - object: ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object - } - - class Data < ModerationAPI::Internal::Type::BaseModel - attr_accessor object: ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object - - def initialize: ( - object: ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object - ) -> void - - def to_hash: -> { - object: ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object - } - - type object = - { - id: String, - created_at: Time, - key: String?, - name: String?, - value: String?, - author: ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Author, - item: ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item, - queue: ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Queue - } - - class Object < ModerationAPI::Internal::Type::BaseModel - attr_accessor id: String - - attr_accessor created_at: Time - - attr_accessor key: String? - - attr_accessor name: String? - - attr_accessor value: String? - - attr_reader author: ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Author? - - def author=: ( - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Author - ) -> ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Author - - attr_reader item: ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item? - - def item=: ( - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item - ) -> ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item - - attr_reader queue: ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Queue? - - def queue=: ( - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Queue - ) -> ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Queue - - def initialize: ( - id: String, - created_at: Time, - key: String?, - name: String?, - value: String?, - ?author: ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Author, - ?item: ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item, - ?queue: ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Queue - ) -> void - - def to_hash: -> { - id: String, - created_at: Time, - key: String?, - name: String?, - value: String?, - author: ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Author, - item: ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item, - queue: ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Queue - } - - type author = - { - id: String, - block: ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Author::Block?, - first_seen: Float, - last_seen: Float, - metadata: ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Author::Metadata, - metrics: ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Author::Metrics, - risk_evaluation: ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Author::RiskEvaluation?, - status: ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Author::status, - trust_level: ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Author::TrustLevel, - company: String?, - email: String?, - external_id: String?, - external_link: String?, - last_incident: Float?, - name: String?, - profile_picture: String? - } - - class Author < ModerationAPI::Internal::Type::BaseModel - attr_accessor id: String - - attr_accessor block: ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Author::Block? - - attr_accessor first_seen: Float - - attr_accessor last_seen: Float - - attr_accessor metadata: ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Author::Metadata - - attr_accessor metrics: ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Author::Metrics - - attr_accessor risk_evaluation: ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Author::RiskEvaluation? - - attr_accessor status: ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Author::status - - attr_accessor trust_level: ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Author::TrustLevel - - attr_accessor company: String? - - attr_accessor email: String? - - attr_accessor external_id: String? - - attr_accessor external_link: String? - - attr_accessor last_incident: Float? - - attr_accessor name: String? - - attr_accessor profile_picture: String? - - def initialize: ( - id: String, - block: ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Author::Block?, - first_seen: Float, - last_seen: Float, - metadata: ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Author::Metadata, - metrics: ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Author::Metrics, - risk_evaluation: ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Author::RiskEvaluation?, - status: ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Author::status, - trust_level: ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Author::TrustLevel, - ?company: String?, - ?email: String?, - ?external_id: String?, - ?external_link: String?, - ?last_incident: Float?, - ?name: String?, - ?profile_picture: String? - ) -> void - - def to_hash: -> { - id: String, - block: ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Author::Block?, - first_seen: Float, - last_seen: Float, - metadata: ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Author::Metadata, - metrics: ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Author::Metrics, - risk_evaluation: ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Author::RiskEvaluation?, - status: ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Author::status, - trust_level: ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Author::TrustLevel, - company: String?, - email: String?, - external_id: String?, - external_link: String?, - last_incident: Float?, - name: String?, - profile_picture: String? - } - - type block = { reason: String?, until_: Float? } - - class Block < ModerationAPI::Internal::Type::BaseModel - attr_accessor reason: String? - - attr_accessor until_: Float? - - def initialize: (?reason: String?, ?until_: Float?) -> void - - def to_hash: -> { reason: String?, until_: Float? } - end - - type metadata = - { - email_verified: bool?, - identity_verified: bool?, - is_paying_customer: bool?, - phone_verified: bool? - } - - class Metadata < ModerationAPI::Internal::Type::BaseModel - attr_accessor email_verified: bool? - - attr_accessor identity_verified: bool? - - attr_accessor is_paying_customer: bool? - - attr_accessor phone_verified: bool? - - def initialize: ( - ?email_verified: bool?, - ?identity_verified: bool?, - ?is_paying_customer: bool?, - ?phone_verified: bool? - ) -> void - - def to_hash: -> { - email_verified: bool?, - identity_verified: bool?, - is_paying_customer: bool?, - phone_verified: bool? - } - end - - type metrics = - { - flagged_content: Float, - total_content: Float, - average_sentiment: Float? - } - - class Metrics < ModerationAPI::Internal::Type::BaseModel - attr_accessor flagged_content: Float - - attr_accessor total_content: Float - - attr_accessor average_sentiment: Float? - - def initialize: ( - flagged_content: Float, - total_content: Float, - ?average_sentiment: Float? - ) -> void - - def to_hash: -> { - flagged_content: Float, - total_content: Float, - average_sentiment: Float? - } - end - - type risk_evaluation = { risk_level: Float? } - - class RiskEvaluation < ModerationAPI::Internal::Type::BaseModel - attr_accessor risk_level: Float? - - def initialize: (?risk_level: Float?) -> void - - def to_hash: -> { risk_level: Float? } - end - - type status = :enabled | :suspended | :blocked - - module Status - extend ModerationAPI::Internal::Type::Enum - - ENABLED: :enabled - SUSPENDED: :suspended - BLOCKED: :blocked - - def self?.values: -> ::Array[ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Author::status] - end - - type trust_level = { level: Float, manual: bool } - - class TrustLevel < ModerationAPI::Internal::Type::BaseModel - attr_accessor level: Float - - attr_accessor manual: bool - - def initialize: (level: Float, manual: bool) -> void - - def to_hash: -> { level: Float, manual: bool } - end - end - - type item = - { - id: String, - author_id: String?, - channel_key: String?, - client_action: ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::ClientAction?, - content: ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Item::content, - conversation_id: String?, - flagged: bool?, - flagged_fields: ::Array[String], - labels: ::Array[ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::Label]?, - language: String?, - meta_type: ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Item::meta_type?, - metadata: ::Hash[Symbol, top]?, - timestamp: Time - } - - class Item < ModerationAPI::Internal::Type::BaseModel - attr_accessor id: String - - attr_accessor author_id: String? - - attr_accessor channel_key: String? - - attr_accessor client_action: ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::ClientAction? - - attr_accessor content: ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Item::content - - attr_accessor conversation_id: String? - - attr_accessor flagged: bool? - - attr_accessor flagged_fields: ::Array[String] - - attr_accessor labels: ::Array[ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::Label]? - - attr_accessor language: String? - - attr_accessor meta_type: ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Item::meta_type? - - attr_accessor metadata: ::Hash[Symbol, top]? - - attr_accessor timestamp: Time - - def initialize: ( - id: String, - author_id: String?, - channel_key: String?, - client_action: ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::ClientAction?, - content: ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Item::content, - conversation_id: String?, - flagged: bool?, - flagged_fields: ::Array[String], - labels: ::Array[ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::Label]?, - language: String?, - meta_type: ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Item::meta_type?, - metadata: ::Hash[Symbol, top]?, - timestamp: Time - ) -> void - - def to_hash: -> { - id: String, - author_id: String?, - channel_key: String?, - client_action: ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::ClientAction?, - content: ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Item::content, - conversation_id: String?, - flagged: bool?, - flagged_fields: ::Array[String], - labels: ::Array[ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::Label]?, - language: String?, - meta_type: ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Item::meta_type?, - metadata: ::Hash[Symbol, top]?, - timestamp: Time - } - - type client_action = - { - action: ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Item::ClientAction::action, - behavior: ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Item::ClientAction::behavior, - reason: String, - source: String - } - - class ClientAction < ModerationAPI::Internal::Type::BaseModel - attr_accessor action: ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Item::ClientAction::action - - attr_reader behavior: ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Item::ClientAction::behavior? - - def behavior=: ( - ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Item::ClientAction::behavior - ) -> ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Item::ClientAction::behavior - - attr_reader reason: String? - - def reason=: (String) -> String - - attr_reader source: String? - - def source=: (String) -> String - - def initialize: ( - action: ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Item::ClientAction::action, - ?behavior: ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Item::ClientAction::behavior, - ?reason: String, - ?source: String - ) -> void - - def to_hash: -> { - action: ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Item::ClientAction::action, - behavior: ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Item::ClientAction::behavior, - reason: String, - source: String - } - - type action = :review | :allow | :reject - - module Action - extend ModerationAPI::Internal::Type::Enum - - REVIEW: :review - ALLOW: :allow - REJECT: :reject - - def self?.values: -> ::Array[ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Item::ClientAction::action] - end - - type behavior = :override | :escalate - - module Behavior - extend ModerationAPI::Internal::Type::Enum - - OVERRIDE: :override - ESCALATE: :escalate - - def self?.values: -> ::Array[ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Item::ClientAction::behavior] - end - end - - type content = - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::Content::Text - | ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::Content::Image - | ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::Content::Video - | ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::Content::Audio - | ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::Content::Object - - module Content - extend ModerationAPI::Internal::Type::Union - - type text = { text: String, type: :text } - - class Text < ModerationAPI::Internal::Type::BaseModel - attr_accessor text: String - - attr_accessor type: :text - - def initialize: (text: String, ?type: :text) -> void - - def to_hash: -> { text: String, type: :text } - end - - type image = { type: :image, data: String, url: String } - - class Image < ModerationAPI::Internal::Type::BaseModel - attr_accessor type: :image - - attr_reader data: String? - - def data=: (String) -> String - - attr_reader url: String? - - def url=: (String) -> String - - def initialize: ( - ?data: String, - ?url: String, - ?type: :image - ) -> void - - def to_hash: -> { type: :image, data: String, url: String } - end - - type video = { type: :video, url: String } - - class Video < ModerationAPI::Internal::Type::BaseModel - attr_accessor type: :video - - attr_accessor url: String - - def initialize: (url: String, ?type: :video) -> void - - def to_hash: -> { type: :video, url: String } - end - - type audio = { type: :audio, url: String } - - class Audio < ModerationAPI::Internal::Type::BaseModel - attr_accessor type: :audio - - attr_accessor url: String - - def initialize: (url: String, ?type: :audio) -> void - - def to_hash: -> { type: :audio, url: String } - end - - type object = - { - data: ::Hash[Symbol, ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Item::Content::Object::data], - type: :object - } - - class Object < ModerationAPI::Internal::Type::BaseModel - attr_accessor data: ::Hash[Symbol, ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Item::Content::Object::data] - - attr_accessor type: :object - - def initialize: ( - data: ::Hash[Symbol, ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Item::Content::Object::data], - ?type: :object - ) -> void - - def to_hash: -> { - data: ::Hash[Symbol, ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Item::Content::Object::data], - type: :object - } - - type data = - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::Content::Object::Data::Text - | ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::Content::Object::Data::Image - | ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::Content::Object::Data::Video - | ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::Content::Object::Data::Audio - - module Data - extend ModerationAPI::Internal::Type::Union - - type text = { text: String, type: :text } - - class Text < ModerationAPI::Internal::Type::BaseModel - attr_accessor text: String - - attr_accessor type: :text - - def initialize: (text: String, ?type: :text) -> void - - def to_hash: -> { text: String, type: :text } - end - - type image = { type: :image, data: String, url: String } - - class Image < ModerationAPI::Internal::Type::BaseModel - attr_accessor type: :image - - attr_reader data: String? - - def data=: (String) -> String - - attr_reader url: String? - - def url=: (String) -> String - - def initialize: ( - ?data: String, - ?url: String, - ?type: :image - ) -> void - - def to_hash: -> { - type: :image, - data: String, - url: String - } - end - - type video = { type: :video, url: String } - - class Video < ModerationAPI::Internal::Type::BaseModel - attr_accessor type: :video - - attr_accessor url: String - - def initialize: (url: String, ?type: :video) -> void - - def to_hash: -> { type: :video, url: String } - end - - type audio = { type: :audio, url: String } - - class Audio < ModerationAPI::Internal::Type::BaseModel - attr_accessor type: :audio - - attr_accessor url: String - - def initialize: (url: String, ?type: :audio) -> void - - def to_hash: -> { type: :audio, url: String } - end - - def self?.variants: -> ::Array[ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Item::Content::Object::data] - end - end - - def self?.variants: -> ::Array[ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Item::content] - end - - type label = - { - label: String, - score: Float, - flagged: bool, - manual: bool, - matches: ::Array[ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::Label::Match], - shadow_flagged: bool - } - - class Label < ModerationAPI::Internal::Type::BaseModel - attr_accessor label: String - - attr_accessor score: Float - - attr_reader flagged: bool? - - def flagged=: (bool) -> bool - - attr_reader manual: bool? - - def manual=: (bool) -> bool - - attr_reader matches: ::Array[ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::Label::Match]? - - def matches=: ( - ::Array[ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::Label::Match] - ) -> ::Array[ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::Label::Match] - - attr_reader shadow_flagged: bool? - - def shadow_flagged=: (bool) -> bool - - def initialize: ( - label: String, - score: Float, - ?flagged: bool, - ?manual: bool, - ?matches: ::Array[ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::Label::Match], - ?shadow_flagged: bool - ) -> void - - def to_hash: -> { - label: String, - score: Float, - flagged: bool, - manual: bool, - matches: ::Array[ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::Label::Match], - shadow_flagged: bool - } - - type match = - { - match: String, - probability: Float, - span: ::Array[top], - entity_type: String, - mask: String?, - reasons: ::Array[String], - scripts: ::Array[String], - signals: ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::Label::Match::Signals, - skeleton: String - } - - class Match < ModerationAPI::Internal::Type::BaseModel - attr_accessor match: String - - attr_accessor probability: Float - - attr_accessor span: ::Array[top] - - attr_reader entity_type: String? - - def entity_type=: (String) -> String - - attr_accessor mask: String? - - attr_reader reasons: ::Array[String]? - - def reasons=: (::Array[String]) -> ::Array[String] - - attr_reader scripts: ::Array[String]? - - def scripts=: (::Array[String]) -> ::Array[String] - - attr_reader signals: ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::Label::Match::Signals? - - def signals=: ( - ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::Label::Match::Signals - ) -> ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::Label::Match::Signals - - attr_reader skeleton: String? - - def skeleton=: (String) -> String - - def initialize: ( - match: String, - probability: Float, - span: ::Array[top], - ?entity_type: String, - ?mask: String?, - ?reasons: ::Array[String], - ?scripts: ::Array[String], - ?signals: ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::Label::Match::Signals, - ?skeleton: String - ) -> void - - def to_hash: -> { - match: String, - probability: Float, - span: ::Array[top], - entity_type: String, - mask: String?, - reasons: ::Array[String], - scripts: ::Array[String], - signals: ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::Label::Match::Signals, - skeleton: String - } - - type signals = - { - bot_protection: bool?, - brand_impersonation: ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::Label::Match::Signals::BrandImpersonation?, - domain_age_days: Float?, - final_url: String?, - has_email_setup: bool?, - has_suspicious_characters: bool, - is_link_shortener: bool, - is_reported: bool, - redirect_count: Float? - } - - class Signals < ModerationAPI::Internal::Type::BaseModel - attr_accessor bot_protection: bool? - - attr_accessor brand_impersonation: ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::Label::Match::Signals::BrandImpersonation? - - attr_accessor domain_age_days: Float? - - attr_accessor final_url: String? - - attr_accessor has_email_setup: bool? - - attr_accessor has_suspicious_characters: bool - - attr_accessor is_link_shortener: bool - - attr_accessor is_reported: bool - - attr_accessor redirect_count: Float? - - def initialize: ( - bot_protection: bool?, - brand_impersonation: ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::Label::Match::Signals::BrandImpersonation?, - domain_age_days: Float?, - final_url: String?, - has_email_setup: bool?, - has_suspicious_characters: bool, - is_link_shortener: bool, - is_reported: bool, - redirect_count: Float? - ) -> void - - def to_hash: -> { - bot_protection: bool?, - brand_impersonation: ModerationAPI::WebhookEvent::QueueItemRejected::Data::Object::Item::Label::Match::Signals::BrandImpersonation?, - domain_age_days: Float?, - final_url: String?, - has_email_setup: bool?, - has_suspicious_characters: bool, - is_link_shortener: bool, - is_reported: bool, - redirect_count: Float? - } - - type brand_impersonation = - { brand: String, method_: String } - - class BrandImpersonation < ModerationAPI::Internal::Type::BaseModel - attr_accessor brand: String - - attr_accessor method_: String - - def initialize: (brand: String, method_: String) -> void - - def to_hash: -> { brand: String, method_: String } - end - end - end - end - - type meta_type = - :profile - | :message - | :post - | :comment - | :event - | :product - | :review - | :voice - | :other - - module MetaType - extend ModerationAPI::Internal::Type::Enum - - PROFILE: :profile - MESSAGE: :message - POST: :post - COMMENT: :comment - EVENT: :event - PRODUCT: :product - REVIEW: :review - VOICE: :voice - OTHER: :other - - def self?.values: -> ::Array[ModerationAPI::Models::WebhookEvent::QueueItemRejected::Data::Object::Item::meta_type] - end - end - - type queue = { id: String } - - class Queue < ModerationAPI::Internal::Type::BaseModel - attr_accessor id: String - - def initialize: (id: String) -> void - - def to_hash: -> { id: String } - end - end - end - end - - type queue_item_allowed = - { - id: String, - api_version: :v2, - created: Time, - data: ModerationAPI::WebhookEvent::QueueItemAllowed::Data, - type: :"queue_item.allowed" - } - - class QueueItemAllowed < ModerationAPI::Internal::Type::BaseModel - attr_accessor id: String - - attr_accessor api_version: :v2 - - attr_accessor created: Time - - attr_accessor data: ModerationAPI::WebhookEvent::QueueItemAllowed::Data - - attr_accessor type: :"queue_item.allowed" - - def initialize: ( - id: String, - created: Time, - data: ModerationAPI::WebhookEvent::QueueItemAllowed::Data, - ?api_version: :v2, - ?type: :"queue_item.allowed" - ) -> void - - def to_hash: -> { - id: String, - api_version: :v2, - created: Time, - data: ModerationAPI::WebhookEvent::QueueItemAllowed::Data, - type: :"queue_item.allowed" - } - - type data = - { - object: ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object - } - - class Data < ModerationAPI::Internal::Type::BaseModel - attr_accessor object: ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object - - def initialize: ( - object: ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object - ) -> void - - def to_hash: -> { - object: ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object - } - - type object = - { - id: String, - created_at: Time, - key: String?, - name: String?, - value: String?, - author: ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Author, - item: ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item, - queue: ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Queue - } - - class Object < ModerationAPI::Internal::Type::BaseModel - attr_accessor id: String - - attr_accessor created_at: Time - - attr_accessor key: String? - - attr_accessor name: String? - - attr_accessor value: String? - - attr_reader author: ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Author? - - def author=: ( - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Author - ) -> ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Author - - attr_reader item: ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item? - - def item=: ( - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item - ) -> ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item - - attr_reader queue: ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Queue? - - def queue=: ( - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Queue - ) -> ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Queue - - def initialize: ( - id: String, - created_at: Time, - key: String?, - name: String?, - value: String?, - ?author: ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Author, - ?item: ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item, - ?queue: ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Queue - ) -> void - - def to_hash: -> { - id: String, - created_at: Time, - key: String?, - name: String?, - value: String?, - author: ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Author, - item: ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item, - queue: ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Queue - } - - type author = - { - id: String, - block: ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Author::Block?, - first_seen: Float, - last_seen: Float, - metadata: ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Author::Metadata, - metrics: ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Author::Metrics, - risk_evaluation: ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Author::RiskEvaluation?, - status: ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object::Author::status, - trust_level: ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Author::TrustLevel, - company: String?, - email: String?, - external_id: String?, - external_link: String?, - last_incident: Float?, - name: String?, - profile_picture: String? - } - - class Author < ModerationAPI::Internal::Type::BaseModel - attr_accessor id: String - - attr_accessor block: ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Author::Block? - - attr_accessor first_seen: Float - - attr_accessor last_seen: Float - - attr_accessor metadata: ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Author::Metadata - - attr_accessor metrics: ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Author::Metrics - - attr_accessor risk_evaluation: ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Author::RiskEvaluation? - - attr_accessor status: ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object::Author::status - - attr_accessor trust_level: ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Author::TrustLevel - - attr_accessor company: String? - - attr_accessor email: String? - - attr_accessor external_id: String? - - attr_accessor external_link: String? - - attr_accessor last_incident: Float? - - attr_accessor name: String? - - attr_accessor profile_picture: String? - - def initialize: ( - id: String, - block: ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Author::Block?, - first_seen: Float, - last_seen: Float, - metadata: ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Author::Metadata, - metrics: ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Author::Metrics, - risk_evaluation: ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Author::RiskEvaluation?, - status: ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object::Author::status, - trust_level: ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Author::TrustLevel, - ?company: String?, - ?email: String?, - ?external_id: String?, - ?external_link: String?, - ?last_incident: Float?, - ?name: String?, - ?profile_picture: String? - ) -> void - - def to_hash: -> { - id: String, - block: ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Author::Block?, - first_seen: Float, - last_seen: Float, - metadata: ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Author::Metadata, - metrics: ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Author::Metrics, - risk_evaluation: ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Author::RiskEvaluation?, - status: ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object::Author::status, - trust_level: ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Author::TrustLevel, - company: String?, - email: String?, - external_id: String?, - external_link: String?, - last_incident: Float?, - name: String?, - profile_picture: String? - } - - type block = { reason: String?, until_: Float? } - - class Block < ModerationAPI::Internal::Type::BaseModel - attr_accessor reason: String? - - attr_accessor until_: Float? - - def initialize: (?reason: String?, ?until_: Float?) -> void - - def to_hash: -> { reason: String?, until_: Float? } - end - - type metadata = - { - email_verified: bool?, - identity_verified: bool?, - is_paying_customer: bool?, - phone_verified: bool? - } - - class Metadata < ModerationAPI::Internal::Type::BaseModel - attr_accessor email_verified: bool? - - attr_accessor identity_verified: bool? - - attr_accessor is_paying_customer: bool? - - attr_accessor phone_verified: bool? - - def initialize: ( - ?email_verified: bool?, - ?identity_verified: bool?, - ?is_paying_customer: bool?, - ?phone_verified: bool? - ) -> void - - def to_hash: -> { - email_verified: bool?, - identity_verified: bool?, - is_paying_customer: bool?, - phone_verified: bool? - } - end - - type metrics = - { - flagged_content: Float, - total_content: Float, - average_sentiment: Float? - } - - class Metrics < ModerationAPI::Internal::Type::BaseModel - attr_accessor flagged_content: Float - - attr_accessor total_content: Float - - attr_accessor average_sentiment: Float? - - def initialize: ( - flagged_content: Float, - total_content: Float, - ?average_sentiment: Float? - ) -> void - - def to_hash: -> { - flagged_content: Float, - total_content: Float, - average_sentiment: Float? - } - end - - type risk_evaluation = { risk_level: Float? } - - class RiskEvaluation < ModerationAPI::Internal::Type::BaseModel - attr_accessor risk_level: Float? - - def initialize: (?risk_level: Float?) -> void - - def to_hash: -> { risk_level: Float? } - end - - type status = :enabled | :suspended | :blocked - - module Status - extend ModerationAPI::Internal::Type::Enum - - ENABLED: :enabled - SUSPENDED: :suspended - BLOCKED: :blocked - - def self?.values: -> ::Array[ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object::Author::status] - end - - type trust_level = { level: Float, manual: bool } - - class TrustLevel < ModerationAPI::Internal::Type::BaseModel - attr_accessor level: Float - - attr_accessor manual: bool - - def initialize: (level: Float, manual: bool) -> void - - def to_hash: -> { level: Float, manual: bool } - end - end - - type item = - { - id: String, - author_id: String?, - channel_key: String?, - client_action: ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::ClientAction?, - content: ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object::Item::content, - conversation_id: String?, - flagged: bool?, - flagged_fields: ::Array[String], - labels: ::Array[ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::Label]?, - language: String?, - meta_type: ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object::Item::meta_type?, - metadata: ::Hash[Symbol, top]?, - timestamp: Time - } - - class Item < ModerationAPI::Internal::Type::BaseModel - attr_accessor id: String - - attr_accessor author_id: String? - - attr_accessor channel_key: String? - - attr_accessor client_action: ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::ClientAction? - - attr_accessor content: ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object::Item::content - - attr_accessor conversation_id: String? - - attr_accessor flagged: bool? - - attr_accessor flagged_fields: ::Array[String] - - attr_accessor labels: ::Array[ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::Label]? - - attr_accessor language: String? - - attr_accessor meta_type: ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object::Item::meta_type? - - attr_accessor metadata: ::Hash[Symbol, top]? - - attr_accessor timestamp: Time - - def initialize: ( - id: String, - author_id: String?, - channel_key: String?, - client_action: ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::ClientAction?, - content: ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object::Item::content, - conversation_id: String?, - flagged: bool?, - flagged_fields: ::Array[String], - labels: ::Array[ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::Label]?, - language: String?, - meta_type: ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object::Item::meta_type?, - metadata: ::Hash[Symbol, top]?, - timestamp: Time - ) -> void - - def to_hash: -> { - id: String, - author_id: String?, - channel_key: String?, - client_action: ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::ClientAction?, - content: ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object::Item::content, - conversation_id: String?, - flagged: bool?, - flagged_fields: ::Array[String], - labels: ::Array[ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::Label]?, - language: String?, - meta_type: ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object::Item::meta_type?, - metadata: ::Hash[Symbol, top]?, - timestamp: Time - } - - type client_action = - { - action: ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object::Item::ClientAction::action, - behavior: ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object::Item::ClientAction::behavior, - reason: String, - source: String - } - - class ClientAction < ModerationAPI::Internal::Type::BaseModel - attr_accessor action: ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object::Item::ClientAction::action - - attr_reader behavior: ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object::Item::ClientAction::behavior? - - def behavior=: ( - ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object::Item::ClientAction::behavior - ) -> ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object::Item::ClientAction::behavior - - attr_reader reason: String? - - def reason=: (String) -> String - - attr_reader source: String? - - def source=: (String) -> String - - def initialize: ( - action: ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object::Item::ClientAction::action, - ?behavior: ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object::Item::ClientAction::behavior, - ?reason: String, - ?source: String - ) -> void - - def to_hash: -> { - action: ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object::Item::ClientAction::action, - behavior: ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object::Item::ClientAction::behavior, - reason: String, - source: String - } - - type action = :review | :allow | :reject - - module Action - extend ModerationAPI::Internal::Type::Enum - - REVIEW: :review - ALLOW: :allow - REJECT: :reject - - def self?.values: -> ::Array[ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object::Item::ClientAction::action] - end - - type behavior = :override | :escalate - - module Behavior - extend ModerationAPI::Internal::Type::Enum - - OVERRIDE: :override - ESCALATE: :escalate - - def self?.values: -> ::Array[ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object::Item::ClientAction::behavior] - end - end - - type content = - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::Content::Text - | ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::Content::Image - | ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::Content::Video - | ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::Content::Audio - | ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::Content::Object - - module Content - extend ModerationAPI::Internal::Type::Union - - type text = { text: String, type: :text } - - class Text < ModerationAPI::Internal::Type::BaseModel - attr_accessor text: String - - attr_accessor type: :text - - def initialize: (text: String, ?type: :text) -> void - - def to_hash: -> { text: String, type: :text } - end - - type image = { type: :image, data: String, url: String } - - class Image < ModerationAPI::Internal::Type::BaseModel - attr_accessor type: :image - - attr_reader data: String? - - def data=: (String) -> String - - attr_reader url: String? - - def url=: (String) -> String - - def initialize: ( - ?data: String, - ?url: String, - ?type: :image - ) -> void - - def to_hash: -> { type: :image, data: String, url: String } - end - - type video = { type: :video, url: String } - - class Video < ModerationAPI::Internal::Type::BaseModel - attr_accessor type: :video - - attr_accessor url: String - - def initialize: (url: String, ?type: :video) -> void - - def to_hash: -> { type: :video, url: String } - end - - type audio = { type: :audio, url: String } - - class Audio < ModerationAPI::Internal::Type::BaseModel - attr_accessor type: :audio - - attr_accessor url: String - - def initialize: (url: String, ?type: :audio) -> void - - def to_hash: -> { type: :audio, url: String } - end - - type object = - { - data: ::Hash[Symbol, ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object::Item::Content::Object::data], - type: :object - } - - class Object < ModerationAPI::Internal::Type::BaseModel - attr_accessor data: ::Hash[Symbol, ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object::Item::Content::Object::data] - - attr_accessor type: :object - - def initialize: ( - data: ::Hash[Symbol, ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object::Item::Content::Object::data], - ?type: :object - ) -> void - - def to_hash: -> { - data: ::Hash[Symbol, ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object::Item::Content::Object::data], - type: :object - } - - type data = - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::Content::Object::Data::Text - | ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::Content::Object::Data::Image - | ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::Content::Object::Data::Video - | ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::Content::Object::Data::Audio - - module Data - extend ModerationAPI::Internal::Type::Union - - type text = { text: String, type: :text } - - class Text < ModerationAPI::Internal::Type::BaseModel - attr_accessor text: String - - attr_accessor type: :text - - def initialize: (text: String, ?type: :text) -> void - - def to_hash: -> { text: String, type: :text } - end - - type image = { type: :image, data: String, url: String } - - class Image < ModerationAPI::Internal::Type::BaseModel - attr_accessor type: :image - - attr_reader data: String? - - def data=: (String) -> String - - attr_reader url: String? - - def url=: (String) -> String - - def initialize: ( - ?data: String, - ?url: String, - ?type: :image - ) -> void - - def to_hash: -> { - type: :image, - data: String, - url: String - } - end - - type video = { type: :video, url: String } - - class Video < ModerationAPI::Internal::Type::BaseModel - attr_accessor type: :video - - attr_accessor url: String - - def initialize: (url: String, ?type: :video) -> void - - def to_hash: -> { type: :video, url: String } - end - - type audio = { type: :audio, url: String } - - class Audio < ModerationAPI::Internal::Type::BaseModel - attr_accessor type: :audio - - attr_accessor url: String - - def initialize: (url: String, ?type: :audio) -> void - - def to_hash: -> { type: :audio, url: String } - end - - def self?.variants: -> ::Array[ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object::Item::Content::Object::data] - end - end - - def self?.variants: -> ::Array[ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object::Item::content] - end - - type label = - { - label: String, - score: Float, - flagged: bool, - manual: bool, - matches: ::Array[ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::Label::Match], - shadow_flagged: bool - } - - class Label < ModerationAPI::Internal::Type::BaseModel - attr_accessor label: String - - attr_accessor score: Float - - attr_reader flagged: bool? - - def flagged=: (bool) -> bool - - attr_reader manual: bool? - - def manual=: (bool) -> bool - - attr_reader matches: ::Array[ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::Label::Match]? - - def matches=: ( - ::Array[ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::Label::Match] - ) -> ::Array[ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::Label::Match] - - attr_reader shadow_flagged: bool? - - def shadow_flagged=: (bool) -> bool - - def initialize: ( - label: String, - score: Float, - ?flagged: bool, - ?manual: bool, - ?matches: ::Array[ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::Label::Match], - ?shadow_flagged: bool - ) -> void - - def to_hash: -> { - label: String, - score: Float, - flagged: bool, - manual: bool, - matches: ::Array[ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::Label::Match], - shadow_flagged: bool - } - - type match = - { - match: String, - probability: Float, - span: ::Array[top], - entity_type: String, - mask: String?, - reasons: ::Array[String], - scripts: ::Array[String], - signals: ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::Label::Match::Signals, - skeleton: String - } - - class Match < ModerationAPI::Internal::Type::BaseModel - attr_accessor match: String - - attr_accessor probability: Float - - attr_accessor span: ::Array[top] - - attr_reader entity_type: String? - - def entity_type=: (String) -> String - - attr_accessor mask: String? - - attr_reader reasons: ::Array[String]? - - def reasons=: (::Array[String]) -> ::Array[String] - - attr_reader scripts: ::Array[String]? - - def scripts=: (::Array[String]) -> ::Array[String] - - attr_reader signals: ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::Label::Match::Signals? - - def signals=: ( - ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::Label::Match::Signals - ) -> ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::Label::Match::Signals - - attr_reader skeleton: String? - - def skeleton=: (String) -> String - - def initialize: ( - match: String, - probability: Float, - span: ::Array[top], - ?entity_type: String, - ?mask: String?, - ?reasons: ::Array[String], - ?scripts: ::Array[String], - ?signals: ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::Label::Match::Signals, - ?skeleton: String - ) -> void - - def to_hash: -> { - match: String, - probability: Float, - span: ::Array[top], - entity_type: String, - mask: String?, - reasons: ::Array[String], - scripts: ::Array[String], - signals: ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::Label::Match::Signals, - skeleton: String - } - - type signals = - { - bot_protection: bool?, - brand_impersonation: ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::Label::Match::Signals::BrandImpersonation?, - domain_age_days: Float?, - final_url: String?, - has_email_setup: bool?, - has_suspicious_characters: bool, - is_link_shortener: bool, - is_reported: bool, - redirect_count: Float? - } - - class Signals < ModerationAPI::Internal::Type::BaseModel - attr_accessor bot_protection: bool? - - attr_accessor brand_impersonation: ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::Label::Match::Signals::BrandImpersonation? - - attr_accessor domain_age_days: Float? - - attr_accessor final_url: String? - - attr_accessor has_email_setup: bool? - - attr_accessor has_suspicious_characters: bool - - attr_accessor is_link_shortener: bool - - attr_accessor is_reported: bool - - attr_accessor redirect_count: Float? - - def initialize: ( - bot_protection: bool?, - brand_impersonation: ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::Label::Match::Signals::BrandImpersonation?, - domain_age_days: Float?, - final_url: String?, - has_email_setup: bool?, - has_suspicious_characters: bool, - is_link_shortener: bool, - is_reported: bool, - redirect_count: Float? - ) -> void - - def to_hash: -> { - bot_protection: bool?, - brand_impersonation: ModerationAPI::WebhookEvent::QueueItemAllowed::Data::Object::Item::Label::Match::Signals::BrandImpersonation?, - domain_age_days: Float?, - final_url: String?, - has_email_setup: bool?, - has_suspicious_characters: bool, - is_link_shortener: bool, - is_reported: bool, - redirect_count: Float? - } - - type brand_impersonation = - { brand: String, method_: String } - - class BrandImpersonation < ModerationAPI::Internal::Type::BaseModel - attr_accessor brand: String - - attr_accessor method_: String - - def initialize: (brand: String, method_: String) -> void - - def to_hash: -> { brand: String, method_: String } - end - end - end - end - - type meta_type = - :profile - | :message - | :post - | :comment - | :event - | :product - | :review - | :voice - | :other - - module MetaType - extend ModerationAPI::Internal::Type::Enum - - PROFILE: :profile - MESSAGE: :message - POST: :post - COMMENT: :comment - EVENT: :event - PRODUCT: :product - REVIEW: :review - VOICE: :voice - OTHER: :other - - def self?.values: -> ::Array[ModerationAPI::Models::WebhookEvent::QueueItemAllowed::Data::Object::Item::meta_type] - end - end - - type queue = { id: String } - - class Queue < ModerationAPI::Internal::Type::BaseModel - attr_accessor id: String - - def initialize: (id: String) -> void - - def to_hash: -> { id: String } - end - end - end - end - - def self?.variants: -> ::Array[ModerationAPI::Models::webhook_event] - end - end -end diff --git a/sig/moderation_api/models/webhook_list_params.rbs b/sig/moderation_api/models/webhook_list_params.rbs deleted file mode 100644 index 6a182d75..00000000 --- a/sig/moderation_api/models/webhook_list_params.rbs +++ /dev/null @@ -1,15 +0,0 @@ -module ModerationAPI - module Models - type webhook_list_params = - { } & ModerationAPI::Internal::Type::request_parameters - - class WebhookListParams < ModerationAPI::Internal::Type::BaseModel - extend ModerationAPI::Internal::Type::RequestParameters::Converter - include ModerationAPI::Internal::Type::RequestParameters - - def initialize: (?request_options: ModerationAPI::request_opts) -> void - - def to_hash: -> { request_options: ModerationAPI::RequestOptions } - end - end -end diff --git a/sig/moderation_api/models/webhook_list_response.rbs b/sig/moderation_api/models/webhook_list_response.rbs deleted file mode 100644 index b99d724e..00000000 --- a/sig/moderation_api/models/webhook_list_response.rbs +++ /dev/null @@ -1,97 +0,0 @@ -module ModerationAPI - module Models - type webhook_list_response_item = - { - id: String, - created_at: String, - event_types: ::Array[ModerationAPI::Models::WebhookListResponseItem::event_type], - name: String, - payload_version: ModerationAPI::Models::WebhookListResponseItem::payload_version, - url: String, - description: String? - } - - class WebhookListResponseItem < ModerationAPI::Internal::Type::BaseModel - attr_accessor id: String - - attr_accessor created_at: String - - attr_accessor event_types: ::Array[ModerationAPI::Models::WebhookListResponseItem::event_type] - - attr_accessor name: String - - attr_accessor payload_version: ModerationAPI::Models::WebhookListResponseItem::payload_version - - attr_accessor url: String - - attr_accessor description: String? - - def initialize: ( - id: String, - created_at: String, - event_types: ::Array[ModerationAPI::Models::WebhookListResponseItem::event_type], - name: String, - payload_version: ModerationAPI::Models::WebhookListResponseItem::payload_version, - url: String, - ?description: String? - ) -> void - - def to_hash: -> { - id: String, - created_at: String, - event_types: ::Array[ModerationAPI::Models::WebhookListResponseItem::event_type], - name: String, - payload_version: ModerationAPI::Models::WebhookListResponseItem::payload_version, - url: String, - description: String? - } - - type event_type = - :QUEUE_ITEM_NEW - | :QUEUE_ITEM_COMPLETED - | :QUEUE_ITEM_ACTION - | :QUEUE_ITEM_REJECTED - | :QUEUE_ITEM_ALLOWED - | :AUTHOR_BLOCKED - | :AUTHOR_UNBLOCKED - | :AUTHOR_SUSPENDED - | :AUTHOR_UPDATED - | :AUTHOR_TRUST_LEVEL_CHANGED - | :AUTHOR_ACTION - - module EventType - extend ModerationAPI::Internal::Type::Enum - - QUEUE_ITEM_NEW: :QUEUE_ITEM_NEW - QUEUE_ITEM_COMPLETED: :QUEUE_ITEM_COMPLETED - QUEUE_ITEM_ACTION: :QUEUE_ITEM_ACTION - QUEUE_ITEM_REJECTED: :QUEUE_ITEM_REJECTED - QUEUE_ITEM_ALLOWED: :QUEUE_ITEM_ALLOWED - AUTHOR_BLOCKED: :AUTHOR_BLOCKED - AUTHOR_UNBLOCKED: :AUTHOR_UNBLOCKED - AUTHOR_SUSPENDED: :AUTHOR_SUSPENDED - AUTHOR_UPDATED: :AUTHOR_UPDATED - AUTHOR_TRUST_LEVEL_CHANGED: :AUTHOR_TRUST_LEVEL_CHANGED - AUTHOR_ACTION: :AUTHOR_ACTION - - def self?.values: -> ::Array[ModerationAPI::Models::WebhookListResponseItem::event_type] - end - - type payload_version = :V1 | :V2 - - module PayloadVersion - extend ModerationAPI::Internal::Type::Enum - - V1: :V1 - V2: :V2 - - def self?.values: -> ::Array[ModerationAPI::Models::WebhookListResponseItem::payload_version] - end - end - - type webhook_list_response = - ::Array[ModerationAPI::Models::WebhookListResponseItem] - - WebhookListResponse: ModerationAPI::Internal::Type::Converter - end -end diff --git a/sig/moderation_api/models/webhook_retrieve_params.rbs b/sig/moderation_api/models/webhook_retrieve_params.rbs deleted file mode 100644 index 57ea3a89..00000000 --- a/sig/moderation_api/models/webhook_retrieve_params.rbs +++ /dev/null @@ -1,23 +0,0 @@ -module ModerationAPI - module Models - type webhook_retrieve_params = - { id: String } & ModerationAPI::Internal::Type::request_parameters - - class WebhookRetrieveParams < ModerationAPI::Internal::Type::BaseModel - extend ModerationAPI::Internal::Type::RequestParameters::Converter - include ModerationAPI::Internal::Type::RequestParameters - - attr_accessor id: String - - def initialize: ( - id: String, - ?request_options: ModerationAPI::request_opts - ) -> void - - def to_hash: -> { - id: String, - request_options: ModerationAPI::RequestOptions - } - end - end -end diff --git a/sig/moderation_api/models/webhook_retrieve_response.rbs b/sig/moderation_api/models/webhook_retrieve_response.rbs deleted file mode 100644 index 6a090c5a..00000000 --- a/sig/moderation_api/models/webhook_retrieve_response.rbs +++ /dev/null @@ -1,92 +0,0 @@ -module ModerationAPI - module Models - type webhook_retrieve_response = - { - id: String, - created_at: String, - event_types: ::Array[ModerationAPI::Models::WebhookRetrieveResponse::event_type], - name: String, - payload_version: ModerationAPI::Models::WebhookRetrieveResponse::payload_version, - url: String, - description: String? - } - - class WebhookRetrieveResponse < ModerationAPI::Internal::Type::BaseModel - attr_accessor id: String - - attr_accessor created_at: String - - attr_accessor event_types: ::Array[ModerationAPI::Models::WebhookRetrieveResponse::event_type] - - attr_accessor name: String - - attr_accessor payload_version: ModerationAPI::Models::WebhookRetrieveResponse::payload_version - - attr_accessor url: String - - attr_accessor description: String? - - def initialize: ( - id: String, - created_at: String, - event_types: ::Array[ModerationAPI::Models::WebhookRetrieveResponse::event_type], - name: String, - payload_version: ModerationAPI::Models::WebhookRetrieveResponse::payload_version, - url: String, - ?description: String? - ) -> void - - def to_hash: -> { - id: String, - created_at: String, - event_types: ::Array[ModerationAPI::Models::WebhookRetrieveResponse::event_type], - name: String, - payload_version: ModerationAPI::Models::WebhookRetrieveResponse::payload_version, - url: String, - description: String? - } - - type event_type = - :QUEUE_ITEM_NEW - | :QUEUE_ITEM_COMPLETED - | :QUEUE_ITEM_ACTION - | :QUEUE_ITEM_REJECTED - | :QUEUE_ITEM_ALLOWED - | :AUTHOR_BLOCKED - | :AUTHOR_UNBLOCKED - | :AUTHOR_SUSPENDED - | :AUTHOR_UPDATED - | :AUTHOR_TRUST_LEVEL_CHANGED - | :AUTHOR_ACTION - - module EventType - extend ModerationAPI::Internal::Type::Enum - - QUEUE_ITEM_NEW: :QUEUE_ITEM_NEW - QUEUE_ITEM_COMPLETED: :QUEUE_ITEM_COMPLETED - QUEUE_ITEM_ACTION: :QUEUE_ITEM_ACTION - QUEUE_ITEM_REJECTED: :QUEUE_ITEM_REJECTED - QUEUE_ITEM_ALLOWED: :QUEUE_ITEM_ALLOWED - AUTHOR_BLOCKED: :AUTHOR_BLOCKED - AUTHOR_UNBLOCKED: :AUTHOR_UNBLOCKED - AUTHOR_SUSPENDED: :AUTHOR_SUSPENDED - AUTHOR_UPDATED: :AUTHOR_UPDATED - AUTHOR_TRUST_LEVEL_CHANGED: :AUTHOR_TRUST_LEVEL_CHANGED - AUTHOR_ACTION: :AUTHOR_ACTION - - def self?.values: -> ::Array[ModerationAPI::Models::WebhookRetrieveResponse::event_type] - end - - type payload_version = :V1 | :V2 - - module PayloadVersion - extend ModerationAPI::Internal::Type::Enum - - V1: :V1 - V2: :V2 - - def self?.values: -> ::Array[ModerationAPI::Models::WebhookRetrieveResponse::payload_version] - end - end - end -end diff --git a/sig/moderation_api/models/webhook_secret_retrieve_params.rbs b/sig/moderation_api/models/webhook_secret_retrieve_params.rbs deleted file mode 100644 index c77c424c..00000000 --- a/sig/moderation_api/models/webhook_secret_retrieve_params.rbs +++ /dev/null @@ -1,15 +0,0 @@ -module ModerationAPI - module Models - type webhook_secret_retrieve_params = - { } & ModerationAPI::Internal::Type::request_parameters - - class WebhookSecretRetrieveParams < ModerationAPI::Internal::Type::BaseModel - extend ModerationAPI::Internal::Type::RequestParameters::Converter - include ModerationAPI::Internal::Type::RequestParameters - - def initialize: (?request_options: ModerationAPI::request_opts) -> void - - def to_hash: -> { request_options: ModerationAPI::RequestOptions } - end - end -end diff --git a/sig/moderation_api/models/webhook_secret_retrieve_response.rbs b/sig/moderation_api/models/webhook_secret_retrieve_response.rbs deleted file mode 100644 index 1190e765..00000000 --- a/sig/moderation_api/models/webhook_secret_retrieve_response.rbs +++ /dev/null @@ -1,13 +0,0 @@ -module ModerationAPI - module Models - type webhook_secret_retrieve_response = { secret: String } - - class WebhookSecretRetrieveResponse < ModerationAPI::Internal::Type::BaseModel - attr_accessor secret: String - - def initialize: (secret: String) -> void - - def to_hash: -> { secret: String } - end - end -end diff --git a/sig/moderation_api/models/webhook_update_params.rbs b/sig/moderation_api/models/webhook_update_params.rbs deleted file mode 100644 index 4e756b11..00000000 --- a/sig/moderation_api/models/webhook_update_params.rbs +++ /dev/null @@ -1,85 +0,0 @@ -module ModerationAPI - module Models - type webhook_update_params = - { - id: String, - description: String?, - event_types: ::Array[ModerationAPI::Models::WebhookUpdateParams::event_type], - name: String, - url: String - } - & ModerationAPI::Internal::Type::request_parameters - - class WebhookUpdateParams < ModerationAPI::Internal::Type::BaseModel - extend ModerationAPI::Internal::Type::RequestParameters::Converter - include ModerationAPI::Internal::Type::RequestParameters - - attr_accessor id: String - - attr_accessor description: String? - - attr_reader event_types: ::Array[ModerationAPI::Models::WebhookUpdateParams::event_type]? - - def event_types=: ( - ::Array[ModerationAPI::Models::WebhookUpdateParams::event_type] - ) -> ::Array[ModerationAPI::Models::WebhookUpdateParams::event_type] - - attr_reader name: String? - - def name=: (String) -> String - - attr_reader url: String? - - def url=: (String) -> String - - def initialize: ( - id: String, - ?description: String?, - ?event_types: ::Array[ModerationAPI::Models::WebhookUpdateParams::event_type], - ?name: String, - ?url: String, - ?request_options: ModerationAPI::request_opts - ) -> void - - def to_hash: -> { - id: String, - description: String?, - event_types: ::Array[ModerationAPI::Models::WebhookUpdateParams::event_type], - name: String, - url: String, - request_options: ModerationAPI::RequestOptions - } - - type event_type = - :QUEUE_ITEM_NEW - | :QUEUE_ITEM_COMPLETED - | :QUEUE_ITEM_ACTION - | :QUEUE_ITEM_REJECTED - | :QUEUE_ITEM_ALLOWED - | :AUTHOR_BLOCKED - | :AUTHOR_UNBLOCKED - | :AUTHOR_SUSPENDED - | :AUTHOR_UPDATED - | :AUTHOR_TRUST_LEVEL_CHANGED - | :AUTHOR_ACTION - - module EventType - extend ModerationAPI::Internal::Type::Enum - - QUEUE_ITEM_NEW: :QUEUE_ITEM_NEW - QUEUE_ITEM_COMPLETED: :QUEUE_ITEM_COMPLETED - QUEUE_ITEM_ACTION: :QUEUE_ITEM_ACTION - QUEUE_ITEM_REJECTED: :QUEUE_ITEM_REJECTED - QUEUE_ITEM_ALLOWED: :QUEUE_ITEM_ALLOWED - AUTHOR_BLOCKED: :AUTHOR_BLOCKED - AUTHOR_UNBLOCKED: :AUTHOR_UNBLOCKED - AUTHOR_SUSPENDED: :AUTHOR_SUSPENDED - AUTHOR_UPDATED: :AUTHOR_UPDATED - AUTHOR_TRUST_LEVEL_CHANGED: :AUTHOR_TRUST_LEVEL_CHANGED - AUTHOR_ACTION: :AUTHOR_ACTION - - def self?.values: -> ::Array[ModerationAPI::Models::WebhookUpdateParams::event_type] - end - end - end -end diff --git a/sig/moderation_api/models/webhook_update_response.rbs b/sig/moderation_api/models/webhook_update_response.rbs deleted file mode 100644 index 41f2c3ea..00000000 --- a/sig/moderation_api/models/webhook_update_response.rbs +++ /dev/null @@ -1,92 +0,0 @@ -module ModerationAPI - module Models - type webhook_update_response = - { - id: String, - created_at: String, - event_types: ::Array[ModerationAPI::Models::WebhookUpdateResponse::event_type], - name: String, - payload_version: ModerationAPI::Models::WebhookUpdateResponse::payload_version, - url: String, - description: String? - } - - class WebhookUpdateResponse < ModerationAPI::Internal::Type::BaseModel - attr_accessor id: String - - attr_accessor created_at: String - - attr_accessor event_types: ::Array[ModerationAPI::Models::WebhookUpdateResponse::event_type] - - attr_accessor name: String - - attr_accessor payload_version: ModerationAPI::Models::WebhookUpdateResponse::payload_version - - attr_accessor url: String - - attr_accessor description: String? - - def initialize: ( - id: String, - created_at: String, - event_types: ::Array[ModerationAPI::Models::WebhookUpdateResponse::event_type], - name: String, - payload_version: ModerationAPI::Models::WebhookUpdateResponse::payload_version, - url: String, - ?description: String? - ) -> void - - def to_hash: -> { - id: String, - created_at: String, - event_types: ::Array[ModerationAPI::Models::WebhookUpdateResponse::event_type], - name: String, - payload_version: ModerationAPI::Models::WebhookUpdateResponse::payload_version, - url: String, - description: String? - } - - type event_type = - :QUEUE_ITEM_NEW - | :QUEUE_ITEM_COMPLETED - | :QUEUE_ITEM_ACTION - | :QUEUE_ITEM_REJECTED - | :QUEUE_ITEM_ALLOWED - | :AUTHOR_BLOCKED - | :AUTHOR_UNBLOCKED - | :AUTHOR_SUSPENDED - | :AUTHOR_UPDATED - | :AUTHOR_TRUST_LEVEL_CHANGED - | :AUTHOR_ACTION - - module EventType - extend ModerationAPI::Internal::Type::Enum - - QUEUE_ITEM_NEW: :QUEUE_ITEM_NEW - QUEUE_ITEM_COMPLETED: :QUEUE_ITEM_COMPLETED - QUEUE_ITEM_ACTION: :QUEUE_ITEM_ACTION - QUEUE_ITEM_REJECTED: :QUEUE_ITEM_REJECTED - QUEUE_ITEM_ALLOWED: :QUEUE_ITEM_ALLOWED - AUTHOR_BLOCKED: :AUTHOR_BLOCKED - AUTHOR_UNBLOCKED: :AUTHOR_UNBLOCKED - AUTHOR_SUSPENDED: :AUTHOR_SUSPENDED - AUTHOR_UPDATED: :AUTHOR_UPDATED - AUTHOR_TRUST_LEVEL_CHANGED: :AUTHOR_TRUST_LEVEL_CHANGED - AUTHOR_ACTION: :AUTHOR_ACTION - - def self?.values: -> ::Array[ModerationAPI::Models::WebhookUpdateResponse::event_type] - end - - type payload_version = :V1 | :V2 - - module PayloadVersion - extend ModerationAPI::Internal::Type::Enum - - V1: :V1 - V2: :V2 - - def self?.values: -> ::Array[ModerationAPI::Models::WebhookUpdateResponse::payload_version] - end - end - end -end diff --git a/sig/moderation_api/models/wordlist/word_add_params.rbs b/sig/moderation_api/models/wordlist/word_add_params.rbs deleted file mode 100644 index 5301e1eb..00000000 --- a/sig/moderation_api/models/wordlist/word_add_params.rbs +++ /dev/null @@ -1,30 +0,0 @@ -module ModerationAPI - module Models - module Wordlist - type word_add_params = - { id: String, words: ::Array[String] } - & ModerationAPI::Internal::Type::request_parameters - - class WordAddParams < ModerationAPI::Internal::Type::BaseModel - extend ModerationAPI::Internal::Type::RequestParameters::Converter - include ModerationAPI::Internal::Type::RequestParameters - - attr_accessor id: String - - attr_accessor words: ::Array[String] - - def initialize: ( - id: String, - words: ::Array[String], - ?request_options: ModerationAPI::request_opts - ) -> void - - def to_hash: -> { - id: String, - words: ::Array[String], - request_options: ModerationAPI::RequestOptions - } - end - end - end -end diff --git a/sig/moderation_api/models/wordlist/word_add_response.rbs b/sig/moderation_api/models/wordlist/word_add_response.rbs deleted file mode 100644 index c64daa6d..00000000 --- a/sig/moderation_api/models/wordlist/word_add_response.rbs +++ /dev/null @@ -1,28 +0,0 @@ -module ModerationAPI - module Models - module Wordlist - type word_add_response = - { added_count: Float, added_words: ::Array[String], total_count: Float } - - class WordAddResponse < ModerationAPI::Internal::Type::BaseModel - attr_accessor added_count: Float - - attr_accessor added_words: ::Array[String] - - attr_accessor total_count: Float - - def initialize: ( - added_count: Float, - added_words: ::Array[String], - total_count: Float - ) -> void - - def to_hash: -> { - added_count: Float, - added_words: ::Array[String], - total_count: Float - } - end - end - end -end diff --git a/sig/moderation_api/models/wordlist/word_remove_params.rbs b/sig/moderation_api/models/wordlist/word_remove_params.rbs deleted file mode 100644 index 3dbebfce..00000000 --- a/sig/moderation_api/models/wordlist/word_remove_params.rbs +++ /dev/null @@ -1,30 +0,0 @@ -module ModerationAPI - module Models - module Wordlist - type word_remove_params = - { id: String, words: ::Array[String] } - & ModerationAPI::Internal::Type::request_parameters - - class WordRemoveParams < ModerationAPI::Internal::Type::BaseModel - extend ModerationAPI::Internal::Type::RequestParameters::Converter - include ModerationAPI::Internal::Type::RequestParameters - - attr_accessor id: String - - attr_accessor words: ::Array[String] - - def initialize: ( - id: String, - words: ::Array[String], - ?request_options: ModerationAPI::request_opts - ) -> void - - def to_hash: -> { - id: String, - words: ::Array[String], - request_options: ModerationAPI::RequestOptions - } - end - end - end -end diff --git a/sig/moderation_api/models/wordlist/word_remove_response.rbs b/sig/moderation_api/models/wordlist/word_remove_response.rbs deleted file mode 100644 index e70c255c..00000000 --- a/sig/moderation_api/models/wordlist/word_remove_response.rbs +++ /dev/null @@ -1,32 +0,0 @@ -module ModerationAPI - module Models - module Wordlist - type word_remove_response = - { - removed_count: Float, - removed_words: ::Array[String], - total_count: Float - } - - class WordRemoveResponse < ModerationAPI::Internal::Type::BaseModel - attr_accessor removed_count: Float - - attr_accessor removed_words: ::Array[String] - - attr_accessor total_count: Float - - def initialize: ( - removed_count: Float, - removed_words: ::Array[String], - total_count: Float - ) -> void - - def to_hash: -> { - removed_count: Float, - removed_words: ::Array[String], - total_count: Float - } - end - end - end -end diff --git a/sig/moderation_api/models/wordlist_get_embedding_status_params.rbs b/sig/moderation_api/models/wordlist_get_embedding_status_params.rbs deleted file mode 100644 index 747a90f6..00000000 --- a/sig/moderation_api/models/wordlist_get_embedding_status_params.rbs +++ /dev/null @@ -1,23 +0,0 @@ -module ModerationAPI - module Models - type wordlist_get_embedding_status_params = - { id: String } & ModerationAPI::Internal::Type::request_parameters - - class WordlistGetEmbeddingStatusParams < ModerationAPI::Internal::Type::BaseModel - extend ModerationAPI::Internal::Type::RequestParameters::Converter - include ModerationAPI::Internal::Type::RequestParameters - - attr_accessor id: String - - def initialize: ( - id: String, - ?request_options: ModerationAPI::request_opts - ) -> void - - def to_hash: -> { - id: String, - request_options: ModerationAPI::RequestOptions - } - end - end -end diff --git a/sig/moderation_api/models/wordlist_get_embedding_status_response.rbs b/sig/moderation_api/models/wordlist_get_embedding_status_response.rbs deleted file mode 100644 index aa970d7d..00000000 --- a/sig/moderation_api/models/wordlist_get_embedding_status_response.rbs +++ /dev/null @@ -1,26 +0,0 @@ -module ModerationAPI - module Models - type wordlist_get_embedding_status_response = - { progress: Float, remaining_words: Float, total_words: Float } - - class WordlistGetEmbeddingStatusResponse < ModerationAPI::Internal::Type::BaseModel - attr_accessor progress: Float - - attr_accessor remaining_words: Float - - attr_accessor total_words: Float - - def initialize: ( - progress: Float, - remaining_words: Float, - total_words: Float - ) -> void - - def to_hash: -> { - progress: Float, - remaining_words: Float, - total_words: Float - } - end - end -end diff --git a/sig/moderation_api/models/wordlist_list_params.rbs b/sig/moderation_api/models/wordlist_list_params.rbs deleted file mode 100644 index 73903da3..00000000 --- a/sig/moderation_api/models/wordlist_list_params.rbs +++ /dev/null @@ -1,15 +0,0 @@ -module ModerationAPI - module Models - type wordlist_list_params = - { } & ModerationAPI::Internal::Type::request_parameters - - class WordlistListParams < ModerationAPI::Internal::Type::BaseModel - extend ModerationAPI::Internal::Type::RequestParameters::Converter - include ModerationAPI::Internal::Type::RequestParameters - - def initialize: (?request_options: ModerationAPI::request_opts) -> void - - def to_hash: -> { request_options: ModerationAPI::RequestOptions } - end - end -end diff --git a/sig/moderation_api/models/wordlist_list_response.rbs b/sig/moderation_api/models/wordlist_list_response.rbs deleted file mode 100644 index bdd63c46..00000000 --- a/sig/moderation_api/models/wordlist_list_response.rbs +++ /dev/null @@ -1,45 +0,0 @@ -module ModerationAPI - module Models - type wordlist_list_response_item = - { - id: String, - created_at: String?, - description: String?, - name: String?, - user_id: String? - } - - class WordlistListResponseItem < ModerationAPI::Internal::Type::BaseModel - attr_accessor id: String - - attr_accessor created_at: String? - - attr_accessor description: String? - - attr_accessor name: String? - - attr_accessor user_id: String? - - def initialize: ( - id: String, - created_at: String?, - description: String?, - name: String?, - user_id: String? - ) -> void - - def to_hash: -> { - id: String, - created_at: String?, - description: String?, - name: String?, - user_id: String? - } - end - - type wordlist_list_response = - ::Array[ModerationAPI::Models::WordlistListResponseItem] - - WordlistListResponse: ModerationAPI::Internal::Type::Converter - end -end diff --git a/sig/moderation_api/models/wordlist_retrieve_params.rbs b/sig/moderation_api/models/wordlist_retrieve_params.rbs deleted file mode 100644 index 4cb3c23e..00000000 --- a/sig/moderation_api/models/wordlist_retrieve_params.rbs +++ /dev/null @@ -1,23 +0,0 @@ -module ModerationAPI - module Models - type wordlist_retrieve_params = - { id: String } & ModerationAPI::Internal::Type::request_parameters - - class WordlistRetrieveParams < ModerationAPI::Internal::Type::BaseModel - extend ModerationAPI::Internal::Type::RequestParameters::Converter - include ModerationAPI::Internal::Type::RequestParameters - - attr_accessor id: String - - def initialize: ( - id: String, - ?request_options: ModerationAPI::request_opts - ) -> void - - def to_hash: -> { - id: String, - request_options: ModerationAPI::RequestOptions - } - end - end -end diff --git a/sig/moderation_api/models/wordlist_retrieve_response.rbs b/sig/moderation_api/models/wordlist_retrieve_response.rbs deleted file mode 100644 index 4436e5c2..00000000 --- a/sig/moderation_api/models/wordlist_retrieve_response.rbs +++ /dev/null @@ -1,50 +0,0 @@ -module ModerationAPI - module Models - type wordlist_retrieve_response = - { - id: String, - created_at: String, - name: String?, - organization_id: String, - strict: bool, - user_id: String?, - words: ::Array[String] - } - - class WordlistRetrieveResponse < ModerationAPI::Internal::Type::BaseModel - attr_accessor id: String - - attr_accessor created_at: String - - attr_accessor name: String? - - attr_accessor organization_id: String - - attr_accessor strict: bool - - attr_accessor user_id: String? - - attr_accessor words: ::Array[String] - - def initialize: ( - id: String, - created_at: String, - name: String?, - organization_id: String, - strict: bool, - user_id: String?, - words: ::Array[String] - ) -> void - - def to_hash: -> { - id: String, - created_at: String, - name: String?, - organization_id: String, - strict: bool, - user_id: String?, - words: ::Array[String] - } - end - end -end diff --git a/sig/moderation_api/models/wordlist_update_params.rbs b/sig/moderation_api/models/wordlist_update_params.rbs deleted file mode 100644 index 6e6a2f0c..00000000 --- a/sig/moderation_api/models/wordlist_update_params.rbs +++ /dev/null @@ -1,61 +0,0 @@ -module ModerationAPI - module Models - type wordlist_update_params = - { - id: String, - description: String, - key: String, - name: String, - strict: bool, - words: ::Array[String] - } - & ModerationAPI::Internal::Type::request_parameters - - class WordlistUpdateParams < ModerationAPI::Internal::Type::BaseModel - extend ModerationAPI::Internal::Type::RequestParameters::Converter - include ModerationAPI::Internal::Type::RequestParameters - - attr_accessor id: String - - attr_reader description: String? - - def description=: (String) -> String - - attr_reader key: String? - - def key=: (String) -> String - - attr_reader name: String? - - def name=: (String) -> String - - attr_reader strict: bool? - - def strict=: (bool) -> bool - - attr_reader words: ::Array[String]? - - def words=: (::Array[String]) -> ::Array[String] - - def initialize: ( - id: String, - ?description: String, - ?key: String, - ?name: String, - ?strict: bool, - ?words: ::Array[String], - ?request_options: ModerationAPI::request_opts - ) -> void - - def to_hash: -> { - id: String, - description: String, - key: String, - name: String, - strict: bool, - words: ::Array[String], - request_options: ModerationAPI::RequestOptions - } - end - end -end diff --git a/sig/moderation_api/models/wordlist_update_response.rbs b/sig/moderation_api/models/wordlist_update_response.rbs deleted file mode 100644 index cbaea965..00000000 --- a/sig/moderation_api/models/wordlist_update_response.rbs +++ /dev/null @@ -1,50 +0,0 @@ -module ModerationAPI - module Models - type wordlist_update_response = - { - id: String, - created_at: String, - name: String?, - organization_id: String, - strict: bool, - user_id: String?, - words: ::Array[String] - } - - class WordlistUpdateResponse < ModerationAPI::Internal::Type::BaseModel - attr_accessor id: String - - attr_accessor created_at: String - - attr_accessor name: String? - - attr_accessor organization_id: String - - attr_accessor strict: bool - - attr_accessor user_id: String? - - attr_accessor words: ::Array[String] - - def initialize: ( - id: String, - created_at: String, - name: String?, - organization_id: String, - strict: bool, - user_id: String?, - words: ::Array[String] - ) -> void - - def to_hash: -> { - id: String, - created_at: String, - name: String?, - organization_id: String, - strict: bool, - user_id: String?, - words: ::Array[String] - } - end - end -end diff --git a/sig/moderation_api/request_options.rbs b/sig/moderation_api/request_options.rbs deleted file mode 100644 index f8f2e5d5..00000000 --- a/sig/moderation_api/request_options.rbs +++ /dev/null @@ -1,36 +0,0 @@ -module ModerationAPI - type request_opts = - ModerationAPI::RequestOptions - | ModerationAPI::request_options - | ::Hash[Symbol, top] - - type request_options = - { - idempotency_key: String?, - extra_query: ::Hash[String, (::Array[String] | String)?]?, - extra_headers: ::Hash[String, String?]?, - extra_body: top?, - max_retries: Integer?, - timeout: Float? - } - - class RequestOptions < ModerationAPI::Internal::Type::BaseModel - def self.validate!: (ModerationAPI::request_opts opts) -> void - - attr_accessor idempotency_key: String? - - attr_accessor extra_query: ::Hash[String, (::Array[String] | String)?]? - - attr_accessor extra_headers: ::Hash[String, String?]? - - attr_accessor extra_body: top? - - attr_accessor max_retries: Integer? - - attr_accessor timeout: Float? - - def initialize: ( - ?ModerationAPI::request_options | ::Hash[Symbol, top] values - ) -> void - end -end diff --git a/sig/moderation_api/resources/account.rbs b/sig/moderation_api/resources/account.rbs deleted file mode 100644 index 652f41e5..00000000 --- a/sig/moderation_api/resources/account.rbs +++ /dev/null @@ -1,11 +0,0 @@ -module ModerationAPI - module Resources - class Account - def list: ( - ?request_options: ModerationAPI::request_opts - ) -> ModerationAPI::Models::AccountListResponse - - def initialize: (client: ModerationAPI::Client) -> void - end - end -end diff --git a/sig/moderation_api/resources/actions.rbs b/sig/moderation_api/resources/actions.rbs deleted file mode 100644 index e4cf8f2b..00000000 --- a/sig/moderation_api/resources/actions.rbs +++ /dev/null @@ -1,55 +0,0 @@ -module ModerationAPI - module Resources - class Actions - attr_reader execute: ModerationAPI::Resources::Actions::Execute - - def create: ( - name: String, - ?built_in: bool?, - ?description: String?, - ?filter_in_queue_ids: ::Array[String], - ?free_text: bool, - ?key: String?, - ?position: ModerationAPI::Models::ActionCreateParams::position, - ?possible_values: ::Array[ModerationAPI::ActionCreateParams::PossibleValue], - ?queue_behaviour: ModerationAPI::Models::ActionCreateParams::queue_behaviour, - ?type: ModerationAPI::Models::ActionCreateParams::type_?, - ?value_required: bool, - ?request_options: ModerationAPI::request_opts - ) -> ModerationAPI::Models::ActionCreateResponse - - def retrieve: ( - String id, - ?request_options: ModerationAPI::request_opts - ) -> ModerationAPI::Models::ActionRetrieveResponse - - def update: ( - String id, - ?built_in: bool?, - ?description: String?, - ?filter_in_queue_ids: ::Array[String], - ?free_text: bool, - ?key: String?, - ?name: String, - ?position: ModerationAPI::Models::ActionUpdateParams::position, - ?possible_values: ::Array[ModerationAPI::ActionUpdateParams::PossibleValue], - ?queue_behaviour: ModerationAPI::Models::ActionUpdateParams::queue_behaviour, - ?type: ModerationAPI::Models::ActionUpdateParams::type_?, - ?value_required: bool, - ?request_options: ModerationAPI::request_opts - ) -> ModerationAPI::Models::ActionUpdateResponse - - def list: ( - ?queue_id: String, - ?request_options: ModerationAPI::request_opts - ) -> ModerationAPI::Models::action_list_response - - def delete: ( - String id, - ?request_options: ModerationAPI::request_opts - ) -> ModerationAPI::Models::ActionDeleteResponse - - def initialize: (client: ModerationAPI::Client) -> void - end - end -end diff --git a/sig/moderation_api/resources/actions/execute.rbs b/sig/moderation_api/resources/actions/execute.rbs deleted file mode 100644 index 71b41787..00000000 --- a/sig/moderation_api/resources/actions/execute.rbs +++ /dev/null @@ -1,28 +0,0 @@ -module ModerationAPI - module Resources - class Actions - class Execute - def execute: ( - action_key: String, - ?author_ids: ::Array[String], - ?content_ids: ::Array[String], - ?duration: Float, - ?queue_id: String, - ?value: String, - ?request_options: ModerationAPI::request_opts - ) -> ModerationAPI::Models::Actions::ExecuteExecuteResponse - - def execute_by_id: ( - String action_id, - ?author_ids: ::Array[String], - ?content_ids: ::Array[String], - ?queue_id: String, - ?value: String, - ?request_options: ModerationAPI::request_opts - ) -> ModerationAPI::Models::Actions::ExecuteExecuteByIDResponse - - def initialize: (client: ModerationAPI::Client) -> void - end - end - end -end diff --git a/sig/moderation_api/resources/auth.rbs b/sig/moderation_api/resources/auth.rbs deleted file mode 100644 index 2fce1b68..00000000 --- a/sig/moderation_api/resources/auth.rbs +++ /dev/null @@ -1,15 +0,0 @@ -module ModerationAPI - module Resources - class Auth - def create: ( - ?request_options: ModerationAPI::request_opts - ) -> ModerationAPI::Models::AuthCreateResponse - - def retrieve: ( - ?request_options: ModerationAPI::request_opts - ) -> ModerationAPI::Models::AuthRetrieveResponse - - def initialize: (client: ModerationAPI::Client) -> void - end - end -end diff --git a/sig/moderation_api/resources/authors.rbs b/sig/moderation_api/resources/authors.rbs deleted file mode 100644 index cc0a0af8..00000000 --- a/sig/moderation_api/resources/authors.rbs +++ /dev/null @@ -1,56 +0,0 @@ -module ModerationAPI - module Resources - class Authors - def create: ( - external_id: String, - ?company: String?, - ?email: String?, - ?external_link: String?, - ?first_seen: Float, - ?last_seen: Float, - ?manual_trust_level: Float?, - ?metadata: ModerationAPI::AuthorCreateParams::Metadata, - ?name: String?, - ?profile_picture: String?, - ?request_options: ModerationAPI::request_opts - ) -> ModerationAPI::Models::AuthorCreateResponse - - def retrieve: ( - String id, - ?request_options: ModerationAPI::request_opts - ) -> ModerationAPI::Models::AuthorRetrieveResponse - - def update: ( - String id, - ?company: String?, - ?email: String?, - ?external_link: String?, - ?first_seen: Float, - ?last_seen: Float, - ?manual_trust_level: Float?, - ?metadata: ModerationAPI::AuthorUpdateParams::Metadata, - ?name: String?, - ?profile_picture: String?, - ?request_options: ModerationAPI::request_opts - ) -> ModerationAPI::Models::AuthorUpdateResponse - - def list: ( - ?content_types: String, - ?last_active_date: String, - ?member_since_date: String, - ?page_number: Float, - ?page_size: Float, - ?sort_by: ModerationAPI::Models::AuthorListParams::sort_by, - ?sort_direction: ModerationAPI::Models::AuthorListParams::sort_direction, - ?request_options: ModerationAPI::request_opts - ) -> ModerationAPI::Models::AuthorListResponse - - def delete: ( - String id, - ?request_options: ModerationAPI::request_opts - ) -> ModerationAPI::Models::AuthorDeleteResponse - - def initialize: (client: ModerationAPI::Client) -> void - end - end -end diff --git a/sig/moderation_api/resources/content.rbs b/sig/moderation_api/resources/content.rbs deleted file mode 100644 index aa23c2b1..00000000 --- a/sig/moderation_api/resources/content.rbs +++ /dev/null @@ -1,27 +0,0 @@ -module ModerationAPI - module Resources - class Content - def stream: ( - sec_web_socket_protocol: ModerationAPI::Models::ContentStreamParams::sec_web_socket_protocol, - ?request_options: ModerationAPI::request_opts - ) -> nil - - def submit: ( - content: ModerationAPI::Models::ContentSubmitParams::content, - ?author_id: String, - ?channel: String, - ?client_action: ModerationAPI::ContentSubmitParams::ClientAction, - ?content_id: String, - ?conversation_id: String, - ?do_not_store: bool, - ?metadata: ::Hash[Symbol, top], - ?meta_type: ModerationAPI::Models::ContentSubmitParams::meta_type, - ?policies: ::Array[ModerationAPI::Models::ContentSubmitParams::policy], - ?timestamp: Float, - ?request_options: ModerationAPI::request_opts - ) -> ModerationAPI::Models::ContentSubmitResponse - - def initialize: (client: ModerationAPI::Client) -> void - end - end -end diff --git a/sig/moderation_api/resources/queue.rbs b/sig/moderation_api/resources/queue.rbs deleted file mode 100644 index 70315e95..00000000 --- a/sig/moderation_api/resources/queue.rbs +++ /dev/null @@ -1,20 +0,0 @@ -module ModerationAPI - module Resources - class Queue - attr_reader items: ModerationAPI::Resources::Queue::Items - - def retrieve: ( - String id, - ?request_options: ModerationAPI::request_opts - ) -> ModerationAPI::Models::QueueRetrieveResponse - - def get_stats: ( - String id, - ?within_days: String, - ?request_options: ModerationAPI::request_opts - ) -> ModerationAPI::Models::QueueGetStatsResponse - - def initialize: (client: ModerationAPI::Client) -> void - end - end -end diff --git a/sig/moderation_api/resources/queue/items.rbs b/sig/moderation_api/resources/queue/items.rbs deleted file mode 100644 index acb9f224..00000000 --- a/sig/moderation_api/resources/queue/items.rbs +++ /dev/null @@ -1,39 +0,0 @@ -module ModerationAPI - module Resources - class Queue - class Items - def list: ( - String id, - ?after_date: String, - ?author_id: String, - ?before_date: String, - ?conversation_ids: String, - ?filtered_action_ids: String, - ?include_resolved: String, - ?labels: String, - ?page_number: Float, - ?page_size: Float, - ?sort_direction: ModerationAPI::Models::Queue::ItemListParams::sort_direction, - ?sort_field: ModerationAPI::Models::Queue::ItemListParams::sort_field, - ?request_options: ModerationAPI::request_opts - ) -> ModerationAPI::Models::Queue::ItemListResponse - - def resolve: ( - String item_id, - id: String, - ?comment: String, - ?request_options: ModerationAPI::request_opts - ) -> ModerationAPI::Models::Queue::ItemResolveResponse - - def unresolve: ( - String item_id, - id: String, - ?comment: String, - ?request_options: ModerationAPI::request_opts - ) -> ModerationAPI::Models::Queue::ItemUnresolveResponse - - def initialize: (client: ModerationAPI::Client) -> void - end - end - end -end diff --git a/sig/moderation_api/resources/webhook_secret.rbs b/sig/moderation_api/resources/webhook_secret.rbs deleted file mode 100644 index dd8c6be5..00000000 --- a/sig/moderation_api/resources/webhook_secret.rbs +++ /dev/null @@ -1,11 +0,0 @@ -module ModerationAPI - module Resources - class WebhookSecret - def retrieve: ( - ?request_options: ModerationAPI::request_opts - ) -> ModerationAPI::Models::WebhookSecretRetrieveResponse - - def initialize: (client: ModerationAPI::Client) -> void - end - end -end diff --git a/sig/moderation_api/resources/webhooks.rbs b/sig/moderation_api/resources/webhooks.rbs deleted file mode 100644 index 3dca77cd..00000000 --- a/sig/moderation_api/resources/webhooks.rbs +++ /dev/null @@ -1,38 +0,0 @@ -module ModerationAPI - module Resources - class Webhooks - def create: ( - event_types: ::Array[ModerationAPI::Models::WebhookCreateParams::event_type], - name: String, - url: String, - ?description: String?, - ?request_options: ModerationAPI::request_opts - ) -> ModerationAPI::Models::WebhookCreateResponse - - def retrieve: ( - String id, - ?request_options: ModerationAPI::request_opts - ) -> ModerationAPI::Models::WebhookRetrieveResponse - - def update: ( - String id, - ?description: String?, - ?event_types: ::Array[ModerationAPI::Models::WebhookUpdateParams::event_type], - ?name: String, - ?url: String, - ?request_options: ModerationAPI::request_opts - ) -> ModerationAPI::Models::WebhookUpdateResponse - - def list: ( - ?request_options: ModerationAPI::request_opts - ) -> ModerationAPI::Models::webhook_list_response - - def delete: ( - String id, - ?request_options: ModerationAPI::request_opts - ) -> ModerationAPI::Models::WebhookDeleteResponse - - def initialize: (client: ModerationAPI::Client) -> void - end - end -end diff --git a/sig/moderation_api/resources/wordlist.rbs b/sig/moderation_api/resources/wordlist.rbs deleted file mode 100644 index aa3de982..00000000 --- a/sig/moderation_api/resources/wordlist.rbs +++ /dev/null @@ -1,33 +0,0 @@ -module ModerationAPI - module Resources - class Wordlist - attr_reader words: ModerationAPI::Resources::Wordlist::Words - - def retrieve: ( - String id, - ?request_options: ModerationAPI::request_opts - ) -> ModerationAPI::Models::WordlistRetrieveResponse - - def update: ( - String id, - ?description: String, - ?key: String, - ?name: String, - ?strict: bool, - ?words: ::Array[String], - ?request_options: ModerationAPI::request_opts - ) -> ModerationAPI::Models::WordlistUpdateResponse - - def list: ( - ?request_options: ModerationAPI::request_opts - ) -> ModerationAPI::Models::wordlist_list_response - - def get_embedding_status: ( - String id, - ?request_options: ModerationAPI::request_opts - ) -> ModerationAPI::Models::WordlistGetEmbeddingStatusResponse - - def initialize: (client: ModerationAPI::Client) -> void - end - end -end diff --git a/sig/moderation_api/resources/wordlist/words.rbs b/sig/moderation_api/resources/wordlist/words.rbs deleted file mode 100644 index c2b9d886..00000000 --- a/sig/moderation_api/resources/wordlist/words.rbs +++ /dev/null @@ -1,21 +0,0 @@ -module ModerationAPI - module Resources - class Wordlist - class Words - def add: ( - String id, - words: ::Array[String], - ?request_options: ModerationAPI::request_opts - ) -> ModerationAPI::Models::Wordlist::WordAddResponse - - def remove: ( - String id, - words: ::Array[String], - ?request_options: ModerationAPI::request_opts - ) -> ModerationAPI::Models::Wordlist::WordRemoveResponse - - def initialize: (client: ModerationAPI::Client) -> void - end - end - end -end diff --git a/sig/moderation_api/version.rbs b/sig/moderation_api/version.rbs deleted file mode 100644 index 0adae33a..00000000 --- a/sig/moderation_api/version.rbs +++ /dev/null @@ -1,3 +0,0 @@ -module ModerationAPI - VERSION: String -end diff --git a/sorbet/config b/sorbet/config index 6fe84ed8..cd566e2b 100644 --- a/sorbet/config +++ b/sorbet/config @@ -1,2 +1,10 @@ ---dir=rbi/ ---ignore=test/ +--dir +. +--ignore=tmp/ +--ignore=vendor/ +# prism 1.7.0 aliasing error: https://github.com/ruby/prism/issues/3833 +--suppress-error-code=4022 +# Ruby 4.0 / rdoc 7.0.3 error suppression +--suppress-payload-superclass-redefinition-for=RDoc::Markup::BlankLine +--suppress-payload-superclass-redefinition-for=RDoc::Markup::HardBreak +--suppress-payload-superclass-redefinition-for=RDoc::Markup::Heading diff --git a/sorbet/rbi/.gitignore b/sorbet/rbi/.gitignore deleted file mode 100644 index d6b7ef32..00000000 --- a/sorbet/rbi/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -* -!.gitignore diff --git a/sorbet/tapioca/config.yml b/sorbet/tapioca/config.yml new file mode 100644 index 00000000..95ee0ac9 --- /dev/null +++ b/sorbet/tapioca/config.yml @@ -0,0 +1,50 @@ +gem: + # Add your `gem` command parameters here: + # + # exclude: + # - gem_name + # doc: true + # workers: 5 + exclude: + # Runtime-unrelated tooling (exclude as a set) + - tapioca + - spoom + - yard + - yard-sorbet + - rbi + - rbs + - require-hooks + - thor + - rake + - uri + + # Test/toolchain + - minitest + - minitest-focus + - minitest-reporters + - ansi + - builder + - prism + + # Rubocop toolchain + - rubocop + - rubocop-ast + - rubocop-minitest + - lint_roller + - language_server-protocol + - parser + - ast + - regexp_parser + - rainbow + - ruby-progressbar + - unicode-display_width + - unicode-emoji +annotations: + typed_overrides: + activesupport: "ignore" +dsl: + # Add your `dsl` command parameters here: + # + # exclude: + # - SomeGeneratorName + # workers: 5 diff --git a/sorbet/tapioca/require.rb b/sorbet/tapioca/require.rb new file mode 100644 index 00000000..fd79b01b --- /dev/null +++ b/sorbet/tapioca/require.rb @@ -0,0 +1,11 @@ +# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + +# typed: true +# frozen_string_literal: true + +# Add your extra requires here (`bin/tapioca require` can be used to bootstrap this list) + +require 'faraday' +require 'faraday/multipart' +require 'faraday/retry' +require 'multipart/post' diff --git a/test/moderation_api/client_test.rb b/test/moderation_api/client_test.rb deleted file mode 100644 index 536ef901..00000000 --- a/test/moderation_api/client_test.rb +++ /dev/null @@ -1,319 +0,0 @@ -# frozen_string_literal: true - -require_relative "test_helper" - -class ModerationAPITest < Minitest::Test - extend Minitest::Serial - include WebMock::API - - def before_all - super - WebMock.enable! - end - - def setup - super - Thread.current.thread_variable_set(:mock_sleep, []) - end - - def teardown - Thread.current.thread_variable_set(:mock_sleep, nil) - WebMock.reset! - super - end - - def after_all - WebMock.disable! - super - end - - def test_raises_on_missing_non_nullable_opts - e = assert_raises(ArgumentError) do - ModerationAPI::Client.new - end - assert_match(/is required/, e.message) - end - - def test_client_default_request_default_retry_attempts - stub_request(:post, "http://localhost/moderate").to_return_json(status: 500, body: {}) - - moderation_api = ModerationAPI::Client.new(base_url: "http://localhost", secret_key: "My Secret Key") - - assert_raises(ModerationAPI::Errors::InternalServerError) do - moderation_api.content.submit(content: {text: "text", type: :text}) - end - - assert_requested(:any, /./, times: 3) - end - - def test_client_given_request_default_retry_attempts - stub_request(:post, "http://localhost/moderate").to_return_json(status: 500, body: {}) - - moderation_api = - ModerationAPI::Client.new(base_url: "http://localhost", secret_key: "My Secret Key", max_retries: 3) - - assert_raises(ModerationAPI::Errors::InternalServerError) do - moderation_api.content.submit(content: {text: "text", type: :text}) - end - - assert_requested(:any, /./, times: 4) - end - - def test_client_default_request_given_retry_attempts - stub_request(:post, "http://localhost/moderate").to_return_json(status: 500, body: {}) - - moderation_api = ModerationAPI::Client.new(base_url: "http://localhost", secret_key: "My Secret Key") - - assert_raises(ModerationAPI::Errors::InternalServerError) do - moderation_api.content.submit(content: {text: "text", type: :text}, request_options: {max_retries: 3}) - end - - assert_requested(:any, /./, times: 4) - end - - def test_client_given_request_given_retry_attempts - stub_request(:post, "http://localhost/moderate").to_return_json(status: 500, body: {}) - - moderation_api = - ModerationAPI::Client.new(base_url: "http://localhost", secret_key: "My Secret Key", max_retries: 3) - - assert_raises(ModerationAPI::Errors::InternalServerError) do - moderation_api.content.submit(content: {text: "text", type: :text}, request_options: {max_retries: 4}) - end - - assert_requested(:any, /./, times: 5) - end - - def test_client_retry_after_seconds - stub_request(:post, "http://localhost/moderate").to_return_json( - status: 500, - headers: {"retry-after" => "1.3"}, - body: {} - ) - - moderation_api = - ModerationAPI::Client.new(base_url: "http://localhost", secret_key: "My Secret Key", max_retries: 1) - - assert_raises(ModerationAPI::Errors::InternalServerError) do - moderation_api.content.submit(content: {text: "text", type: :text}) - end - - assert_requested(:any, /./, times: 2) - assert_equal(1.3, Thread.current.thread_variable_get(:mock_sleep).last) - end - - def test_client_retry_after_date - time_now = Time.now - - stub_request(:post, "http://localhost/moderate").to_return_json( - status: 500, - headers: {"retry-after" => (time_now + 10).httpdate}, - body: {} - ) - - moderation_api = - ModerationAPI::Client.new(base_url: "http://localhost", secret_key: "My Secret Key", max_retries: 1) - - Thread.current.thread_variable_set(:time_now, time_now) - assert_raises(ModerationAPI::Errors::InternalServerError) do - moderation_api.content.submit(content: {text: "text", type: :text}) - end - Thread.current.thread_variable_set(:time_now, nil) - - assert_requested(:any, /./, times: 2) - assert_in_delta(10, Thread.current.thread_variable_get(:mock_sleep).last, 1.0) - end - - def test_client_retry_after_ms - stub_request(:post, "http://localhost/moderate").to_return_json( - status: 500, - headers: {"retry-after-ms" => "1300"}, - body: {} - ) - - moderation_api = - ModerationAPI::Client.new(base_url: "http://localhost", secret_key: "My Secret Key", max_retries: 1) - - assert_raises(ModerationAPI::Errors::InternalServerError) do - moderation_api.content.submit(content: {text: "text", type: :text}) - end - - assert_requested(:any, /./, times: 2) - assert_equal(1.3, Thread.current.thread_variable_get(:mock_sleep).last) - end - - def test_retry_count_header - stub_request(:post, "http://localhost/moderate").to_return_json(status: 500, body: {}) - - moderation_api = ModerationAPI::Client.new(base_url: "http://localhost", secret_key: "My Secret Key") - - assert_raises(ModerationAPI::Errors::InternalServerError) do - moderation_api.content.submit(content: {text: "text", type: :text}) - end - - 3.times do - assert_requested(:any, /./, headers: {"x-stainless-retry-count" => _1}) - end - end - - def test_omit_retry_count_header - stub_request(:post, "http://localhost/moderate").to_return_json(status: 500, body: {}) - - moderation_api = ModerationAPI::Client.new(base_url: "http://localhost", secret_key: "My Secret Key") - - assert_raises(ModerationAPI::Errors::InternalServerError) do - moderation_api.content.submit( - content: {text: "text", type: :text}, - request_options: {extra_headers: {"x-stainless-retry-count" => nil}} - ) - end - - assert_requested(:any, /./, times: 3) do - refute_includes(_1.headers.keys.map(&:downcase), "x-stainless-retry-count") - end - end - - def test_overwrite_retry_count_header - stub_request(:post, "http://localhost/moderate").to_return_json(status: 500, body: {}) - - moderation_api = ModerationAPI::Client.new(base_url: "http://localhost", secret_key: "My Secret Key") - - assert_raises(ModerationAPI::Errors::InternalServerError) do - moderation_api.content.submit( - content: {text: "text", type: :text}, - request_options: {extra_headers: {"x-stainless-retry-count" => "42"}} - ) - end - - assert_requested(:any, /./, headers: {"x-stainless-retry-count" => "42"}, times: 3) - end - - def test_client_redirect_307 - stub_request(:post, "http://localhost/moderate").to_return_json( - status: 307, - headers: {"location" => "/redirected"}, - body: {} - ) - stub_request(:any, "http://localhost/redirected").to_return( - status: 307, - headers: {"location" => "/redirected"} - ) - - moderation_api = ModerationAPI::Client.new(base_url: "http://localhost", secret_key: "My Secret Key") - - assert_raises(ModerationAPI::Errors::APIConnectionError) do - moderation_api.content.submit( - content: {text: "text", type: :text}, - request_options: {extra_headers: {}} - ) - end - - recorded, = WebMock::RequestRegistry.instance.requested_signatures.hash.first - - assert_requested(:any, "http://localhost/redirected", times: ModerationAPI::Client::MAX_REDIRECTS) do - assert_equal(recorded.method, _1.method) - assert_equal(recorded.body, _1.body) - assert_equal( - recorded.headers.transform_keys(&:downcase)["content-type"], - _1.headers.transform_keys(&:downcase)["content-type"] - ) - end - end - - def test_client_redirect_303 - stub_request(:post, "http://localhost/moderate").to_return_json( - status: 303, - headers: {"location" => "/redirected"}, - body: {} - ) - stub_request(:get, "http://localhost/redirected").to_return( - status: 303, - headers: {"location" => "/redirected"} - ) - - moderation_api = ModerationAPI::Client.new(base_url: "http://localhost", secret_key: "My Secret Key") - - assert_raises(ModerationAPI::Errors::APIConnectionError) do - moderation_api.content.submit( - content: {text: "text", type: :text}, - request_options: {extra_headers: {}} - ) - end - - assert_requested(:get, "http://localhost/redirected", times: ModerationAPI::Client::MAX_REDIRECTS) do - headers = _1.headers.keys.map(&:downcase) - refute_includes(headers, "content-type") - assert_nil(_1.body) - end - end - - def test_client_redirect_auth_keep_same_origin - stub_request(:post, "http://localhost/moderate").to_return_json( - status: 307, - headers: {"location" => "/redirected"}, - body: {} - ) - stub_request(:any, "http://localhost/redirected").to_return( - status: 307, - headers: {"location" => "/redirected"} - ) - - moderation_api = ModerationAPI::Client.new(base_url: "http://localhost", secret_key: "My Secret Key") - - assert_raises(ModerationAPI::Errors::APIConnectionError) do - moderation_api.content.submit( - content: {text: "text", type: :text}, - request_options: {extra_headers: {"authorization" => "Bearer xyz"}} - ) - end - - recorded, = WebMock::RequestRegistry.instance.requested_signatures.hash.first - auth_header = recorded.headers.transform_keys(&:downcase).fetch("authorization") - - assert_equal("Bearer xyz", auth_header) - assert_requested(:any, "http://localhost/redirected", times: ModerationAPI::Client::MAX_REDIRECTS) do - auth_header = _1.headers.transform_keys(&:downcase).fetch("authorization") - assert_equal("Bearer xyz", auth_header) - end - end - - def test_client_redirect_auth_strip_cross_origin - stub_request(:post, "http://localhost/moderate").to_return_json( - status: 307, - headers: {"location" => "https://example.com/redirected"}, - body: {} - ) - stub_request(:any, "https://example.com/redirected").to_return( - status: 307, - headers: {"location" => "https://example.com/redirected"} - ) - - moderation_api = ModerationAPI::Client.new(base_url: "http://localhost", secret_key: "My Secret Key") - - assert_raises(ModerationAPI::Errors::APIConnectionError) do - moderation_api.content.submit( - content: {text: "text", type: :text}, - request_options: {extra_headers: {"authorization" => "Bearer xyz"}} - ) - end - - assert_requested(:any, "https://example.com/redirected", times: ModerationAPI::Client::MAX_REDIRECTS) do - headers = _1.headers.keys.map(&:downcase) - refute_includes(headers, "authorization") - end - end - - def test_default_headers - stub_request(:post, "http://localhost/moderate").to_return_json(status: 200, body: {}) - - moderation_api = ModerationAPI::Client.new(base_url: "http://localhost", secret_key: "My Secret Key") - - moderation_api.content.submit(content: {text: "text", type: :text}) - - assert_requested(:any, /./) do |req| - headers = req.headers.transform_keys(&:downcase) - expected = req.body.nil? ? ["accept"] : %w[accept content-type] - headers.fetch_values(*expected).each { refute_empty(_1) } - end - end -end diff --git a/test/moderation_api/file_part_test.rb b/test/moderation_api/file_part_test.rb deleted file mode 100644 index 11262f4e..00000000 --- a/test/moderation_api/file_part_test.rb +++ /dev/null @@ -1,13 +0,0 @@ -# frozen_string_literal: true - -require_relative "test_helper" - -class ModerationAPI::Test::FilePartTest < Minitest::Test - def test_to_json - text = "gray" - filepart = ModerationAPI::FilePart.new(StringIO.new(text)) - - assert_equal(text.to_json, filepart.to_json) - assert_equal(text.to_yaml, filepart.to_yaml) - end -end diff --git a/test/moderation_api/internal/sorbet_runtime_support_test.rb b/test/moderation_api/internal/sorbet_runtime_support_test.rb deleted file mode 100644 index 41179260..00000000 --- a/test/moderation_api/internal/sorbet_runtime_support_test.rb +++ /dev/null @@ -1,52 +0,0 @@ -# frozen_string_literal: true - -require_relative "../test_helper" - -class ModerationAPI::Test::SorbetRuntimeSupportTest < Minitest::Test - extend Minitest::Serial - - i_suck_and_my_tests_are_order_dependent! - - module E - extend ModerationAPI::Internal::Type::Enum - - define_sorbet_constant!(:TaggedSymbol) { 1 } - end - - module U - extend ModerationAPI::Internal::Type::Union - - define_sorbet_constant!(:Variants) { 2 } - end - - class M < ModerationAPI::Internal::Type::BaseModel - define_sorbet_constant!(:OrHash) { 3 } - end - - def test_nil_aliases - err = ModerationAPI::Internal::Util::SorbetRuntimeSupport::MissingSorbetRuntimeError - - assert_raises(err) { ModerationAPI::Internal::AnyHash } - assert_raises(err) { ModerationAPI::Internal::FileInput } - assert_raises(err) { ModerationAPI::Internal::Type::Converter::Input } - assert_raises(err) { ModerationAPI::Internal::Type::Converter::CoerceState } - assert_raises(err) { ModerationAPI::Internal::Type::Converter::DumpState } - assert_raises(err) { ModerationAPI::Internal::Type::BaseModel::KnownField } - assert_raises(err) { ModerationAPI::Internal::Util::ParsedUri } - assert_raises(err) { ModerationAPI::Internal::Util::ServerSentEvent } - assert_raises(err) { ModerationAPI::Internal::Transport::BaseClient::RequestComponents } - assert_raises(err) { ModerationAPI::Internal::Transport::BaseClient::RequestInput } - assert_raises(err) { ModerationAPI::Internal::Transport::PooledNetRequester::Request } - assert_raises(err) { E::TaggedSymbol } - assert_raises(err) { U::Variants } - assert_raises(err) { M::OrHash } - end - - def test_stubbed_aliases - Kernel.instance_eval { const_set(:T, nil) } - - assert_equal(1, E::TaggedSymbol) - assert_equal(2, U::Variants) - assert_equal(3, M::OrHash) - end -end diff --git a/test/moderation_api/internal/type/base_model_test.rb b/test/moderation_api/internal/type/base_model_test.rb deleted file mode 100644 index 09a79cfc..00000000 --- a/test/moderation_api/internal/type/base_model_test.rb +++ /dev/null @@ -1,727 +0,0 @@ -# frozen_string_literal: true - -require_relative "../../test_helper" - -class ModerationAPI::Test::PrimitiveModelTest < Minitest::Test - A = ModerationAPI::Internal::Type::ArrayOf[-> { Integer }] - H = ModerationAPI::Internal::Type::HashOf[-> { Integer }, nil?: true] - - module E - extend ModerationAPI::Internal::Type::Enum - end - - module U - extend ModerationAPI::Internal::Type::Union - end - - class B < ModerationAPI::Internal::Type::BaseModel - optional :a, Integer - optional :b, B - end - - def test_typing - converters = [ - ModerationAPI::Internal::Type::Unknown, - ModerationAPI::Internal::Type::Boolean, - A, - H, - E, - U, - B - ] - - converters.each do |conv| - assert_pattern do - conv => ModerationAPI::Internal::Type::Converter - end - end - end - - def test_coerce - cases = { - [ModerationAPI::Internal::Type::Unknown, :a] => [{yes: 1}, :a], - [NilClass, :a] => [{maybe: 1}, nil], - [NilClass, nil] => [{yes: 1}, nil], - [ModerationAPI::Internal::Type::Boolean, true] => [{yes: 1}, true], - [ModerationAPI::Internal::Type::Boolean, "true"] => [{no: 1}, "true"], - [Integer, 1] => [{yes: 1}, 1], - [Integer, 1.0] => [{maybe: 1}, 1], - [Integer, "1"] => [{maybe: 1}, 1], - [Integer, "one"] => [{no: 1}, "one"], - [Float, 1] => [{yes: 1}, 1.0], - [Float, "1"] => [{maybe: 1}, 1.0], - [Float, :one] => [{no: 1}, :one], - [String, :str] => [{yes: 1}, "str"], - [String, "str"] => [{yes: 1}, "str"], - [String, 1] => [{maybe: 1}, "1"], - [:a, "a"] => [{yes: 1}, :a], - [Date, "1990-09-19"] => [{yes: 1}, Date.new(1990, 9, 19)], - [Date, Date.new(1990, 9, 19)] => [{yes: 1}, Date.new(1990, 9, 19)], - [Date, "one"] => [{no: 1}, "one"], - [Time, "1990-09-19"] => [{yes: 1}, Time.new(1990, 9, 19)], - [Time, Time.new(1990, 9, 19)] => [{yes: 1}, Time.new(1990, 9, 19)], - [Time, "one"] => [{no: 1}, "one"] - } - - cases.each do |lhs, rhs| - target, input = lhs - exactness, expect = rhs - state = ModerationAPI::Internal::Type::Converter.new_coerce_state - assert_pattern do - ModerationAPI::Internal::Type::Converter.coerce(target, input, state: state) => ^expect - state.fetch(:exactness).filter { _2.nonzero? }.to_h => ^exactness - end - end - end - - def test_dump - cases = { - [ModerationAPI::Internal::Type::Unknown, B.new(a: "one", b: B.new(a: 1.0))] => {a: "one", b: {a: 1}}, - [A, B.new(a: "one", b: B.new(a: 1.0))] => {a: "one", b: {a: 1}}, - [H, B.new(a: "one", b: B.new(a: 1.0))] => {a: "one", b: {a: 1}}, - [E, B.new(a: "one", b: B.new(a: 1.0))] => {a: "one", b: {a: 1}}, - [U, B.new(a: "one", b: B.new(a: 1.0))] => {a: "one", b: {a: 1}}, - [B, B.new(a: "one", b: B.new(a: 1.0))] => {a: "one", b: {a: 1}}, - [String, B.new(a: "one", b: B.new(a: 1.0))] => {a: "one", b: {a: 1}}, - [:b, B.new(a: "one", b: B.new(a: 1.0))] => {a: "one", b: {a: 1}}, - [nil, B.new(a: "one", b: B.new(a: 1.0))] => {a: "one", b: {a: 1}}, - [ModerationAPI::Internal::Type::Boolean, true] => true, - [ModerationAPI::Internal::Type::Boolean, "true"] => "true", - [Integer, "1"] => "1", - [Float, 1] => 1, - [String, "one"] => "one", - [String, :one] => :one, - [:a, :b] => :b, - [:a, "a"] => "a", - [String, StringIO.new("one")] => "one", - [String, Pathname(__FILE__)] => ModerationAPI::FilePart - } - - cases.each do - target, input = _1 - expect = _2 - assert_pattern do - ModerationAPI::Internal::Type::Converter.dump(target, input) => ^expect - end - end - end - - def test_coerce_errors - cases = { - [Integer, "one"] => ArgumentError, - [Float, "one"] => ArgumentError, - [String, Time] => TypeError, - [Date, "one"] => ArgumentError, - [Time, "one"] => ArgumentError - } - - cases.each do |testcase, expect| - target, input = testcase - state = ModerationAPI::Internal::Type::Converter.new_coerce_state - ModerationAPI::Internal::Type::Converter.coerce(target, input, state: state) - assert_pattern do - state => {error: ^expect} - end - end - end - - def test_dump_retry - types = [ - ModerationAPI::Internal::Type::Unknown, - ModerationAPI::Internal::Type::Boolean, - A, - H, - E, - U, - B - ] - Pathname(__FILE__).open do |fd| - cases = [ - fd, - [fd], - {a: fd}, - {a: {b: fd}} - ] - types.product(cases).each do |target, input| - state = {can_retry: true} - ModerationAPI::Internal::Type::Converter.dump(target, input, state: state) - - assert_pattern do - state => {can_retry: false} - end - end - end - end -end - -class ModerationAPI::Test::EnumModelTest < Minitest::Test - class E0 - include ModerationAPI::Internal::Type::Enum - - attr_reader :values - - def initialize(*values) = (@values = values) - end - - module E1 - extend ModerationAPI::Internal::Type::Enum - - TRUE = true - end - - module E2 - extend ModerationAPI::Internal::Type::Enum - - ONE = 1 - TWO = 2 - end - - module E3 - extend ModerationAPI::Internal::Type::Enum - - ONE = 1.0 - TWO = 2.0 - end - - module E4 - extend ModerationAPI::Internal::Type::Enum - - ONE = :one - TWO = :two - end - - def test_coerce - cases = { - [E0.new, "one"] => [{no: 1}, "one"], - [E0.new(:one), "one"] => [{yes: 1}, :one], - [E0.new(:two), "one"] => [{maybe: 1}, "one"], - - [E1, true] => [{yes: 1}, true], - [E1, false] => [{no: 1}, false], - [E1, :true] => [{no: 1}, :true], - - [E2, 1] => [{yes: 1}, 1], - [E2, 1.0] => [{yes: 1}, 1], - [E2, 1.2] => [{no: 1}, 1.2], - [E2, "1"] => [{no: 1}, "1"], - - [E3, 1.0] => [{yes: 1}, 1.0], - [E3, 1] => [{yes: 1}, 1.0], - [E3, "one"] => [{no: 1}, "one"], - - [E4, :one] => [{yes: 1}, :one], - [E4, "one"] => [{yes: 1}, :one], - [E4, "1"] => [{maybe: 1}, "1"], - [E4, :"1"] => [{maybe: 1}, :"1"], - [E4, 1] => [{no: 1}, 1] - } - - cases.each do |lhs, rhs| - target, input = lhs - exactness, expect = rhs - state = ModerationAPI::Internal::Type::Converter.new_coerce_state - assert_pattern do - ModerationAPI::Internal::Type::Converter.coerce(target, input, state: state) => ^expect - state.fetch(:exactness).filter { _2.nonzero? }.to_h => ^exactness - end - end - end - - def test_dump - cases = { - [E1, true] => true, - [E1, "true"] => "true", - - [E2, 1.0] => 1.0, - [E2, 3] => 3, - [E2, "1.0"] => "1.0", - - [E3, 1.0] => 1.0, - [E3, 3] => 3, - [E3, "1.0"] => "1.0", - - [E4, :one] => :one, - [E4, "one"] => "one", - [E4, "1.0"] => "1.0" - } - - cases.each do - target, input = _1 - expect = _2 - assert_pattern do - ModerationAPI::Internal::Type::Converter.dump(target, input) => ^expect - end - end - end -end - -class ModerationAPI::Test::CollectionModelTest < Minitest::Test - A1 = ModerationAPI::Internal::Type::ArrayOf[-> { Integer }] - H1 = ModerationAPI::Internal::Type::HashOf[Integer] - - A2 = ModerationAPI::Internal::Type::ArrayOf[H1] - H2 = ModerationAPI::Internal::Type::HashOf[-> { A1 }] - - A3 = ModerationAPI::Internal::Type::ArrayOf[Integer, nil?: true] - H3 = ModerationAPI::Internal::Type::HashOf[Integer, nil?: true] - - def test_coerce - cases = { - [A1, []] => [{yes: 1}, []], - [A1, {}] => [{no: 1}, {}], - [A1, [1, 2.0]] => [{yes: 2, maybe: 1}, [1, 2]], - [A1, ["1", 2.0]] => [{yes: 1, maybe: 2}, [1, 2]], - [H1, {}] => [{yes: 1}, {}], - [H1, []] => [{no: 1}, []], - [H1, {a: 1, b: 2}] => [{yes: 3}, {a: 1, b: 2}], - [H1, {"a" => 1, "b" => 2}] => [{yes: 3}, {a: 1, b: 2}], - [H1, {[] => 1}] => [{yes: 2, no: 1}, {[] => 1}], - [H1, {a: 1.5}] => [{yes: 1, maybe: 1}, {a: 1}], - - [A2, [{}, {"a" => 1}]] => [{yes: 4}, [{}, {a: 1}]], - [A2, [{"a" => "1"}]] => [{yes: 2, maybe: 1}, [{a: 1}]], - [H2, {a: [1, 2]}] => [{yes: 4}, {a: [1, 2]}], - [H2, {"a" => ["1", 2]}] => [{yes: 3, maybe: 1}, {a: [1, 2]}], - [H2, {"a" => ["one", 2]}] => [{yes: 3, no: 1}, {a: ["one", 2]}], - - [A3, [nil, 1]] => [{yes: 3}, [nil, 1]], - [A3, [nil, "1"]] => [{yes: 2, maybe: 1}, [nil, 1]], - [H3, {a: nil, b: "1"}] => [{yes: 2, maybe: 1}, {a: nil, b: 1}], - [H3, {a: nil}] => [{yes: 2}, {a: nil}] - } - - cases.each do |lhs, rhs| - target, input = lhs - exactness, expect = rhs - state = ModerationAPI::Internal::Type::Converter.new_coerce_state - assert_pattern do - ModerationAPI::Internal::Type::Converter.coerce(target, input, state: state) => ^expect - state.fetch(:exactness).filter { _2.nonzero? }.to_h => ^exactness - end - end - end -end - -class ModerationAPI::Test::BaseModelTest < Minitest::Test - class M1 < ModerationAPI::Internal::Type::BaseModel - required :a, Integer - end - - class M2 < M1 - required :a, Time - required :b, Integer, nil?: true - optional :c, String - end - - class M3 < ModerationAPI::Internal::Type::BaseModel - optional :c, const: :c - required :d, const: :d - end - - class M4 < M1 - request_only do - required :a, Integer - optional :b, String - end - - response_only do - required :c, Integer - optional :d, String - end - end - - class M5 < ModerationAPI::Internal::Type::BaseModel - request_only do - required :c, const: :c - end - - response_only do - required :d, const: :d - end - end - - class M6 < M1 - required :a, ModerationAPI::Internal::Type::ArrayOf[M6] - optional :b, M6 - end - - def test_coerce - cases = { - [M1, {}] => [{yes: 1, no: 1}, {}], - [M1, :m1] => [{no: 1}, :m1], - - [M2, {}] => [{yes: 2, no: 1, maybe: 1}, {}], - [M2, {a: "1990-09-19", b: nil}] => [{yes: 4}, {a: "1990-09-19", b: nil}], - [M2, {a: "1990-09-19", b: "1"}] => [{yes: 3, maybe: 1}, {a: "1990-09-19", b: "1"}], - [M2, {a: "1990-09-19"}] => [{yes: 3, maybe: 1}, {a: "1990-09-19"}], - [M2, {a: "1990-09-19", c: nil}] => [{yes: 2, maybe: 2}, {a: "1990-09-19", c: nil}], - - [M3, {c: "c", d: "d"}] => [{yes: 3}, {c: :c, d: :d}], - [M3, {c: "d", d: "c"}] => [{yes: 1, maybe: 2}, {c: "d", d: "c"}], - - [M4, {c: 2}] => [{yes: 5}, {c: 2}], - [M4, {a: "1", c: 2}] => [{yes: 4, maybe: 1}, {a: "1", c: 2}], - [M4, {b: nil, c: 2}] => [{yes: 4, maybe: 1}, {b: nil, c: 2}], - - [M5, {}] => [{yes: 3}, {}], - [M5, {c: "c"}] => [{yes: 3}, {c: :c}], - [M5, {d: "d"}] => [{yes: 3}, {d: :d}], - [M5, {d: nil}] => [{yes: 2, no: 1}, {d: nil}], - - [M6, {a: [{a: []}]}] => [{yes: 6}, -> { _1 in {a: [M6]} }], - [M6, {b: {a: []}}] => [{yes: 4, no: 1}, -> { _1 in {b: M6} }] - } - - cases.each do |lhs, rhs| - target, input = lhs - exactness, expect = rhs - state = ModerationAPI::Internal::Type::Converter.new_coerce_state - assert_pattern do - coerced = ModerationAPI::Internal::Type::Converter.coerce(target, input, state: state) - assert_equal(coerced, coerced) - if coerced.is_a?(ModerationAPI::Internal::Type::BaseModel) - coerced.to_h => ^expect - else - coerced => ^expect - end - state.fetch(:exactness).filter { _2.nonzero? }.to_h => ^exactness - end - end - end - - def test_dump - cases = { - [M3, M3.new] => {d: :d}, - [M3, {}] => {d: :d}, - [M3, {d: 1}] => {d: 1}, - - [M4, M4.new(a: 1, b: "b", c: 2, d: "d")] => {a: 1, b: "b"}, - [M4, {a: 1, b: "b", c: 2, d: "d"}] => {a: 1, b: "b"}, - - [M5, M5.new] => {c: :c}, - [M5, {}] => {c: :c}, - [M5, {c: 1}] => {c: 1} - } - - cases.each do - target, input = _1 - expect = _2 - assert_pattern do - ModerationAPI::Internal::Type::Converter.dump(target, input) => ^expect - end - end - end - - def test_accessors - cases = { - M2.new({a: "1990-09-19", b: "1"}) => [{a: "1990-09-19", b: "1"}, {a: Time.new(1990, 9, 19), b: 1}], - M2.new(a: "one", b: "one") => [{a: "one", b: "one"}, {a: ArgumentError, b: ArgumentError}], - M2.new(a: nil, b: 2.0) => [{a: nil, b: 2.0}, {a: TypeError}], - M2.new(a: nil, b: 2.2) => [{a: nil, b: 2.2}, {a: TypeError, b: 2}], - - M3.new => [{}, {d: :d}], - M3.new(d: 1) => [{d: 1}, {d: ArgumentError}], - - M5.new => [{}, {c: :c, d: :d}] - } - - cases.each do - target = _1 - data, attributes = _2 - - assert_pattern do - target.to_h => ^data - end - - attributes.each do |accessor, expect| - case expect - in Class if expect <= StandardError - tap do - target.public_send(accessor) - flunk - rescue ModerationAPI::Errors::ConversionError => e - assert_kind_of(expect, e.cause) - end - else - assert_pattern { target.public_send(accessor) => ^expect } - end - end - end - end - - def test_inplace_modification - m1 = M6.new(a: []) - m1.a << M6.new(a: []) - - m2 = M6.new(b: M6.new(a: [])) - m2.b.a << M6.new(a: []) - - m3 = M6.new(a: []) - m4 = M6.new(b: m3) - m3.a << M6.new(a: []) - - assert_pattern do - m1 => {a: [{a: []}]} - m2 => {b: {a: [{a: []}]}} - m4 => {b: {a: [{a: []}]}} - end - end -end - -class ModerationAPI::Test::UnionTest < Minitest::Test - class U0 - include ModerationAPI::Internal::Type::Union - - def initialize(*variants) = variants.each { variant(_1) } - end - - module U1 - extend ModerationAPI::Internal::Type::Union - - variant const: :a - variant const: 2 - end - - class M1 < ModerationAPI::Internal::Type::BaseModel - required :t, const: :a, api_name: :type - optional :c, String - end - - class M2 < ModerationAPI::Internal::Type::BaseModel - required :type, const: :b - optional :c, String - end - - module U2 - extend ModerationAPI::Internal::Type::Union - - discriminator :type - - variant :a, M1 - variant :b, M2 - end - - module U3 - extend ModerationAPI::Internal::Type::Union - - discriminator :type - - variant :a, M1 - variant String - end - - module U4 - extend ModerationAPI::Internal::Type::Union - - discriminator :type - - variant String - variant :a, M1 - end - - class M3 < ModerationAPI::Internal::Type::BaseModel - optional :recur, -> { U5 } - required :a, Integer - end - - class M4 < ModerationAPI::Internal::Type::BaseModel - optional :recur, -> { U5 } - required :a, ModerationAPI::Internal::Type::ArrayOf[-> { U5 }] - end - - class M5 < ModerationAPI::Internal::Type::BaseModel - optional :recur, -> { U5 } - required :b, ModerationAPI::Internal::Type::ArrayOf[-> { U5 }] - end - - module U5 - extend ModerationAPI::Internal::Type::Union - - variant -> { M3 } - variant -> { M4 } - end - - module U6 - extend ModerationAPI::Internal::Type::Union - - variant -> { M3 } - variant -> { M5 } - end - - def test_accessors - model = M3.new(recur: []) - tap do - model.recur - flunk - rescue ModerationAPI::Errors::ConversionError => e - assert_kind_of(ArgumentError, e.cause) - end - end - - def test_coerce - cases = { - [U0, :""] => [{no: 1}, 0, :""], - - [U0.new(Integer, Float), "one"] => [{no: 1}, 2, "one"], - [U0.new(Integer, Float), 1.0] => [{yes: 1}, 2, 1.0], - [U0.new({const: :a}), "a"] => [{yes: 1}, 1, :a], - [U0.new({const: :a}), "2"] => [{maybe: 1}, 1, "2"], - - [U1, "a"] => [{yes: 1}, 1, :a], - [U1, "2"] => [{maybe: 1}, 2, "2"], - [U1, :b] => [{maybe: 1}, 2, :b], - - [U2, {type: :a}] => [{yes: 3}, 0, {t: :a}], - [U2, {type: "b"}] => [{yes: 3}, 0, {type: :b}], - - [U3, "one"] => [{yes: 1}, 2, "one"], - [U4, "one"] => [{yes: 1}, 1, "one"], - - [U5, {a: []}] => [{yes: 3}, 2, {a: []}], - [U6, {b: []}] => [{yes: 3}, 2, {b: []}], - - [U5, {a: [{a: []}]}] => [{yes: 6}, 4, {a: [M4.new(a: [])]}], - [U5, {a: [{a: [{a: []}]}]}] => [{yes: 9}, 6, {a: [M4.new(a: [M4.new(a: [])])]}] - } - - cases.each do |lhs, rhs| - target, input = lhs - exactness, branched, expect = rhs - state = ModerationAPI::Internal::Type::Converter.new_coerce_state - assert_pattern do - coerced = ModerationAPI::Internal::Type::Converter.coerce(target, input, state: state) - assert_equal(coerced, coerced) - if coerced.is_a?(ModerationAPI::Internal::Type::BaseModel) - coerced.to_h => ^expect - else - coerced => ^expect - end - state.fetch(:exactness).filter { _2.nonzero? }.to_h => ^exactness - state => {branched: ^branched} - end - end - end -end - -class ModerationAPI::Test::BaseModelQoLTest < Minitest::Test - class E0 - include ModerationAPI::Internal::Type::Enum - - attr_reader :values - - def initialize(*values) = (@values = values) - end - - module E1 - extend ModerationAPI::Internal::Type::Enum - - A = 1 - end - - module E2 - extend ModerationAPI::Internal::Type::Enum - - A = 1 - end - - module E3 - extend ModerationAPI::Internal::Type::Enum - - A = 2 - B = 3 - end - - class U0 - include ModerationAPI::Internal::Type::Union - - def initialize(*variants) = variants.each { variant(_1) } - end - - module U1 - extend ModerationAPI::Internal::Type::Union - - variant String - variant Integer - end - - module U2 - extend ModerationAPI::Internal::Type::Union - - variant String - variant Integer - end - - class M1 < ModerationAPI::Internal::Type::BaseModel - required :a, Integer - end - - class M2 < ModerationAPI::Internal::Type::BaseModel - required :a, Integer, nil?: true - end - - class M3 < M2 - required :a, Integer - end - - def test_equality - cases = { - [ModerationAPI::Internal::Type::Unknown, ModerationAPI::Internal::Type::Unknown] => true, - [ModerationAPI::Internal::Type::Boolean, ModerationAPI::Internal::Type::Boolean] => true, - [ModerationAPI::Internal::Type::Unknown, ModerationAPI::Internal::Type::Boolean] => false, - [E0.new(:a, :b), E0.new(:a, :b)] => true, - [E0.new(:a, :b), E0.new(:b, :a)] => true, - [E0.new(:a, :b), E0.new(:b, :c)] => false, - [E1, E2] => true, - [E1, E3] => false, - [U0.new(String, Integer), U0.new(String, Integer)] => true, - [U0.new(String, Integer), U0.new(Integer, String)] => false, - [U0.new(String, Float), U0.new(String, Integer)] => false, - [U1, U2] => true, - [M1, M2] => false, - [M1, M3] => true, - [M1.new(a: 1), M1.new(a: 1)] => true - } - - cases.each do - if _2 - assert_equal(*_1) - assert_equal(*_1.map(&:hash)) - else - refute_equal(*_1) - refute_equal(*_1.map(&:hash)) - end - end - end -end - -class ModerationAPI::Test::MetaInfoTest < Minitest::Test - A1 = ModerationAPI::Internal::Type::ArrayOf[Integer, nil?: true, doc: "dog"] - H1 = ModerationAPI::Internal::Type::HashOf[-> { String }, nil?: true, doc: "dawg"] - - class M1 < ModerationAPI::Internal::Type::BaseModel - required :a, Integer, doc: "dog" - optional :b, -> { String }, nil?: true, doc: "dawg" - end - - module U1 - extend ModerationAPI::Internal::Type::Union - - variant -> { Integer }, const: 2, doc: "dog" - variant -> { String }, doc: "dawg" - end - - def test_meta_retrieval - m1 = A1.instance_variable_get(:@meta) - m2 = H1.instance_variable_get(:@meta) - assert_equal({doc: "dog"}, m1) - assert_equal({doc: "dawg"}, m2) - - ma, mb = M1.fields.fetch_values(:a, :b) - assert_equal({doc: "dog"}, ma.fetch(:meta)) - assert_equal({doc: "dawg"}, mb.fetch(:meta)) - - ua, ub = U1.send(:known_variants).map(&:last) - assert_equal({doc: "dog"}, ua) - assert_equal({doc: "dawg"}, ub) - end -end diff --git a/test/moderation_api/internal/util_test.rb b/test/moderation_api/internal/util_test.rb deleted file mode 100644 index e7de629a..00000000 --- a/test/moderation_api/internal/util_test.rb +++ /dev/null @@ -1,675 +0,0 @@ -# frozen_string_literal: true - -require_relative "../test_helper" - -class ModerationAPI::Test::UtilDataHandlingTest < Minitest::Test - def test_left_map - assert_pattern do - ModerationAPI::Internal::Util.deep_merge({a: 1}, nil) => nil - end - end - - def test_right_map - assert_pattern do - ModerationAPI::Internal::Util.deep_merge(nil, {a: 1}) => {a: 1} - end - end - - def test_disjoint_maps - assert_pattern do - ModerationAPI::Internal::Util.deep_merge({b: 2}, {a: 1}) => {a: 1, b: 2} - end - end - - def test_overlapping_maps - assert_pattern do - ModerationAPI::Internal::Util.deep_merge({b: 2, c: 3}, {a: 1, c: 4}) => {a: 1, b: 2, c: 4} - end - end - - def test_nested - assert_pattern do - ModerationAPI::Internal::Util.deep_merge({b: {b2: 1}}, {b: {b2: 2}}) => {b: {b2: 2}} - end - end - - def test_nested_left_map - assert_pattern do - ModerationAPI::Internal::Util.deep_merge({b: {b2: 1}}, {b: 6}) => {b: 6} - end - end - - def test_omission - merged = ModerationAPI::Internal::Util.deep_merge( - {b: {b2: 1, b3: {c: 4, d: 5}}}, - {b: {b2: 1, b3: {c: ModerationAPI::Internal::OMIT, d: 5}}} - ) - - assert_pattern do - merged => {b: {b2: 1, b3: {d: 5}}} - end - end - - def test_concat - merged = ModerationAPI::Internal::Util.deep_merge( - {a: {b: [1, 2]}}, - {a: {b: [3, 4]}}, - concat: true - ) - - assert_pattern do - merged => {a: {b: [1, 2, 3, 4]}} - end - end - - def test_concat_false - merged = ModerationAPI::Internal::Util.deep_merge( - {a: {b: [1, 2]}}, - {a: {b: [3, 4]}}, - concat: false - ) - - assert_pattern do - merged => {a: {b: [3, 4]}} - end - end - - def test_dig - assert_pattern do - ModerationAPI::Internal::Util.dig(1, nil) => 1 - ModerationAPI::Internal::Util.dig({a: 1}, :b) => nil - ModerationAPI::Internal::Util.dig({a: 1}, :a) => 1 - ModerationAPI::Internal::Util.dig({a: {b: 1}}, [:a, :b]) => 1 - - ModerationAPI::Internal::Util.dig([], 1) => nil - ModerationAPI::Internal::Util.dig([nil, [nil, 1]], [1, 1]) => 1 - ModerationAPI::Internal::Util.dig({a: [nil, 1]}, [:a, 1]) => 1 - ModerationAPI::Internal::Util.dig([], 1.0) => nil - - ModerationAPI::Internal::Util.dig(Object, 1) => nil - ModerationAPI::Internal::Util.dig([], 1.0) { 2 } => 2 - ModerationAPI::Internal::Util.dig([], ->(_) { 2 }) => 2 - ModerationAPI::Internal::Util.dig([1], -> { _1 in [1] }) => true - end - end -end - -class ModerationAPI::Test::UtilUriHandlingTest < Minitest::Test - def test_parsing - %w[ - http://example.com - https://example.com/ - https://example.com:443/example?e1=e1&e2=e2&e= - ].each do |url| - parsed = ModerationAPI::Internal::Util.parse_uri(url) - unparsed = ModerationAPI::Internal::Util.unparse_uri(parsed).to_s - - assert_equal(url, unparsed) - assert_equal(parsed, ModerationAPI::Internal::Util.parse_uri(unparsed)) - end - end - - def test_joining - cases = [ - [ - "h://a.b/c?d=e", - "h://nope/ignored", - ModerationAPI::Internal::Util.parse_uri("h://a.b/c?d=e") - ], - [ - "h://a.b/c?d=e", - "h://nope", - { - host: "a.b", - path: "/c", - query: {"d" => ["e"]} - } - ], - [ - "h://a.b/c?d=e", - "h://nope", - { - path: "h://a.b/c", - query: {"d" => ["e"]} - } - ] - ] - - cases.each do |expect, lhs, rhs| - assert_equal( - URI.parse(expect), - ModerationAPI::Internal::Util.join_parsed_uri( - ModerationAPI::Internal::Util.parse_uri(lhs), - rhs - ) - ) - end - end - - def test_joining_queries - base_url = "h://a.b/c?d=e" - cases = { - "c2" => "h://a.b/c/c2", - "/c2?f=g" => "h://a.b/c2?f=g", - "/c?f=g" => "h://a.b/c?d=e&f=g" - } - - cases.each do |path, expected| - assert_equal( - URI.parse(expected), - ModerationAPI::Internal::Util.join_parsed_uri( - ModerationAPI::Internal::Util.parse_uri(base_url), - {path: path} - ) - ) - end - end -end - -class ModerationAPI::Test::RegexMatchTest < Minitest::Test - def test_json_content - cases = { - "application/json" => true, - "application/jsonl" => false, - "application/arbitrary+json" => true, - "application/ARBITRARY+json" => true, - "application/vnd.github.v3+json" => true, - "application/vnd.api+json" => true - } - cases.each do |header, verdict| - assert_pattern do - ModerationAPI::Internal::Util::JSON_CONTENT.match?(header) => ^verdict - end - end - end - - def test_jsonl_content - cases = { - "application/x-ndjson" => true, - "application/x-ldjson" => true, - "application/jsonl" => true, - "application/x-jsonl" => true, - "application/json" => false, - "application/vnd.api+json" => false - } - cases.each do |header, verdict| - assert_pattern do - ModerationAPI::Internal::Util::JSONL_CONTENT.match?(header) => ^verdict - end - end - end -end - -class ModerationAPI::Test::UtilFormDataEncodingTest < Minitest::Test - class FakeCGI < CGI - def initialize(headers, io) - encoded = io.to_a - @ctype = headers["content-type"] - # rubocop:disable Lint/EmptyBlock - @io = ModerationAPI::Internal::Util::ReadIOAdapter.new(encoded.to_enum) {} - # rubocop:enable Lint/EmptyBlock - @c_len = encoded.join.bytesize.to_s - super() - end - - def stdinput = @io - - def env_table - { - "REQUEST_METHOD" => "POST", - "CONTENT_TYPE" => @ctype, - "CONTENT_LENGTH" => @c_len - } - end - end - - def test_encoding_length - headers, = ModerationAPI::Internal::Util.encode_content( - {"content-type" => "multipart/form-data"}, - Pathname(__FILE__) - ) - assert_pattern do - headers.fetch("content-type") => /boundary=(.+)$/ - end - field, = Regexp.last_match.captures - assert(field.length < 70 - 6) - end - - def test_file_encode - file = Pathname(__FILE__) - fileinput = ModerationAPI::Internal::Type::Converter.dump(ModerationAPI::Internal::Type::FileInput, "abc") - headers = {"content-type" => "multipart/form-data"} - cases = { - "abc" => ["", "abc"], - StringIO.new("abc") => ["", "abc"], - fileinput => %w[upload abc], - ModerationAPI::FilePart.new(StringIO.new("abc")) => ["", "abc"], - file => [file.basename.to_path, /^class ModerationAPI/], - ModerationAPI::FilePart.new(file, filename: "d o g") => ["d%20o%20g", /^class ModerationAPI/] - } - cases.each do |body, testcase| - filename, val = testcase - encoded = ModerationAPI::Internal::Util.encode_content(headers, body) - cgi = FakeCGI.new(*encoded) - io = cgi[""] - assert_pattern do - io.original_filename => ^filename - io.read => ^val - end - end - end - - def test_hash_encode - headers = {"content-type" => "multipart/form-data"} - cases = { - {a: 2, b: 3} => {"a" => "2", "b" => "3"}, - {a: 2, b: nil} => {"a" => "2", "b" => "null"}, - {a: 2, b: [1, 2, 3]} => {"a" => "2", "b" => "1"}, - {strio: StringIO.new("a")} => {"strio" => "a"}, - {strio: ModerationAPI::FilePart.new("a")} => {"strio" => "a"}, - {pathname: Pathname(__FILE__)} => {"pathname" => -> { _1.read in /^class ModerationAPI/ }}, - {pathname: ModerationAPI::FilePart.new(Pathname(__FILE__))} => {"pathname" => -> { _1.read in /^class ModerationAPI/ }} - } - cases.each do |body, testcase| - encoded = ModerationAPI::Internal::Util.encode_content(headers, body) - cgi = FakeCGI.new(*encoded) - testcase.each do |key, val| - assert_pattern do - parsed = - case (p = cgi[key]) - in StringIO - p.read - else - p - end - parsed => ^val - end - end - end - end -end - -class ModerationAPI::Test::UtilIOAdapterTest < Minitest::Test - def test_copy_read - cases = { - StringIO.new("abc") => "abc", - Enumerator.new { _1 << "abc" } => "abc" - } - cases.each do |input, expected| - io = StringIO.new - # rubocop:disable Lint/EmptyBlock - adapter = ModerationAPI::Internal::Util::ReadIOAdapter.new(input) {} - # rubocop:enable Lint/EmptyBlock - IO.copy_stream(adapter, io) - assert_equal(expected, io.string) - end - end - - def test_copy_write - cases = { - StringIO.new => "", - StringIO.new("abc") => "abc" - } - cases.each do |input, expected| - enum = ModerationAPI::Internal::Util.writable_enum do |y| - IO.copy_stream(input, y) - end - assert_equal(expected, enum.to_a.join) - end - end -end - -class ModerationAPI::Test::UtilFusedEnumTest < Minitest::Test - def test_rewind_closing - touched = false - once = 0 - steps = 0 - enum = Enumerator.new do |y| - next if touched - - 10.times do - steps = _1 - y << _1 - end - ensure - once = once.succ - end - - fused = ModerationAPI::Internal::Util.fused_enum(enum, external: true) do - touched = true - loop { enum.next } - end - ModerationAPI::Internal::Util.close_fused!(fused) - - assert_equal(1, once) - assert_equal(0, steps) - end - - def test_thread_interrupts - once = 0 - que = Queue.new - enum = Enumerator.new do |y| - 10.times { y << _1 } - ensure - once = once.succ - end - - fused_1 = ModerationAPI::Internal::Util.fused_enum(enum, external: true) { loop { enum.next } } - fused_2 = ModerationAPI::Internal::Util.chain_fused(fused_1) { fused_1.each(&_1) } - fused_3 = ModerationAPI::Internal::Util.chain_fused(fused_2) { fused_2.each(&_1) } - - th = ::Thread.new do - que << "🐶" - fused_3.each { sleep(10) } - end - - assert_equal("🐶", que.pop) - th.kill.join - assert_equal(1, once) - end - - def test_closing - arr = [1, 2, 3] - once = 0 - fused = ModerationAPI::Internal::Util.fused_enum(arr.to_enum) do - once = once.succ - end - - enumerated_1 = fused.to_a - assert_equal(arr, enumerated_1) - assert_equal(1, once) - - enumerated_2 = fused.to_a - assert_equal([], enumerated_2) - assert_equal(1, once) - end - - def test_rewind_chain - once = 0 - fused = ModerationAPI::Internal::Util.fused_enum([1, 2, 3].to_enum) do - once = once.succ - end - .lazy - .map(&:succ) - .filter(&:odd?) - first = fused.next - - assert_equal(3, first) - assert_equal(0, once) - assert_raises(StopIteration) { fused.rewind.next } - assert_equal(1, once) - end - - def test_external_iteration - iter = [1, 2, 3].to_enum - first = iter.next - fused = ModerationAPI::Internal::Util.fused_enum(iter, external: true) - - assert_equal(1, first) - assert_equal([2, 3], fused.to_a) - end - - def test_close_fused - once = 0 - fused = ModerationAPI::Internal::Util.fused_enum([1, 2, 3].to_enum) do - once = once.succ - end - - ModerationAPI::Internal::Util.close_fused!(fused) - - assert_equal(1, once) - assert_equal([], fused.to_a) - assert_equal(1, once) - end - - def test_closed_fused_extern_iteration - taken = 0 - enum = [1, 2, 3].to_enum.lazy.map do - taken = taken.succ - _1 - end - fused = ModerationAPI::Internal::Util.fused_enum(enum) - first = fused.next - - assert_equal(1, first) - ModerationAPI::Internal::Util.close_fused!(fused) - assert_equal(1, taken) - end - - def test_closed_fused_taken_count - taken = 0 - enum = [1, 2, 3].to_enum.lazy.map do - taken = taken.succ - _1 - end - .map(&:succ) - .filter(&:odd?) - fused = ModerationAPI::Internal::Util.fused_enum(enum) - - assert_equal(0, taken) - ModerationAPI::Internal::Util.close_fused!(fused) - assert_equal(0, taken) - end - - def test_closed_fused_extern_iter_taken_count - taken = 0 - enum = [1, 2, 3].to_enum.lazy.map do - taken = taken.succ - _1 - end - .map(&:succ) - .filter(&:itself) - first = enum.next - assert_equal(2, first) - assert_equal(1, taken) - - fused = ModerationAPI::Internal::Util.fused_enum(enum) - ModerationAPI::Internal::Util.close_fused!(fused) - assert_equal(1, taken) - end - - def test_close_fused_sse_chain - taken = 0 - enum = [1, 2, 3].to_enum.lazy.map do - taken = taken.succ - _1 - end - .map(&:succ) - .filter(&:odd?) - .map(&:to_s) - - fused_1 = ModerationAPI::Internal::Util.fused_enum(enum) - fused_2 = ModerationAPI::Internal::Util.decode_lines(fused_1) - fused_3 = ModerationAPI::Internal::Util.decode_sse(fused_2) - - assert_equal(0, taken) - ModerationAPI::Internal::Util.close_fused!(fused_3) - assert_equal(0, taken) - end -end - -class ModerationAPI::Test::UtilContentDecodingTest < Minitest::Test - def test_charset - cases = { - "application/json" => Encoding::BINARY, - "application/json; charset=utf-8" => Encoding::UTF_8, - "charset=uTf-8 application/json; " => Encoding::UTF_8, - "charset=UTF-8; application/json; " => Encoding::UTF_8, - "charset=ISO-8859-1 ;application/json; " => Encoding::ISO_8859_1, - "charset=EUC-KR ;application/json; " => Encoding::EUC_KR - } - text = String.new.force_encoding(Encoding::BINARY) - cases.each do |content_type, encoding| - ModerationAPI::Internal::Util.force_charset!(content_type, text: text) - assert_equal(encoding, text.encoding) - end - end -end - -class ModerationAPI::Test::UtilSseTest < Minitest::Test - def test_decode_lines - cases = { - %w[] => %w[], - %W[\n\n] => %W[\n \n], - %W[\n \n] => %W[\n \n], - %w[a] => %w[a], - %W[a\nb] => %W[a\n b], - %W[a\nb\n] => %W[a\n b\n], - %W[\na b\n] => %W[\n ab\n], - %W[\na b\n\n] => %W[\n ab\n \n], - %W[\na b] => %W[\n ab], - %W[\u1F62E\u200D\u1F4A8] => %W[\u1F62E\u200D\u1F4A8], - %W[\u1F62E \u200D \u1F4A8] => %W[\u1F62E\u200D\u1F4A8], - ["\xf0\x9f".b, "\xa5\xba".b] => ["\xf0\x9f\xa5\xba".b], - ["\xf0".b, "\x9f".b, "\xa5".b, "\xba".b] => ["\xf0\x9f\xa5\xba".b] - } - eols = %W[\n \r \r\n] - cases.each do |enum, expected| - eols.each do |eol| - lines = ModerationAPI::Internal::Util.decode_lines(enum.map { _1.gsub("\n", eol) }) - assert_equal(expected.map { _1.gsub("\n", eol) }, lines.to_a, "eol=#{JSON.generate(eol)}") - end - end - end - - def test_mixed_decode_lines - cases = { - %w[] => %w[], - %W[\r\r] => %W[\r \r], - %W[\r \r] => %W[\r \r], - %W[\r\r\r] => %W[\r \r \r], - %W[\r\r \r] => %W[\r \r \r], - %W[\r \n] => %W[\r\n], - %W[\r\r\n] => %W[\r \r\n], - %W[\n\r] => %W[\n \r] - } - cases.each do |enum, expected| - lines = ModerationAPI::Internal::Util.decode_lines(enum) - assert_equal(expected, lines.to_a) - end - end - - def test_decode_sse - cases = { - "empty input" => { - [] => [] - }, - "single data event" => { - [ - "data: hello world\n", - "\n" - ] => [ - {data: "hello world\n"} - ] - }, - "multiple data lines" => { - [ - "data: line 1\n", - "data: line 2\n", - "\n" - ] => [ - {data: "line 1\nline 2\n"} - ] - }, - "complete event" => { - [ - "id: 123\n", - "event: update\n", - "data: hello world\n", - "retry: 5000\n", - "\n" - ] => [ - { - event: "update", - id: "123", - data: "hello world\n", - retry: 5000 - } - ] - }, - "multiple events" => { - [ - "event: update\n", - "data: first\n", - "\n", - "event: message\n", - "data: second\n", - "\n" - ] => [ - {event: "update", data: "first\n"}, - {event: "message", data: "second\n"} - ] - }, - "comments" => { - [ - ": this is a comment\n", - "data: actual data\n", - "\n" - ] => [ - {data: "actual data\n"} - ] - }, - "invalid retry" => { - [ - "retry: not a number\n", - "data: hello\n", - "\n" - ] => [ - {data: "hello\n"} - ] - }, - "invalid id with null" => { - [ - "id: bad\0id\n", - "data: hello\n", - "\n" - ] => [ - {data: "hello\n"} - ] - }, - "leading space in value" => { - [ - "data: hello world\n", - "data: leading space\n", - "\n" - ] => [ - {data: "hello world\n leading space\n"} - ] - }, - "no final newline" => { - [ - "data: hello\n", - "id: 1" - ] => [ - {data: "hello\n", id: "1"} - ] - }, - "multiple empty lines" => { - [ - "data: first\n", - "\n", - "\n", - "data: second\n", - "\n" - ] => [ - {data: "first\n"}, - {data: "second\n"} - ] - }, - "multibyte unicode" => { - [ - "data: \u1F62E\u200D\u1F4A8\n" - ] => [ - {data: "\u1F62E\u200D\u1F4A8\n"} - ] - } - } - - cases.each do |name, test_cases| - test_cases.each do |input, expected| - actual = ModerationAPI::Internal::Util.decode_sse(input).map(&:compact) - assert_equal(expected, actual, name) - end - end - end -end diff --git a/test/moderation_api/resource_namespaces.rb b/test/moderation_api/resource_namespaces.rb deleted file mode 100644 index ee9ba53e..00000000 --- a/test/moderation_api/resource_namespaces.rb +++ /dev/null @@ -1,16 +0,0 @@ -# frozen_string_literal: true - -module ModerationAPI - module Test - module Resources - module Actions - end - - module Queue - end - - module Wordlist - end - end - end -end diff --git a/test/moderation_api/resources/account_test.rb b/test/moderation_api/resources/account_test.rb deleted file mode 100644 index a653fff5..00000000 --- a/test/moderation_api/resources/account_test.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true - -require_relative "../test_helper" - -class ModerationAPI::Test::Resources::AccountTest < ModerationAPI::Test::ResourceTest - def test_list - skip("Mock server tests are disabled") - - response = @moderation_api.account.list - - assert_pattern do - response => ModerationAPI::Models::AccountListResponse - end - - assert_pattern do - response => { - id: String, - paid_plan_name: String, - remaining_quota: Float, - text_api_quota: Float, - current_project: ModerationAPI::Models::AccountListResponse::CurrentProject | nil - } - end - end -end diff --git a/test/moderation_api/resources/actions/execute_test.rb b/test/moderation_api/resources/actions/execute_test.rb deleted file mode 100644 index c6d68735..00000000 --- a/test/moderation_api/resources/actions/execute_test.rb +++ /dev/null @@ -1,39 +0,0 @@ -# frozen_string_literal: true - -require_relative "../../test_helper" - -class ModerationAPI::Test::Resources::Actions::ExecuteTest < ModerationAPI::Test::ResourceTest - def test_execute_required_params - skip("Mock server tests are disabled") - - response = @moderation_api.actions.execute.execute(action_key: "actionKey") - - assert_pattern do - response => ModerationAPI::Models::Actions::ExecuteExecuteResponse - end - - assert_pattern do - response => { - success: ModerationAPI::Internal::Type::Boolean - } - end - end - - def test_execute_by_id - skip("Mock server tests are disabled") - - response = @moderation_api.actions.execute.execute_by_id("actionId") - - assert_pattern do - response => ModerationAPI::Models::Actions::ExecuteExecuteByIDResponse - end - - assert_pattern do - response => { - action_id: String, - ids: ^(ModerationAPI::Internal::Type::ArrayOf[String]), - success: ModerationAPI::Internal::Type::Boolean - } - end - end -end diff --git a/test/moderation_api/resources/actions_test.rb b/test/moderation_api/resources/actions_test.rb deleted file mode 100644 index 8f09a3a2..00000000 --- a/test/moderation_api/resources/actions_test.rb +++ /dev/null @@ -1,116 +0,0 @@ -# frozen_string_literal: true - -require_relative "../test_helper" - -class ModerationAPI::Test::Resources::ActionsTest < ModerationAPI::Test::ResourceTest - def test_create_required_params - skip("Mock server tests are disabled") - - response = @moderation_api.actions.create(name: "name") - - assert_pattern do - response => ModerationAPI::Models::ActionCreateResponse - end - - assert_pattern do - response => { - id: String, - built_in: ModerationAPI::Internal::Type::Boolean | nil, - created_at: String, - filter_in_queue_ids: ^(ModerationAPI::Internal::Type::ArrayOf[String]), - free_text: ModerationAPI::Internal::Type::Boolean, - name: String, - position: ModerationAPI::Models::ActionCreateResponse::Position, - possible_values: ^(ModerationAPI::Internal::Type::ArrayOf[ModerationAPI::Models::ActionCreateResponse::PossibleValue]), - queue_behaviour: ModerationAPI::Models::ActionCreateResponse::QueueBehaviour, - value_required: ModerationAPI::Internal::Type::Boolean, - description: String | nil, - key: String | nil, - type: ModerationAPI::Models::ActionCreateResponse::Type | nil - } - end - end - - def test_retrieve - skip("Mock server tests are disabled") - - response = @moderation_api.actions.retrieve("id") - - assert_pattern do - response => ModerationAPI::Models::ActionRetrieveResponse - end - - assert_pattern do - response => { - id: String, - built_in: ModerationAPI::Internal::Type::Boolean | nil, - created_at: String, - filter_in_queue_ids: ^(ModerationAPI::Internal::Type::ArrayOf[String]), - free_text: ModerationAPI::Internal::Type::Boolean, - name: String, - position: ModerationAPI::Models::ActionRetrieveResponse::Position, - possible_values: ^(ModerationAPI::Internal::Type::ArrayOf[ModerationAPI::Models::ActionRetrieveResponse::PossibleValue]), - queue_behaviour: ModerationAPI::Models::ActionRetrieveResponse::QueueBehaviour, - value_required: ModerationAPI::Internal::Type::Boolean, - description: String | nil, - key: String | nil, - type: ModerationAPI::Models::ActionRetrieveResponse::Type | nil - } - end - end - - def test_update - skip("Mock server tests are disabled") - - response = @moderation_api.actions.update("id") - - assert_pattern do - response => ModerationAPI::Models::ActionUpdateResponse - end - - assert_pattern do - response => { - id: String, - built_in: ModerationAPI::Internal::Type::Boolean | nil, - created_at: String, - filter_in_queue_ids: ^(ModerationAPI::Internal::Type::ArrayOf[String]), - free_text: ModerationAPI::Internal::Type::Boolean, - name: String, - position: ModerationAPI::Models::ActionUpdateResponse::Position, - possible_values: ^(ModerationAPI::Internal::Type::ArrayOf[ModerationAPI::Models::ActionUpdateResponse::PossibleValue]), - queue_behaviour: ModerationAPI::Models::ActionUpdateResponse::QueueBehaviour, - value_required: ModerationAPI::Internal::Type::Boolean, - description: String | nil, - key: String | nil, - type: ModerationAPI::Models::ActionUpdateResponse::Type | nil - } - end - end - - def test_list - skip("Mock server tests are disabled") - - response = @moderation_api.actions.list - - assert_pattern do - response => ^(ModerationAPI::Internal::Type::ArrayOf[ModerationAPI::Models::ActionListResponseItem]) - end - end - - def test_delete - skip("Mock server tests are disabled") - - response = @moderation_api.actions.delete("id") - - assert_pattern do - response => ModerationAPI::Models::ActionDeleteResponse - end - - assert_pattern do - response => { - id: String, - deleted: ModerationAPI::Internal::Type::Boolean - } - end - end -end diff --git a/test/moderation_api/resources/auth_test.rb b/test/moderation_api/resources/auth_test.rb deleted file mode 100644 index 01619976..00000000 --- a/test/moderation_api/resources/auth_test.rb +++ /dev/null @@ -1,40 +0,0 @@ -# frozen_string_literal: true - -require_relative "../test_helper" - -class ModerationAPI::Test::Resources::AuthTest < ModerationAPI::Test::ResourceTest - def test_create - skip("Mock server tests are disabled") - - response = @moderation_api.auth.create - - assert_pattern do - response => ModerationAPI::Models::AuthCreateResponse - end - - assert_pattern do - response => { - message: String, - project: String, - status: String - } - end - end - - def test_retrieve - skip("Mock server tests are disabled") - - response = @moderation_api.auth.retrieve - - assert_pattern do - response => ModerationAPI::Models::AuthRetrieveResponse - end - - assert_pattern do - response => { - message: String, - status: String - } - end - end -end diff --git a/test/moderation_api/resources/authors_test.rb b/test/moderation_api/resources/authors_test.rb deleted file mode 100644 index ebaff782..00000000 --- a/test/moderation_api/resources/authors_test.rb +++ /dev/null @@ -1,131 +0,0 @@ -# frozen_string_literal: true - -require_relative "../test_helper" - -class ModerationAPI::Test::Resources::AuthorsTest < ModerationAPI::Test::ResourceTest - def test_create_required_params - skip("Mock server tests are disabled") - - response = @moderation_api.authors.create(external_id: "external_id") - - assert_pattern do - response => ModerationAPI::Models::AuthorCreateResponse - end - - assert_pattern do - response => { - id: String, - block: ModerationAPI::Models::AuthorCreateResponse::Block | nil, - first_seen: Float, - last_seen: Float, - metadata: ModerationAPI::Models::AuthorCreateResponse::Metadata, - metrics: ModerationAPI::Models::AuthorCreateResponse::Metrics, - risk_evaluation: ModerationAPI::Models::AuthorCreateResponse::RiskEvaluation | nil, - status: ModerationAPI::Models::AuthorCreateResponse::Status, - trust_level: ModerationAPI::Models::AuthorCreateResponse::TrustLevel, - company: String | nil, - email: String | nil, - external_id: String | nil, - external_link: String | nil, - last_incident: Float | nil, - name: String | nil, - profile_picture: String | nil - } - end - end - - def test_retrieve - skip("Mock server tests are disabled") - - response = @moderation_api.authors.retrieve("id") - - assert_pattern do - response => ModerationAPI::Models::AuthorRetrieveResponse - end - - assert_pattern do - response => { - id: String, - block: ModerationAPI::Models::AuthorRetrieveResponse::Block | nil, - first_seen: Float, - last_seen: Float, - metadata: ModerationAPI::Models::AuthorRetrieveResponse::Metadata, - metrics: ModerationAPI::Models::AuthorRetrieveResponse::Metrics, - risk_evaluation: ModerationAPI::Models::AuthorRetrieveResponse::RiskEvaluation | nil, - status: ModerationAPI::Models::AuthorRetrieveResponse::Status, - trust_level: ModerationAPI::Models::AuthorRetrieveResponse::TrustLevel, - company: String | nil, - email: String | nil, - external_id: String | nil, - external_link: String | nil, - last_incident: Float | nil, - name: String | nil, - profile_picture: String | nil - } - end - end - - def test_update - skip("Mock server tests are disabled") - - response = @moderation_api.authors.update("id") - - assert_pattern do - response => ModerationAPI::Models::AuthorUpdateResponse - end - - assert_pattern do - response => { - id: String, - block: ModerationAPI::Models::AuthorUpdateResponse::Block | nil, - first_seen: Float, - last_seen: Float, - metadata: ModerationAPI::Models::AuthorUpdateResponse::Metadata, - metrics: ModerationAPI::Models::AuthorUpdateResponse::Metrics, - risk_evaluation: ModerationAPI::Models::AuthorUpdateResponse::RiskEvaluation | nil, - status: ModerationAPI::Models::AuthorUpdateResponse::Status, - trust_level: ModerationAPI::Models::AuthorUpdateResponse::TrustLevel, - company: String | nil, - email: String | nil, - external_id: String | nil, - external_link: String | nil, - last_incident: Float | nil, - name: String | nil, - profile_picture: String | nil - } - end - end - - def test_list - skip("Mock server tests are disabled") - - response = @moderation_api.authors.list - - assert_pattern do - response => ModerationAPI::Models::AuthorListResponse - end - - assert_pattern do - response => { - authors: ^(ModerationAPI::Internal::Type::ArrayOf[ModerationAPI::Models::AuthorListResponse::Author]), - pagination: ModerationAPI::Models::AuthorListResponse::Pagination - } - end - end - - def test_delete - skip("Mock server tests are disabled") - - response = @moderation_api.authors.delete("id") - - assert_pattern do - response => ModerationAPI::Models::AuthorDeleteResponse - end - - assert_pattern do - response => { - success: ModerationAPI::Internal::Type::Boolean - } - end - end -end diff --git a/test/moderation_api/resources/content_test.rb b/test/moderation_api/resources/content_test.rb deleted file mode 100644 index 75853743..00000000 --- a/test/moderation_api/resources/content_test.rb +++ /dev/null @@ -1,39 +0,0 @@ -# frozen_string_literal: true - -require_relative "../test_helper" - -class ModerationAPI::Test::Resources::ContentTest < ModerationAPI::Test::ResourceTest - def test_stream_required_params - skip("Mock server tests are disabled") - - response = @moderation_api.content.stream(sec_web_socket_protocol: :"moderationapi.v1") - - assert_pattern do - response => nil - end - end - - def test_submit_required_params - skip("Mock server tests are disabled") - - response = @moderation_api.content.submit(content: {text: "text", type: :text}) - - assert_pattern do - response => ModerationAPI::Models::ContentSubmitResponse - end - - assert_pattern do - response => { - author: ModerationAPI::Models::ContentSubmitResponse::Author | nil, - casebook: ModerationAPI::Models::ContentSubmitResponse::Casebook | nil, - content: ModerationAPI::Models::ContentSubmitResponse::Content, - evaluation: ModerationAPI::Models::ContentSubmitResponse::Evaluation, - insights: ^(ModerationAPI::Internal::Type::ArrayOf[union: ModerationAPI::Models::ContentSubmitResponse::Insight]), - meta: ModerationAPI::Models::ContentSubmitResponse::Meta, - policies: ^(ModerationAPI::Internal::Type::ArrayOf[union: ModerationAPI::Models::ContentSubmitResponse::Policy]), - recommendation: ModerationAPI::Models::ContentSubmitResponse::Recommendation, - errors: ^(ModerationAPI::Internal::Type::ArrayOf[ModerationAPI::Models::ContentSubmitResponse::Error]) | nil - } - end - end -end diff --git a/test/moderation_api/resources/queue/items_test.rb b/test/moderation_api/resources/queue/items_test.rb deleted file mode 100644 index 0217ffe9..00000000 --- a/test/moderation_api/resources/queue/items_test.rb +++ /dev/null @@ -1,58 +0,0 @@ -# frozen_string_literal: true - -require_relative "../../test_helper" - -class ModerationAPI::Test::Resources::Queue::ItemsTest < ModerationAPI::Test::ResourceTest - def test_list - skip("Mock server tests are disabled") - - response = @moderation_api.queue.items.list("id") - - assert_pattern do - response => ModerationAPI::Models::Queue::ItemListResponse - end - - assert_pattern do - response => { - items: ^(ModerationAPI::Internal::Type::ArrayOf[ModerationAPI::Models::Queue::ItemListResponse::Item]), - pagination: ModerationAPI::Models::Queue::ItemListResponse::Pagination - } - end - end - - def test_resolve_required_params - skip("Mock server tests are disabled") - - response = @moderation_api.queue.items.resolve("itemId", id: "id") - - assert_pattern do - response => ModerationAPI::Models::Queue::ItemResolveResponse - end - - assert_pattern do - response => { - resolved_at: String, - success: ModerationAPI::Internal::Type::Boolean, - comment: String | nil - } - end - end - - def test_unresolve_required_params - skip("Mock server tests are disabled") - - response = @moderation_api.queue.items.unresolve("itemId", id: "id") - - assert_pattern do - response => ModerationAPI::Models::Queue::ItemUnresolveResponse - end - - assert_pattern do - response => { - status: String, - success: ModerationAPI::Internal::Type::Boolean, - unresolved_at: String - } - end - end -end diff --git a/test/moderation_api/resources/queue_test.rb b/test/moderation_api/resources/queue_test.rb deleted file mode 100644 index 5046cf26..00000000 --- a/test/moderation_api/resources/queue_test.rb +++ /dev/null @@ -1,40 +0,0 @@ -# frozen_string_literal: true - -require_relative "../test_helper" - -class ModerationAPI::Test::Resources::QueueTest < ModerationAPI::Test::ResourceTest - def test_retrieve - skip("Mock server tests are disabled") - - response = @moderation_api.queue.retrieve("id") - - assert_pattern do - response => ModerationAPI::Models::QueueRetrieveResponse - end - - assert_pattern do - response => { - queue: ModerationAPI::Models::QueueRetrieveResponse::Queue - } - end - end - - def test_get_stats - skip("Mock server tests are disabled") - - response = @moderation_api.queue.get_stats("id") - - assert_pattern do - response => ModerationAPI::Models::QueueGetStatsResponse - end - - assert_pattern do - response => { - action_stats: ^(ModerationAPI::Internal::Type::ArrayOf[ModerationAPI::Models::QueueGetStatsResponse::ActionStat]), - review_stats: ModerationAPI::Models::QueueGetStatsResponse::ReviewStats, - top_reviewers: ^(ModerationAPI::Internal::Type::ArrayOf[ModerationAPI::Models::QueueGetStatsResponse::TopReviewer]), - trends: ModerationAPI::Models::QueueGetStatsResponse::Trends - } - end - end -end diff --git a/test/moderation_api/resources/webhook_secret_test.rb b/test/moderation_api/resources/webhook_secret_test.rb deleted file mode 100644 index 73c7d24f..00000000 --- a/test/moderation_api/resources/webhook_secret_test.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true - -require_relative "../test_helper" - -class ModerationAPI::Test::Resources::WebhookSecretTest < ModerationAPI::Test::ResourceTest - def test_retrieve - skip("Mock server tests are disabled") - - response = @moderation_api.webhook_secret.retrieve - - assert_pattern do - response => ModerationAPI::Models::WebhookSecretRetrieveResponse - end - - assert_pattern do - response => { - secret: String - } - end - end -end diff --git a/test/moderation_api/resources/webhooks_test.rb b/test/moderation_api/resources/webhooks_test.rb deleted file mode 100644 index 6363ab92..00000000 --- a/test/moderation_api/resources/webhooks_test.rb +++ /dev/null @@ -1,99 +0,0 @@ -# frozen_string_literal: true - -require_relative "../test_helper" - -class ModerationAPI::Test::Resources::WebhooksTest < ModerationAPI::Test::ResourceTest - def test_create_required_params - skip("Mock server tests are disabled") - - response = - @moderation_api.webhooks.create(event_types: [:QUEUE_ITEM_NEW], name: "x", url: "https://example.com") - - assert_pattern do - response => ModerationAPI::Models::WebhookCreateResponse - end - - assert_pattern do - response => { - id: String, - created_at: String, - event_types: ^(ModerationAPI::Internal::Type::ArrayOf[enum: ModerationAPI::Models::WebhookCreateResponse::EventType]), - name: String, - payload_version: ModerationAPI::Models::WebhookCreateResponse::PayloadVersion, - url: String, - description: String | nil - } - end - end - - def test_retrieve - skip("Mock server tests are disabled") - - response = @moderation_api.webhooks.retrieve("id") - - assert_pattern do - response => ModerationAPI::Models::WebhookRetrieveResponse - end - - assert_pattern do - response => { - id: String, - created_at: String, - event_types: ^(ModerationAPI::Internal::Type::ArrayOf[enum: ModerationAPI::Models::WebhookRetrieveResponse::EventType]), - name: String, - payload_version: ModerationAPI::Models::WebhookRetrieveResponse::PayloadVersion, - url: String, - description: String | nil - } - end - end - - def test_update - skip("Mock server tests are disabled") - - response = @moderation_api.webhooks.update("id") - - assert_pattern do - response => ModerationAPI::Models::WebhookUpdateResponse - end - - assert_pattern do - response => { - id: String, - created_at: String, - event_types: ^(ModerationAPI::Internal::Type::ArrayOf[enum: ModerationAPI::Models::WebhookUpdateResponse::EventType]), - name: String, - payload_version: ModerationAPI::Models::WebhookUpdateResponse::PayloadVersion, - url: String, - description: String | nil - } - end - end - - def test_list - skip("Mock server tests are disabled") - - response = @moderation_api.webhooks.list - - assert_pattern do - response => ^(ModerationAPI::Internal::Type::ArrayOf[ModerationAPI::Models::WebhookListResponseItem]) - end - end - - def test_delete - skip("Mock server tests are disabled") - - response = @moderation_api.webhooks.delete("id") - - assert_pattern do - response => ModerationAPI::Models::WebhookDeleteResponse - end - - assert_pattern do - response => { - id: String, - deleted: ModerationAPI::Internal::Type::Boolean - } - end - end -end diff --git a/test/moderation_api/resources/wordlist/words_test.rb b/test/moderation_api/resources/wordlist/words_test.rb deleted file mode 100644 index d0a9b939..00000000 --- a/test/moderation_api/resources/wordlist/words_test.rb +++ /dev/null @@ -1,41 +0,0 @@ -# frozen_string_literal: true - -require_relative "../../test_helper" - -class ModerationAPI::Test::Resources::Wordlist::WordsTest < ModerationAPI::Test::ResourceTest - def test_add_required_params - skip("Mock server tests are disabled") - - response = @moderation_api.wordlist.words.add("id", words: ["string"]) - - assert_pattern do - response => ModerationAPI::Models::Wordlist::WordAddResponse - end - - assert_pattern do - response => { - added_count: Float, - added_words: ^(ModerationAPI::Internal::Type::ArrayOf[String]), - total_count: Float - } - end - end - - def test_remove_required_params - skip("Mock server tests are disabled") - - response = @moderation_api.wordlist.words.remove("id", words: ["string"]) - - assert_pattern do - response => ModerationAPI::Models::Wordlist::WordRemoveResponse - end - - assert_pattern do - response => { - removed_count: Float, - removed_words: ^(ModerationAPI::Internal::Type::ArrayOf[String]), - total_count: Float - } - end - end -end diff --git a/test/moderation_api/resources/wordlist_test.rb b/test/moderation_api/resources/wordlist_test.rb deleted file mode 100644 index ce64eaf7..00000000 --- a/test/moderation_api/resources/wordlist_test.rb +++ /dev/null @@ -1,77 +0,0 @@ -# frozen_string_literal: true - -require_relative "../test_helper" - -class ModerationAPI::Test::Resources::WordlistTest < ModerationAPI::Test::ResourceTest - def test_retrieve - skip("Mock server tests are disabled") - - response = @moderation_api.wordlist.retrieve("id") - - assert_pattern do - response => ModerationAPI::Models::WordlistRetrieveResponse - end - - assert_pattern do - response => { - id: String, - created_at: String, - name: String | nil, - organization_id: String, - strict: ModerationAPI::Internal::Type::Boolean, - user_id: String | nil, - words: ^(ModerationAPI::Internal::Type::ArrayOf[String]) - } - end - end - - def test_update - skip("Mock server tests are disabled") - - response = @moderation_api.wordlist.update("id") - - assert_pattern do - response => ModerationAPI::Models::WordlistUpdateResponse - end - - assert_pattern do - response => { - id: String, - created_at: String, - name: String | nil, - organization_id: String, - strict: ModerationAPI::Internal::Type::Boolean, - user_id: String | nil, - words: ^(ModerationAPI::Internal::Type::ArrayOf[String]) - } - end - end - - def test_list - skip("Mock server tests are disabled") - - response = @moderation_api.wordlist.list - - assert_pattern do - response => ^(ModerationAPI::Internal::Type::ArrayOf[ModerationAPI::Models::WordlistListResponseItem]) - end - end - - def test_get_embedding_status - skip("Mock server tests are disabled") - - response = @moderation_api.wordlist.get_embedding_status("id") - - assert_pattern do - response => ModerationAPI::Models::WordlistGetEmbeddingStatusResponse - end - - assert_pattern do - response => { - progress: Float, - remaining_words: Float, - total_words: Float - } - end - end -end diff --git a/test/moderation_api/test_helper.rb b/test/moderation_api/test_helper.rb deleted file mode 100644 index b38a4fa7..00000000 --- a/test/moderation_api/test_helper.rb +++ /dev/null @@ -1,87 +0,0 @@ -# frozen_string_literal: true - -# Requiring this file from each test file ensures we always do the following, even -# when running a single-file test: -# - Load the whole gem (as one would in production) -# - Define shared testing namespace so that we don't need to indent test files as much -# - Setting up testing dependencies - -require "digest" -require "singleton" - -require "async" -require "minitest/autorun" -require "minitest/focus" -require "minitest/hooks/test" -require "minitest/proveit" -require "minitest/rg" -require "webmock" - -require_relative "../../lib/moderation_api" -require_relative "resource_namespaces" - -module Kernel - alias_method :_sleep, :sleep - - def sleep(secs) - case Thread.current.thread_variable_get(:mock_sleep) - in Array => counter - counter << secs - secs - else - _sleep(secs) - end - end -end - -class Time - class << self - alias_method :_now, :now - end - - def self.now = Thread.current.thread_variable_get(:time_now) || _now -end - -class ModerationAPI::Test::SingletonClient < ModerationAPI::Client - include Singleton - - TEST_API_BASE_URL = ENV.fetch("TEST_API_BASE_URL", "http://localhost:4010") - - def initialize - super(base_url: ModerationAPI::Test::SingletonClient::TEST_API_BASE_URL, secret_key: "My Secret Key") - end -end - -module Minitest::Serial - def test_order = :random - - def run_one_method(...) = Minitest::Runnable.run_one_method(...) -end - -class Minitest::Test - include Minitest::Hooks - - make_my_diffs_pretty! - parallelize_me! - prove_it! -end - -class ModerationAPI::Test::ResourceTest < Minitest::Test - def async? - return @async unless @async.nil? - @async = Digest::SHA256.hexdigest(self.class.name).to_i(16).odd? - end - - def before_all - super - @moderation_api = ModerationAPI::Test::SingletonClient.instance - end - - def around_all = async? ? Sync { super } : super - - def around = async? ? Async { super }.wait : super -end - -module WebMock - AssertionFailure.error_class = Minitest::Assertion -end